【问题标题】:Navigator.plugins does not display all pluginsNavigator.plugins 不显示所有插件
【发布时间】:2014-03-03 08:07:42
【问题描述】:

我正在努力检测网络浏览器上的 adblock 插件,我注意到了

navigator.plugins  

返回一个包含已安装插件列表的 PluginArray 对象数组。

Java Applet Plug-in
Shockwave Flash
Picasa
QuickTime Plug-in

但出乎意料的是它并没有返回所有插件,诸如“User Agent Switcher”和“Adblock”之类的插件没有被列出(与@987654321 中所说的相反@)。

为什么它不显示所有插件(我错过了什么)或者我如何显示所有插件?

【问题讨论】:

  • 它们不是插件,它们是扩展。
  • 但是函数不应该是navigator.extensions吗?
  • 没有 navigator.extensions 之类的东西

标签: javascript php html plugins browser


【解决方案1】:

浏览器不再返回插件数组,除了最常见的插件,如 Shockwave flash、Java 等。我想避免浏览器指纹识别。您应该检查您特别感兴趣的每个插件,例如

navigator.plugins["Silverlight Plug-In"].name

More info here

【讨论】:

    【解决方案2】:

    您可以尝试检查这些扩展程序如何修改您的页面。作为 Chrome 的用户代理切换器示例:

    if (window.new_nav && window.old_navigator && window.new_nav.userAgent === navigator.userAgent) {
        console.log('user changed navigator.userAgent, real one:', window.old_navigator.userAgent);
    }
    

    要检测 adBlock,您可以查看这个问题 -> stackoverflow.com

    【讨论】:

    • 由于某些要求,我无法检测到 DOM 的变化,所以我唯一的选择是检查是否安装了扩展。
    • 我认为不可能。
    猜你喜欢
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 2017-10-01
    • 2014-12-14
    • 1970-01-01
    • 2020-11-05
    • 2017-05-06
    • 1970-01-01
    相关资源
    最近更新 更多