I'm using getUserMedia
to access the visitor's webcam, but if the visitor denies access, they will never be asked again.
Detecting that is easy enough (access is denied almost instantly when requested). So when it is blocked, I want to direct the user to chrome://settings/contentExceptions#media-stream
so that they can change the setting (I'll be using browser detection to tailor this link for each browser). But a simple link makes Chrome unhappy:
Not allowed to load local resource: chrome://settings/contentExceptions#media-stream
I've also tried various JavaScript-based methods with the same result, and found several sources on the internet quoting chrome.tabs.create
as an option for extensions (but this isn't an extension so chrome.tabs
isn't available).
I have 2 questions. The first is simple curiosity; why is this blocked? (what would the risk be from allowing it?). And the main question is: can I get around this restriction?
You can open the Settings page by clicking on the icon with three stacked horizontal lines to the left of the address bar; this will open up a dropdown menu, and Settings will be located to the bottom of the screen.
To access Chrome's advanced settings, click on the three dots and select Settings from the menu and select the Advanced option on the left sidebar. The section will expand to reveal the advanced settings.
You can't nor should you. Instead, instruct the user what those settings are and what he needs to do to change them.
A simple click left of the address bar (in the omnibar of Chrome) can be used to change that setting as well.
https://support.google.com/chrome/answer/95617?hl=en
For security reasons, you can't do this.
Chrome doesn't want to let websites trick inexperienced users into changing Chrome settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With