0

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

1 Answer 1

2

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?

Sign up to request clarification or add additional context in comments.

2 Comments

But how to get all plugins and its count which are installed.I tried navigator.plugins and navigator.plugins.length.It seems to work.But do you think Its the right approach.Suggest if you have a better one.
It depends on what you are trying to do, from a coding (javascript) standpoint it bloats your code when you try to detect for things you are not using. There are very few if any scenarios where you would use Flash, ActiveX, and Java in the same page. What are you trying to do support mobile? Support a certain feature across browsers? the best approach is to detect support then execute code based on those conditions. May you please give an example or be more specific about what you are trying to accomplish?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.