如何检测在Firefox / IE / Chrome浏览器中定义插件? [英] How do I detect a custom plugin in Firefox/IE/Chrome?

查看:104
本文介绍了如何检测在Firefox / IE / Chrome浏览器中定义插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队要建立一个插件为Firefox / Chrome浏览器/ IE浏览器。
如何使用JavaScript来检测是否安装了这个插件(扩展名不)?

我想有一块的JavaScript 如果安装了某个插件,可以检测的。返回true如果安装了,否则返回false。

例如...我如何才能插件列表,然后遍历,看看是否其中一人与我的插件名称?如果匹配的话,返回1。


解决方案

 解决:document.writeln(< TABLE BORDER = 1>< TR VALIGN = TOP>中,
   百分位ALIGN =左I标记,
   百分位ALIGN =左>名,
   百分位ALIGN =左>文件名,
   百分位ALIGN =左>简介,
   百分位ALIGN =左>将类型与所述#; / TR>中)
对于(i = 0; I< navigator.plugins.length;我++){
   document.writeln(< TR VALIGN = TOP>< TD>中,我,
      < TD>中,navigator.plugins [I] .name和
      &所述; TD>中,navigator.plugins [I] .filename,
      < TD>中,navigator.plugins [I] .DESCRIPTION,
      < TD>中,navigator.plugins [I]。长度,
      &所述; / TR>中)
}
document.writeln(< /表>)

My team wants to build a "plugin" for firefox/chrome/IE. How do I use javascript to detect if this plugin (not extension) is installed?

I would like to have a piece of javascript that can detect if a certain plugin is installed. Returns true if installed, returns false otherwise.

For example...how do I get a list of plugins, and then loop through to see if one of them match my plugin name? If match, return 1.

解决方案

solved:

document.writeln("<TABLE BORDER=1><TR VALIGN=TOP>",
   "<TH ALIGN=left>i",
   "<TH ALIGN=left>name",
   "<TH ALIGN=left>filename",
   "<TH ALIGN=left>description",
   "<TH ALIGN=left># of types</TR>")
for (i=0; i < navigator.plugins.length; i++) {
   document.writeln("<TR VALIGN=TOP><TD>",i,
      "<TD>",navigator.plugins[i].name,
      "<TD>",navigator.plugins[i].filename,
      "<TD>",navigator.plugins[i].description,
      "<TD>",navigator.plugins[i].length,
      "</TR>")
}
document.writeln("</TABLE>")

这篇关于如何检测在Firefox / IE / Chrome浏览器中定义插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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