Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test if an ActiveX control is installed with Javascript?

Is there a way to test if an ActiveX control is installed using Javascript?

like image 972
James P. Wright Avatar asked Feb 01 '10 18:02

James P. Wright


2 Answers

function AXOrNull(progId) {
  try {
    return new ActiveXObject(progId);
  }
  catch (ex) {
    return null;
  }
}
like image 163
Tomalak Avatar answered Nov 17 '22 01:11

Tomalak


Solution, try to invoke a new ActiveXObject:


function testForActiveX(){
    tester = null;
    try {
        tester = new ActiveXObject('htmlfile');
    }
     catch (e) {
        // catch the exception
    }
    if (tester) {
        // ActiveX is installed
        return true;
    }
    return false;
}
like image 23
DoctorLouie Avatar answered Nov 17 '22 00:11

DoctorLouie