In Google Chrome Android, how to configure an anti-insecure system for inappropriate-like-secure processing

advertisements

I'm using getUserMedia() in my web app which works fine when I test my app on localhost. But if I treat my laptop as server and launch app in Google Chrome browser of my android phone, it gives me the error:

getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

When I checked [https://goo.gl/rStTGz][1] I got to know that getUserMedia() is deprecated on insecure origins. It is written that for development mode,

You can run chrome with the --unsafely-treat-insecure-origin-as-secure="example.com" flag (replacing "example.com" with the origin you actually want to test)

How and where can I set this flag? Is there any other alternative?


I faced with this problem too, but in Chromium, Ubuntu. I solved the problem with running this command in console:

chromium-browser --unsafely-treat-insecure-origin-as-secure="http://localhost.dev:3000" --user-data-dir=~/.config/chromium/Profile 1

where localhost.dev:3000 is your website.

For other systems information there:

where is data directory

how to launch chrome and set keys

Short information about --unsafely-treat-insecure-origin-as-secure flag:

Treat given (insecure) origins as secure origins. Multiple origins can be supplied. Has no effect unless --user-data-dir is also supplied. Example:

--unsafely-treat-insecure-origin-as-secure=http://a.test,http://b.test --user-data-dir=/test/only/profile/dir

I didn't check, but for android you maybe can also set flags on chrome://flags page.