使用JavaScript检测NPAPI支持 [英] Detecting NPAPI support using JavaScript

查看:161
本文介绍了使用JavaScript检测NPAPI支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从JavaScript检测浏览器是否支持NPAPI?并非所有人都能做到,尽管我可以依靠用户代理,但我宁愿以一种更可靠的方式(如果存在的话)这样做。

How can you detect if a browser supports NPAPI from JavaScript? Not all of them do, and whilst I could rely on the user-agent I'd much rather do it a more reliable way if one exists.

不幸的是,我可以

谢谢。<<不要仅仅检测我的插件是否已加载,因为可能是该插件尚未安装在受支持的浏览器上。 / p>

Thanks.

推荐答案

没有为此的JS API,但除了基于IE / Trident的浏览器和ChromeOS之外,基本上所有桌面浏览器都支持NPAPI。

There is no JS API for this, but basically all desktop browsers except IE-/Trident-based ones and ChromeOS support NPAPI.

您可以通过检查 navigator.plugins

You can find out wether your plugin is installed by checking navigator.plugins.

这篇关于使用JavaScript检测NPAPI支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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