问题描述
我有一个使用Twilio API进行呼叫的网站.每次拨打电话时,都会出现一个谷歌浏览器弹出窗口,说" http://www.URL.com/想要使用您的麦克风.允许/拒绝".在firefox上,它也会出现在对话框中.
I have website that uses Twilio API to make calls. Each time call is made a popup from google chrome comes up saying "http://www.URL.com/ wants to use your microphone. Allow / Deny". On firefox also it comes up in a dialog.
是否可以对其应用CSS或以某种方式自定义允许/拒绝"弹出窗口的显示方式?还是显示另一个具有自定义按钮允许/拒绝"的自定义对话框,当单击允许"时,将以某种方式触发浏览器的允许"按钮?
Is it possible to apply CSS to it or somehow customize the way Allow/Deny popup shows up? Or maybe show another custom dialog that has custom buttons of Allow/Deny and when Allow is clicked somehow triggers browser Allow button?
推荐答案
这些弹出窗口的全部要点是,浏览器正在警告用户该站点想要执行可能会对安全产生影响的操作.能够修改或禁止该弹出窗口可能使用户无法意识到安全隐患.
The whole point of these popups is that the browser is warning the user that the site wants to do something which could have security implications. Being able to modify or supress that popup could stop the user from realising the security implications.
考虑一个想听用户对话的恶意黑客.
Consider a malicious hacker who wanted to listen in to a user's conversation.
如果您的请求可以完成,那么他很容易弹出一条消息,说该网站希望向您展示一些漂亮的东西",而不是想要使用您的麦克风".用户按下接受"而没有意识到发生了什么,黑客就开始记录他们的所有对话.哎呀.
If your request could be done, it would be easy for him to pop up a message saying "This site wants to show you something pretty", instead of "wants to use your microphone". User presses "accept" without realising what's happening, and hacker gets to record all their conversations. Ouch.
因此,简短的回答是否,出于安全原因,您不能修改这些弹出窗口.
如果浏览器提供了说服,您也许可以说服用户点击接受并在不再询问我"框内打钩,但这与您将要达到的效果差不多.您肯定将无法完全摆脱该限制,也无法以任何方式对其进行自定义.
You might be able to convince the user to hit accept and tick the "don't ask me again" box if the browser provides it, but that's as close as you'll get. You definitely will not be able to get rid of the box entirely, nor will you be able to customise it in any way.
值得注意的是,即使是移动设备上的本机应用程序,在安装它们时也会发出相同类型的警告,因此这不是特定于浏览器的事情.如果您出于安全或隐私原因正在做某事,而用户可能有任何理由反对,那么系统会在允许之前对其进行警告.
It's worth noting that even native apps on mobile devices give you the same kinds of warnings when you install them, so this isn't a browser-specific thing. If you're doing something that the user might possibly have any reason to object to for security or privacy reasons, then the system will warn them before allowing it.
这篇关于是否可以使自定义“允许"在chrome&等浏览器中弹出火狐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!