Detect web plug-ins Flash, Media PLayer and more…

Cut & Paste Detect Plugin (Flash, Java, RealPlayer etc) script

Credit: Frederic

Description: Frederic’s versatile plugin detector can be used to detect most of the important browser plugins. They include:

– Flash
– Windows Media Player
– Java
– Shockwave
– RealPlayer
– QuickTime
– Acrobat Reader
– SVG Viewer

Working in both IE and NS, this is a very handy script to have around!

Example: Check if your browser supports flash:

You have flash installed

Directions

Step 1: Add the following code to the HEAD section of your page:

Step 2: Download the following .js file, and upload into your web page directory:

plugins.js (download by right clicking, and selecting “save as”)

Using the script

The way this script operates is by returning a variable “pluginlist“, which contains a comma separated list of working plugins of your browser. The full list of plugins it detects are:

– Flash
– Windows Media Player
– Java
– Shockwave
– RealPlayer
– QuickTime
– Acrobat Reader
– SVG Viewer

To detect, for example, if a browser supports Windows Media Player, you would use any relevant string methods to search for this text inside pluginlist:

if (pluginlist.indexOf("Windows Media Player")!=-1)
alert("You have Win Media Player installed!")

Leave a Reply