Detecting plugins in Internet Explorer without instantiating an object

Typically, when you use VBScript or JavaScript on CreateObject to detect a plug-in, the user gets a "jarring" security exception.

What are good ways to detect IE browser plugins without actually creating the object?

+1


source to share


1 answer


While I'm not sure if it is possible to test the creation of an object, you can get around the security exceptions with a try-catch javascript block.

For example:



function checkForObject() {
   try{
      var conn = new ActiveXObject('Msxml2.XMLHTTP');
      return true;
   } catch (e) {
      return false;
   }
}

      

In this case, the actual error is captured and hidden from the user.

-1


source







All Articles