[英]javascript to open a firefox extension
I try to open a new tab of Firefox extension (URL starts like chrome://xxx/content
) in a web page. 我尝试在网页中打开Firefox扩展的新标签页(URL以
chrome://xxx/content
开头)。
I have tried window.open().location='chrome://xxx/content';
我已经尝试过
window.open().location='chrome://xxx/content';
, but I always got a new tab like http://chrome://xxx/content
. ,但我总是得到一个新的标签,例如
http://chrome://xxx/content
。
So the question is whether there is a solution to open the Firefox extension in web-page JavaScript. 因此,问题在于是否存在一种在网页JavaScript中打开Firefox扩展的解决方案。
If the answer is yes, how to realize it? 如果答案是肯定的,那么如何实现呢?
The answer is "no". 答案是不”。 A web page is not allowed to open browser/extension user interface elements, for security reasons.
出于安全原因,不允许网页打开浏览器/扩展用户界面元素。
Now the web page could notify the extension that a particular extension page needs opening: https://developer.mozilla.org/en/Code_snippets/Interaction_between_privileged_and_non-privileged_pages . 现在,该网页可以通知扩展程序特定的扩展程序页面需要打开: https : //developer.mozilla.org/en/Code_snippets/Interaction_between_privileged_and_non-privileged_pages 。 But given that your question doesn't provide any details on what you are trying to achieve it isn't clear whether this is a viable approach for you.
但是,鉴于您的问题并未提供有关您要实现的目标的任何详细信息,因此尚不清楚这是否对您可行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.