IE9 users can disable an add-on, such as a browser helper object, by clicking on the cog button and selecting "Manage Add-Ons". I need to detect if a given add-on has been disabled in such way, using JavaScript.
I can't seem to find a way for my error handler (<object ... onerror="myhandler(event)") to detect that the BHO has been disabled. errorEvent.type is simply "error". Is there any way?
I need to detect this scenario because just having the webpage try to install the BHO again yields no result. IE9 simply ignores the request. The user isn't shown any warnings either, so neither him nor the webpage know what's going on.
Some background:
Internet Explorer 9 identifies browser helper objects that took a long time to start and reports those to the user, with a big button to disable them. This means that a lot of users will be disabling BHOs they actually need, if only by the sheer impulse to click on big buttons.
This also means my company is in some trouble, as we make a BHO which is used by a significant amount of clients and is sometimes (but not always) identified as being too slow. We are working hard on making it start up faster. But in the meantime we need some way to detect that a user has disabled our BHO and ask them to enable it again.
There is no script-accessible mechanism that would allow you to reliably distinguish between an add-on not being installed vs. being installed and disabled.
There's also, generally, no way for a page to know whether a BHO is installed even if it's enabled unless the BHO explicitly exposes a DOM-accessible property.
发布评论
评论(2)
没有脚本可访问的机制可以让您可靠地区分未安装的附加组件与已安装和禁用的附加组件。
通常,页面也无法知道 BHO 是否已安装(即使已启用),除非 BHO 显式公开可访问 DOM 的属性。
您可以使用 window.external.msActiveXFilteringEnabled() API。
There is no script-accessible mechanism that would allow you to reliably distinguish between an add-on not being installed vs. being installed and disabled.
There's also, generally, no way for a page to know whether a BHO is installed even if it's enabled unless the BHO explicitly exposes a DOM-accessible property.
You can detect whether ActiveX add-ons are disabled by ActiveX Filtering using the window.external.msActiveXFilteringEnabled() API.
埃里克,
对于这样的伎俩,你怎么看?
(这个想法借鉴自 http://keep12on.com/ 2011/05/26/Detecting-extension-uninstallations-on-chrome/)
谢谢
Eric,
What do you think of this sort of trick?
(The idea is borrowed from http://keep12on.com/2011/05/26/detecting-extension-uninstallations-on-chrome/)
Thanks