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
Kindly translated by creamd
Komentáře » přidat
Tento článek byl uzavřen. Už není možné k němu přidávat komentáře ani hlasovat