Overcome limitation of activate ActiveX control in IE

时间:2022-09-06 22:17:33
After installing the ActiveX update patch, some webpages which contain some ActiveX controls (such as media player) will require users to manually activate such controls by clicking on it or using the TAB key and ENTER key, this is by design for security reason.

Overcome limitation of activate ActiveX control in IE

But Microsoft has a workaround as well, the key point is load ActiveX controls from external script files. By using document.write, document.createElement or innerHTML, we can bypass this kind of limitation easily.

Overcome limitation of activate ActiveX control in IE<!--  HTML File  -->
Overcome limitation of activate ActiveX control in IE
< html >
Overcome limitation of activate ActiveX control in IE  
< body  leftmargin =0  topmargin =0  scroll =no >
Overcome limitation of activate ActiveX control in IE    
< script  src ="ActiveXCtl.js" ></ script >
Overcome limitation of activate ActiveX control in IE  
</ body >
Overcome limitation of activate ActiveX control in IE
</ html >

Overcome limitation of activate ActiveX control in IE// ActiveXCtl.js
Overcome limitation of activate ActiveX control in IE
document.write(' < object classid = " clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6 " > ');
Overcome limitation of activate ActiveX control in IEdocument.write('
< param name = " URL "  value = " example.wmv " > ');
Overcome limitation of activate ActiveX control in IEdocument.write('
< param name = " autoStart "  value = " -1 " ></ object > ');

Refer to this MSDN article for detail.