You are here: Reference > JavaScript > client-side > browser > properties > enabledPlugin (mimeType)

enabledPlugin property (mimeType)

Browser support:
Returns a plugin object that contains information about the plug-in that is set to handle the data of the current MIME type.

Syntax:

object.enabledPlugin;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to the plugin object that handle the current MIME type.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the enabledPlugin property to detect the installed flash player:
<head>
    <script type="text/javascript">
        function IsFlashInstalled () {
            var info = document.getElementById ("info");
            
                // Internet Explorer supports the mimeTypes collection, but it is always empty
            if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
                // Firefox, Google Chrome, Safari, Opera
                var mime = navigator.mimeTypes['application/x-shockwave-flash'];
                if (mime && mime.enabledPlugin) {
                    var version = mime.enabledPlugin.description;
                    info.innerHTML = version + " is installed.";
                    return;
                }
            } else {
                if (typeof (ActiveXObject) != "undefined") {
                    // Internet Explorer
                    try {

                        var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.1");
                        info.innerHTML = "Flash is installed.";
                        return;
                    } 
                    catch (e) {
                    }
                }
            }

            info.innerHTML = "Flash is not installed.";
        }
    </script>
</head>
<body onload="IsFlashInstalled ()">
    <span id="info" style="color:#e08080; font-size:20px;"></span>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content