tags:

views:

45

answers:

2

What Javascript function is used to check for a certain plugin? Such as for Silverlight, Flash, Quake Live, Real Player...

+2  A: 

"Use the mimeTypes property to see if the browser supports a particular MIME Type, such as application/x-shockwave-flash. If it does, you know that Flash Player is installed. "

http://www.adobe.com/support/flash/how/shock/javaplugs/javaplugs02.html

jshen
+3  A: 

There are various ways:

if (navigator.plugins) {
  for (var i = 0; i < navigator.plugins.length; i++) {
    //blah blah blah
  }
} else if (navigator.mimeTypes) {
     var useFlash = navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
} else { //Usually IE crap....lol

}

Basically in summary:

  • navigator.plugins
  • navigator.mimeTypes

and For IE, check this site as example: http://www.rgagnon.com/jsdetails/js-0056.html

Apparently you can use VBScript to check plugins (only in IE).

The Elite Gentleman