如何检测IE9中的用户已禁用加载项? [英] How to detect that an add-on has been disabled by the user in IE9?

查看:203
本文介绍了如何检测IE9中的用户已禁用加载项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE9用户可以通过单击cog按钮并选择管理加载项来禁用加载项,例如浏览器辅助对象。我需要检测一个给定的加载项是否已经使用JavaScript禁用。

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.

我似乎找不到一个方法为我的错误处理程序(< object ... onerror =myhandler(event))来检测BHO是否被禁用。 errorEvent.type 只是错误。有什么办法吗?

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?

我需要检测这种情况,因为只要有网页尝试安装BHO再没有结果。 IE9只是忽略请求。

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.

有些背景:

Internet Explorer 9会识别需要较长时间才能启动的浏览器帮助程序对象,并向用户报告这些对象,并使用大按钮禁用它们。这意味着很多用户将禁用他们实际需要的BHO,如果只是通过点击大按钮的绝对冲动。

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.

这也意味着我的公司在某些麻烦,因为我们制作一个由大量客户使用的BHO,有时(但不总是)被识别为太慢。我们正在努力使其启动更快。但是在此期间,我们需要一些方法来检测用户是否禁用了我们的BHO,并要求他们再次启用它。

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.

一般来说,除非BHO显式公开DOM可访问的属性,否则页面无法知道是否安装了BHO。

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.

您可以使用 window.external.msActiveXFilteringEnabled() API。

这篇关于如何检测IE9中的用户已禁用加载项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆