简体   繁体   English

关闭我页面上的Firefox扩展

[英]turn off firefox extensions on my page

Can I somehow turn off all user browser-extensions (or specific ones, for Firefox or any other browser) when user enters my page? 当用户进入我的页面时,我可以以某种方式关闭所有用户浏览器扩展名(或Firefox或任何其他浏览器的特定扩展名)吗?
More specific, I'm creating new window with window.open and I want this window to have only address bar and nothing more, but some extensions, like firebug, adds their icon near the address bar. 更具体地说,我正在使用window.open创建一个新窗口,并且我希望该窗口仅具有地址栏,仅此而已,但是某些扩展程序(例如firebug)在地址栏附近添加了它们的图标。

No, you can't and you shouldn't can. 不,你不能,你不应该。

Users should do what they want with their browser 用户应该使用他们的浏览器来做他们想要的

JavaScript isn't enough powerful to do that. JavaScript不够强大。 Extensions are part of browser configuration, decided by the user. 扩展是浏览器配置的一部分,由用户决定。 And browser makers aren't so fool to let untrusted javascript code to change the configuration of the browser, because anyone would use them. 而且,浏览器制造商也不是那么傻瓜让不受信任的javascript代码更改浏览器的配置,因为任何人都可以使用它们。

And in case javascript could disable extensions, it couldn't disable them completely. 如果javascript可以禁用扩展名,则无法完全禁用扩展名。 For example, with greasemonkey extension you can run scripts at the beginning of any page. 例如,使用油脂猴子扩展名,您可以在任何页面的开头运行脚本。 Then, page's scripts will execute after, so can't block greasemonkey scripts. 然后,页面的脚本将在执行之后执行,因此不能阻止oilsmonkey脚本。 Instead, greasemonkey scripts can block following scripts using beforescriptexecute . 相反,lublessmonkey脚本可以使用beforescriptexecute阻止后续脚本。

In short: javascript isn't trusted code, so it isn't powerful. 简而言之:javascript不是受信任的代码,因此功能不强大。 But extensions are trusted code (user trusts them when he installs them), so they are more powerful than javascript. 但是扩展是受信任的代码(用户在安装扩展时会信任它们),因此扩展功能比javascript更强大。 Then, with javascript you can't disable extensions, but extensions can disable javascript. 然后,使用javascript不能禁用扩展,但是扩展可以禁用javascript。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM