Swaraj Chhatre
Swaraj Chhatre

Reputation: 667

Detect presence of major plugins(Java, Active-X,Flash) using Javascript

I have to detect presence of major plugins and their count that are running on browser like Java, Active-X,Flash and any major plugins that are prominently installed on browsers.I went through many examples but could not find proper directions.It would be great if someone could help me out.It should be supported for all browser versions and browsers.

Thanks in advance Swaraj

Upvotes: 0

Views: 842

Answers (1)

Jesse
Jesse

Reputation: 825

I used flash detect before for flash detection, it works pretty well.

flashetect link http://www.featureblend.com/javascript-flash-detection-library.html

Or you can alternatively use swf object that's the more standard way of doing it. SWF OBJECT, FOR FLASH CS I believe and up have the scripts embedded within the export and you can choose your options for alt content. SWFObject is officially supported by Adobe and is a better choice.

tutorial for swf object http://www.gotoandlearn.com/play.php?id=77

There is also an Adobe air app that generates code you can copy and paste.

ActiveX however is less relevant with html5, things like support for FileReaderAPI, drag and drop, blob urls, DataURLS, formData, and AJAX LEVEL2 really eliminate the need for alot of the features that were only enabled by ActiveX

ActiveX is more of a Microsoft thing (INTERNET EXPLORER 7 and lower)

for example

<script>
    function loadXMLDoc()
    {
       var xmlhttp;
       if (window.XMLHttpRequest)
     {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
     }
     else
     {// code for IE6, IE5
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
      {
         document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET","ajax_info.txt",true);
    xmlhttp.send();
   }
 </script>

thats just a quick example. The other reason is Active X gives you this big warning that users have to click on that says basically by allowing activeX the website can access your pc that scares users and generally the will not click on it to allow it.

Which brings me to java. Java applets are obsolete due to flash and html5 again, the same thing java apps in order for them to be enabled it prompts the user with a big scary popup that says enabling this app will allow for the website to access your computer. again it scares users and more often then not they will not click to allow it.

My suggestion to you is to use modernizr.js, modernizr allows for feature detection based and code loading based on what the browser supports. With HTML5 almost being standard and IE7 no longer being supported by major websites like Facebook, Youtube etc... the need for plugin detection is decreasing.

Here is a separate post about detecting ActiveX

Test if an ActiveX control is installed with Javascript?

Upvotes: 2

Related Questions