在不同的浏览器下检测已安装的插件? [英] Detecting installed plugins under different browsers?

查看:124
本文介绍了在不同的浏览器下检测已安装的插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法在不同的浏览器上检测已安装的插件。
到目前为止,我发现你可以通过猜测是否存在chrome://path/to/some/plugin/image.gif来检测firefox上的插件。

I'm wondering if there is a way to detect installed plugins on different browsers. So far I have found that you can "detect" plugins on firefox by trying to guess if chrome://path/to/some/plugin/image.gif exists.

这个firefox的代码如下所示:

This code for firefox looks like this:

<img src="chrome://firebug/content/blank.gif" onload="var a=document.getElementById('FireBug'); a.innerHTML = 'You are using FireBug';" style="visibility:hidden">
<div id="FireBug">You are not using FireBug</div>

我很感兴趣代码在IE中看起来如何(对我来说更重要)如果有的话还有其他方法可以为其他浏览器完成这项任务吗?

I'm interested how does the code look in IE (more important to me) and if there are other ways to accomplish this task for other browsers too?

我想知道,因为我有一个白痴客户,声称他没有安装插件虽然我' 99,99%肯定他有。问题是,其中一些插件破坏了我写过的网站管理员控制面板的部分内容。

I want to know because I'm having an idiot client who claims he doesn't have installed plugins though I'm 99,99% sure he has. The problem is that some of those plugins are breaking parts of a web site admin control panel I've wrote.

无论如何,我很高兴听到任何有关获取流行浏览器插件列表的提示,技巧,变通方法等(ff,即歌剧,Chrome,safari) ):)

Anyway I'd be glad to hear any tips,tricks,workarounds and etc for getting the plugin list of the popular browsers (ff,ie,opera,chrome,safari) :)

推荐答案

此代码将列出浏览器中安装的所有插件

This code will list all the plugins installed in the browser

<html>
<body>
<div id="example"></div>
<script type="text/javascript">
var x=navigator.plugins.length; // store the total no of plugin stored 
var txt="Total plugin installed: "+x+"<br/>";
txt+="Available plugins are->"+"<br/>";
for(var i=0;i<x;i++)
{
  txt+=navigator.plugins[i].name + "<br/>"; 
}
document.getElementById("example").innerHTML=txt;
</script>
</body>
</html>

这篇关于在不同的浏览器下检测已安装的插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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