这样我通常会检测到插件,例如 Flash Player :
for (var el in navigator.plugins) {
if (navigator.plugins[el].name &&
navigator.plugins[el].name.toLowerCase().indexOf('shockwave') !== -1) {
console.log(navigator.plugins[el]);
}
}
我不是在寻找跨浏览器的解决方案,也不是想测试它是否正确。有什么方法可以测试这个插件是否激活?
最佳答案
其他两种解决方案都可以查明插件是否已安装和启用。
目前无法查明该插件是否已安装但被禁用。 Navigator.plugins
不包含仍在安装的禁用插件。
关于javascript - 是否可以通过 JavaScript 检测插件是否激活?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6889412/