How to avoid activation of Active-X in IE
Updated December 11, 2007: I’m happy to say that Microsoft has now licensed the technologies from Eolas Technologies and removing the “click to activate” requirement in Internet Explorer. Read Knowledge Base 945007.
Recently, I wrote that soon it will be necessary to click on every Flash application in Internet Explorer in order to activate it. It looks like this:
Activation of Flash by mouse-click.
You can prevent this by inserting every active element (e.g. Flash) by external script. This brings two problems:
- we have to laboriously rewrite all pages using Flash
You can prevent both difficulites using a simple trick. We will create a
script, which will re-insert already existing active elements. File
var objects = document.getElementsByTagName("object"); for (var i=0; i<objects.length; i++) objects[i].outerHTML = objects[i].outerHTML;
Property outerHTML is a proprietary feature of Internet Explorer, which doesn't make any difference, because only IE is affected by the “activating”. However, we must ensure that other browsers won't execute this script. For this we can use conditional comments.
Next thing we must ensure is, that re-inserting will be executed only after
the HTML document is loaded and DOM rendered. It's possible to call the script
window.onload event, but it will only occur after loading of all
parts of the page (images, etc.). It's more preferable to use attribute defer
which instructs IE to execute the external script right after the rendering
And just a little demonstration.
That's all. Letter of the law is being fulfilled and Flash runs without activation
remark: Solution doesn't work with Flash Satay, described once at A List Apart. This method has otherwise a whole bunch of negatives, therefore I tried to find a better and valid solution.
Kindly translated by creamd
Doesn't work when using flashvars. Flashvars are empty in object[i].outerHTML
Liviu http://www.vsoft-design.com #2
code at the end of the body, in this way you will avoid the endless loading of the page.
Tento článek byl uzavřen. Už není možné k němu přidávat komentáře.