JS Detection code HTML
1<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">2"http://www.w3.org/1999/xhtml">34<title>plugins test</title>5<script type="Text/javascript">6 function Getpluginname () {7 varinfo ="";8 varPlugins =Navigator.plugins;9 if(plugins.length>0) { Ten for(i=0; i < navigator.plugins.length; i++ ) { Oneinfo + = navigator.plugins[i].name+"<br/>"; A } - } -document.getElementById ("Divplugins"). innerhtml=info; the } - function Getffplugins () - { - varinfo=""; + varplugins=navigator.mimetypes; - if(plugins.length>0){ + for(i=0; i<navigator.mimetypes.length;i++){ AInfo+=navigator.mimetypes[i].type+":"+navigator.mimetypes[i].description+"<br/>"; at } -document.getElementById ("Divffplugins"). innerhtml=info; - } - } -Window.onload=function () { - getpluginname (); in getffplugins (); - } to</script> + -<body> the<div> This isA chrome test.</div> *<div id="Divplugins"></div> $Panax Notoginseng<div id="Divffplugins"></div> -</body>
View Code
Today detection encounters a problem, it is worth noting that when detecting mimetypes, it is case-sensitive. Whether your Firefox plugin is uppercase or lowercase, in chrome is lowercase, so when you do plug-ins, it is worth noting, preferably all lowercase.
JS non-IE Firefox plugin detection