如何在 IE9 中检测用户禁用了某个加载项?

发布于 2024-10-26 11:51:32 字数 628 浏览 1 评论 0 原文

IE9 用户可以通过单击齿轮按钮并选择“管理加载项”来禁用加载项,例如浏览器帮助程序对象。我需要使用 JavaScript 检测给定的附加组件是否已以这种方式被禁用。

我似乎无法找到一种方法让我的错误处理程序 () 检测 BHO 已被禁用。 errorEvent.type 就是“error”。有什么办法吗?

我需要检测这种情况,因为仅让网页尝试再次安装 BHO 不会产生任何结果。 IE9 简单地忽略该请求。用户也不会收到任何警告,因此他和网页都不知道发生了什么。


一些背景知识:

Internet Explorer 9 识别需要很长时间才能启动的浏览器帮助程序对象,并向用户报告这些对象,并使用一个大按钮来禁用它们。这意味着许多用户将禁用他们真正需要的 BHO,即使只是纯粹出于点击大按钮的冲动。

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

臻嫒无言 2024-11-02 11:51:32

没有脚本可访问的机制可以让您可靠地区分未安装的附加组件与已安装和禁用的附加组件。

通常,页面也无法知道 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.

小忆控 2024-11-02 11:51:32

埃里克,
对于这样的伎俩,你怎么看?

  • 该插件将脚本注入到用户访问的每个页面中。
  • 每隔一秒左右,脚本就会向附加组件发送一条“心跳请求”消息。附加组件应发送“已确认”响应。
  • 如果附加组件没有响应,则脚本假定该附加组件已被禁用或卸载,并通知服务器。

(这个想法借鉴自 http://keep12on.com/ 2011/05/26/Detecting-extension-uninstallations-on-chrome/

谢谢

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文