开发者

How to detect that an add-on has been disabled by the user in IE9?

开发者 https://www.devze.com 2023-02-19 13:36 出处:网络
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, usin

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.

You can detect whether ActiveX add-ons are disabled by ActiveX Filtering using the window.external.msActiveXFilteringEnabled() API.


Eric, What do you think of this sort of trick?

  • The add-on injects a script into every page the user visits.
  • Once a second or so, the script sends a "heartbeat request" message to the add-on. The add-on should send "acknowledged" response.
  • If the add-on doesn't respond, the script assumes that the add-on has been disabled or uninstalled, and it notifies the server.

(The idea is borrowed from http://keep12on.com/2011/05/26/detecting-extension-uninstallations-on-chrome/)

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消