Plug-ins are programs that add the ability to play audio, video, animation etc. Some examples of plugins are the Adobe Flash Player, QuickTime etc. MIME Types are used to exchange file types across the Internet, such as image, audio, video etc.
You can use JavaScript to detect plugins and MIME Types.
You can detect plugins in JavaScript by looping the plugins[] array of the navigator object and accessing the properties of the plugin object. Similarly MIME Types are support by helper applications or by plug-ins.
Note: The MIME Type of plugins vary according to each platform. The MIME types array and plugins array is empty in IE. IE support ActiveX objects.
Let us see some code:
In the code shown above, we are detecting the installed plug-ins and the MIME types that it handles.
OUTPUT
In order to check for a particular plugin, like the Shockwave plugin, use the following code:
if (navigator.plugins["Shockwave"]){}
Tweet
No comments:
Post a Comment