JS non-IE Firefox plugin detection

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.