I'm using this script in Firefox:
Code: Select all
var vlcInstalled= false;
if (navigator.plugins && navigator.plugins.length) {
for (var i=0; i < navigator.plugins.length; i++ ) {
var plugin = navigator.plugins[i];
if (plugin.name.indexOf("VideoLAN") > -1
|| plugin.name.indexOf("VLC") > -1) {
vlcInstalled = true;
}
}
}
The Firefox script works fine. And this is the script I'm using in IE:
Code: Select all
var vlcInstalled= false;
var vlcObj = null;
try {
vlcObj= CreateObject("VideoLAN.VLCPlugin.1");
} catch (e) {
var msg= "Se produjo una excepción al tratar de crear el objeto VideoLAN.VLCPlugin.1:\n";
for (p in e)
msg+= "e."+p+"= " + e[p] + "\n";
window.alert (msg);
}
if( null != vlcObj )
vlcInstalled = true;
This script fails with the following error: "Se esperaba un objeto"
Well, that translates something like: "An object was expected".
So how can I detect if the plugin is installed in Internet Explorer?