从标准网页打开chrome://settings [英] Open chrome://settings from a standard webpage

查看:663
本文介绍了从标准网页打开chrome://settings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用getUserMedia访问访问者的网络摄像头,但是如果访问者拒绝访问,则不会再询问他们.

I'm using getUserMedia to access the visitor's webcam, but if the visitor denies access, they will never be asked again.

这很容易检测(访问时几乎立即拒绝访问).因此,当它被阻止时,我想将用户定向到chrome://settings/contentExceptions#media-stream,以便他们可以更改设置(我将使用浏览器检测为每个浏览器定制此链接).但是一个简单的链接使Chrome浏览器不满意:

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:

不允许加载本地资源:chrome://settings/contentExceptions#media-stream

Not allowed to load local resource: chrome://settings/contentExceptions#media-stream

我还尝试了各种基于JavaScript的方法,但结果相同,并且在互联网上找到了多个引用chrome.tabs.create作为扩展选项的资源(但这不是扩展,因此chrome.tabs不可用).

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).

我有2个问题.首先是简单的好奇心.为什么这被阻止了? (允许这样做会有什么风险?).主要问题是:我可以解决这个限制吗?

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?

推荐答案

出于安全原因,您不能这样做.

For security reasons, you can't do this.

Chrome不想让网站欺骗没有经验的用户来更改Chrome设置.

Chrome doesn't want to let websites trick inexperienced users into changing Chrome settings.

这篇关于从标准网页打开chrome://settings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆