Coding with Jesse

Working around "Click to activate and use this control"

August 29th, 2006

As you may likely be aware, the latest versions of Internet Explorer and Opera have decided not to give Eolas any money for their patent. Instead, users are forced to click on plugins (movies, sound, Flash and Java applets). In other words, anything inside object, embed or applet tags.

Thankfully, there is a way around this. Microsoft has documented some workarounds. I've put together a solution here that works in Opera as well:

// only execute code if 'getElementsByTagName' and 'outerHTML' are supported
if (document.getElementsByTagName && document.body.outerHTML) {
    // repeat code for each affected tag
    var tags = ['object','embed','applet'];

    for (var i in tags) {
        // get all elements with tag
        var objs = document.getElementsByTagName(tags[i]);

        for (var j=0;j < objs.length;j++) {
            var obj = objs.item(j);

            // find param tags within object
            var params = obj.getElementsByTagName('param');
            var inner = '';

            // if there are params, but param tags can't be found within innerHTML
            if (params.length && !/<param/i.test(obj.innerHTML))
                // add all param tags to 'inner' string
                for (var x=0;x < params.length;x++)
                    inner += params.item(x).outerHTML;

            // put 'inner' string with param tags in the middle of the outerHTML
            obj.outerHTML = obj.outerHTML.replace('>', '>' + inner);

Download this script here.

The code only executes on browsers which support getElementsByTagName and outerHTML (Internet Explorer, Opera and Safari - but not Firefox). It gets around the patent by dynamically "altering" the outerHTML (even though nothing is changed from the original HTML). But beware: you need to put it in an external JavaScript file to work.

To do this, simply put the code into a file. Let's say it's called eolas.js. Then put this line anywhere after all the object, embed or applet tags:

<script type="text/javascript" src="eolas.js"></script>

Alternatively, you can keep the script tags out of the body by wrapping the code in eolas.js in a function, then use my addDOMLoadEvent function to run the Eolas script once the page has loaded. So if you change eolas.js like so:

function fixEolas() {
    // same code above

then just put this in the <head> of the page:

<script type="text/javascript" src="eolas.js"></script>
<script type="text/javascript" src="adddomloadevent.js"></script>
<script type="text/javascript">

Unfortunately, the JavaScript file will be downloaded unnecessarily for users who don't use Internet Explorer or Opera. But if Safari or other browsers implement the same thing, this JavaScript code will already be in place to fix it.

And there you have it. Three cheers for horrible software patents!

Update: The code I posted before breaks objects with <param> tags in Internet Explorer. It turns out that outerHTML doesn't contain <param> tags, so extra work needs to be done to make sure they stay intact. I've updated the script accordingly.

Interested in web development? Subscribe to my newsletter!


1 . Frode at 2006-09-12T21:53:16.000Z


Nice try, but there are two problems with this solution. First of all MSIE seems to see the wrong number of param for each object if their are more than one object present in the document.

This is not a problem if the param FlashVar is not used but the second problem is that MSIE seems to ignore the value of this param and return is at an empty string.

This means that <param name="FlashVars" value="url=http://something" /> is returned as <param name="FlashVars" value="" />. This is possible to fix with only one object, but with more objects in the document it is a bit harder. I am trying to fix it to night and may have a solution in the morning.

2 . JS at 2006-09-20T18:28:43.000Z


The easiest solution I have found for flashvars is just to put in the url of the src "flash.swf?url=..."

But there are a lot of other solutions at

3 . Steeve at 2006-09-25T13:08:17.000Z


I get a message that the page contains errors in IE 6 windows me , if I refresh its fine. it

4 . Rick at 2006-12-18T05:29:53.000Z


I tried a few solutions and found this one, applied with your addDOM... script to be one of the easiest to implement. Thanks!

5 . aRchiTektUrA at 2006-12-27T20:42:39.000Z


Do you suggest to wait till a this legal non-sense is over or implement fixes? How long will it take?

6 . Jesse Skinner at 2006-12-27T20:46:46.000Z

Jesse Skinner

I'm not sure this legal non-sense will ever be over until the patent expires, and I have no idea when that will be (10 years or more?) I think we're stuck having to do this workaround for the meantime...

7 . Andres at 2006-12-28T21:32:21.000Z


This behavor was introduced as an automatic windows upgrade, search for KB925454 and uninstall it.


8 . at 2006-12-29T00:13:31.000Z

Hi Jesse,

Congratulation for your solutions!

I tried both and I opted for the function (the 2nd solution), because without AddDom (the first solution) Internet Explorer keeps loading (see at the Windows flag) until you choose another page.

The second solution works perfect on my computer and also on my hosted website ... except for the main page!

I searched and tried other scripts from Internet, nothing works for the main page. Any idee?

9 . john myles at 2007-01-08T16:55:55.000Z

john myles

NOT being a javascript expert but nevertheless use javascript in my private web pages, where can I determine how this affect me and find a full description of what to do and why?

10 . Konrad at 2007-01-11T22:31:31.000Z


Hi Jesse,

Thanks for your solution, I was looking for something that was cross browser and would work for a java applet.

However, when loading the page it appear for a second and then the applet goes grey. Any idea what could be happening here? the preview site is at



11 . Josef at 2007-02-16T11:17:53.000Z


Thanks - best solution I've found so far - works with applets aswell but the applet params are not set right so it needs some tuning for that to work...

12 . PCLIVE at 2007-03-14T16:02:39.000Z


It looks like KB918899 also includes the problem causing update. Hmmm. Maybe someone should make a list of these.

13 . David (Raspu) at 2007-03-17T04:58:04.000Z

David (Raspu)

Hi Jesse!

I'm developing a similar script since 2006 (but i didn't know yours). I would like your opinion about this []

David :D

14 . Rokkster at 2007-04-04T19:59:17.000Z


I'm confused - the version of Dreamweaver I'm using (8) has a solution for this out of the box. The moment I open a page with embedded Flash it offers to alter the code and provides a js script to upload - and the activate to click link has gone. Maybe this was an upgrade at some point - but it's definitely there.

15 . Andy at 2007-04-16T23:47:34.000Z


I can hack Opera browser to bypass "Click here to activate and use this control"?

16 . Mike at 2007-04-18T18:06:22.000Z


This is one of the only easy workarounds I've found that actually works to remove the click to activate, but has anyone else noticed that it kills animated gif's and know what I can do about that?

17 . funta at 2007-04-23T09:28:19.000Z


The one from David mentioned above worked best for me with applet/params etc..

18 . Erik at 2007-04-27T17:55:10.000Z


Hi, I've found another way:

19 . Rapid at 2007-05-10T08:42:54.000Z


Take a look at this solution with just 2 lines of code.

this site which has a solution to flash objects 'click here to activate control' not seen it before anywhere and it works on blogs as well.

20 . Ryan at 2007-05-15T16:05:12.000Z


Is there a way to activate the object if you load it dynamically using javascript? I load a PDF on a click of a link.

This is the javascript I use to do so:

var embed = document.createElement("embed");
embed.setAttribute("src", pdfURL);
embed.setAttribute("width", "800");
embed.setAttribute("height", "600");


I have tried putting Jesse's code into a js file, wrapping it around a function, then calling the function after my javascript code, but that doesn't seem to work.

Any ideas?

21 . Zelaza at 2007-06-01T04:00:42.000Z


Hi Jesse,

I tried using eola.js with adddomloadevent.js and it seems to work, BUT the little green loading ring on IE7 continues to spin all the time until I unload the page (as if the page never finished loading).

Is this something to be concerned about?

And why does it happen - I've noticed it happens with several of these Eola workarounds.


22 . Zelaza at 2007-06-01T04:06:08.000Z



Another question.

Is there any reason I couldn't use your first method but put the script in the <head> and add a "defer" as in:

<script type="text/javascript" src="eolas.js" defer="defer"></script>

Would this accomplish the same thing as adddomloadevent?

23 . Jesse Skinner at 2007-06-01T14:16:41.000Z

Jesse Skinner

@Zelaza - I'm not sure why it would cause the page to hang...

As for using 'defer', well that's actually partially how adddomloadevent works actually. But defer only works in IE, so the script takes care of doing the same in Safari, Firefox and Opera.

24 . danjal at 2007-06-14T18:20:52.000Z


Has any one a work around regarding IE not stop loading the page ??????

Please let me know - if there is anyone cool out there that could fix that....

25 . Gary at 2007-06-18T10:02:49.000Z



Has anyone tried to use this with more than one flash element on a page?

I've just tried it, and the script works fine for the first element, but subsequent elements whilst activated correctly, show the first flash animation again.

Otherwise... top solution - very easy to use - thanks!


26 . Gary Vance at 2007-06-18T10:25:24.000Z

Gary Vance

re my previous message, changing this section of the code:

for (var x=0;x < params.length;x++)
inner += params.item(x).outerHTML;

to this:

inner += params.item(j).outerHTML;

sees to do the trick. I appreciate there may be problems in other implementations, but for me this works nicely.


27 . asnara at 2007-06-27T07:00:33.000Z


Based on this solution:

"Click to activate and use..." automatic remover:

28 . SirHuckleberry at 2007-06-30T18:32:06.000Z


It seems this solution doesn't work with Java Applets and IE7. The Applet could not be displayed and if you klick on it the IE will crash. ;(

29 . Jordan Ambra at 2007-07-27T09:41:41.000Z

Jordan Ambra

I found a fun way to get rid of the IE loading bar after objects are replaced.

Replace this line:
obj.outerHTML = obj.outerHTML.replace('>', '>' + inner);

With these lines:
var strNewHTML = obj.outerHTML.replace('>', '>' + inner);
var objReplace = document.createElement("object");
objReplace.outerHTML = strNewHTML;

It looks like the replaceNode() method cancels any HTTP requests that the applet/object/Flash has open at the time, which makes the loading bar go away. Then, it will load as it should when you set the outerHTML.

30 . Prabhakar at 2007-08-03T14:45:43.000Z


I used the above code, i have four applets in a page, first i tried to use the same code as u given, i am getting blank innr strings, then

if (params.length && !/<param/i.test(obj.innerHTML)) - I modified this condition to,

if (params.length ) - now i am getting the inner HTMl output, but i am getting first applet code only !!! Help me

31 . Janne Granström at 2007-08-26T01:11:17.000Z

Janne Granström

Well.. is there any client base solution.. like some plugin for IE itself than some server scripts?

32 . Aaron L at 2007-09-25T20:38:47.000Z

Aaron L

have been trying to implement this and other similar scripts into my pager with no success...

when I use it in simple form, it works...but what I need to do is bring up an object that is loaded using .innerHTML change command. (In other words, when my page first comes up, there is no object, then, when the user clicks on something, it does an .innerHTML on a absolute positioned DIV that "pops-up" the embedded object...and, in IE, I get the good ole "Click to activate..." crap.

There must be something I can do in my case, which I admit is a bit different than usual.

Thanks folks!

33 . Hendrik at 2007-10-19T13:19:16.000Z


You can go to the following url where you can download a fix. It is very easy to implement. And based on a Java Script that you place on your ftp site.

34 . akulaarip at 2008-02-14T07:27:18.000Z


Thanks man,

Your code sure save my day.

35 . sam at 2008-03-14T13:26:54.000Z


Hi Jesse,
when I add eolas.js windows media player stop playing.why? any ideas.

36 . Alex at 2008-04-02T11:29:29.000Z


I use a lot of flash banners on my site that users click on to be taken to casino landing pages. This is the only solution I've found that consistently works on every page without interfering with the html of each page. I used your addDOMloadevent.js script and wrapped the code as a function in an external javascript page and it worked perfectly. Thank you for this life-saving piece of code. Genius!

37 . Alex at 2008-04-02T12:04:01.000Z



I had the same problem with the page still loading. Your code works superbly.


38 . Melissa A. at 2008-06-03T21:55:17.000Z

Melissa A.

I copy and pasted your code exactly, and in IE 7 it still shows the damn click here box.

I thought IE 7 shouldn't be showing the box at all in the first place, but I guess I was mistaken... I thought maybe I was using a version older than 6, so when I went to check I was certainly surprised to see 7!

I've even tried what Adobe recommends on their site, and I still can't get rid of the box....

39 . Jesse Skinner at 2008-06-03T21:56:52.000Z

Jesse Skinner

@Melissa - would you be willing to share a URL to the page where it doesn't work?

40 . Melissa A. at 2008-06-03T22:09:54.000Z

Melissa A.

It's at:

41 . Melissa A. at 2008-06-03T22:11:47.000Z

Melissa A.

Oh, and none of the other links work.

42 . Jesse Skinner at 2008-06-03T22:13:10.000Z

Jesse Skinner

The site works fine for me in IE7. How is it for anyone else?

43 . Melissa A. at 2008-06-03T22:14:25.000Z

Melissa A.

Well that's good. How does it work in IE6 for you... I wonder why mine doesn't work. o_0

44 . Rob at 2008-06-05T02:47:02.000Z

Rob worked for us as these other fixes didn't.

45 . Melissa A. at 2008-06-05T03:27:58.000Z

Melissa A.

Thanks Rob, I'll try that when I get into work tomorrow! :)

46 . naruto at 2008-07-20T11:41:51.000Z


very useful , thx so much.

47 . nilesh at 2008-12-15T09:35:07.000Z


this is not done in flash cs4...
is there any solution to remove this problem in cs4 version of flash.

thanks friends...

48 . Doug at 2009-01-05T16:26:37.000Z


Your solution is the only one I could find that works out of the box for me.


49 . Borislav Georgiev at 2009-03-24T14:23:06.000Z

Borislav Georgiev

I found very silly solution to the problem with Opera - when i added this line: <script type="text/javascript" src="/styles/eolas.js"></script>
but forgot to upload the eolas.js file everything worked fine. When I uploaded it - it stopped working.

50 . Phileas at 2009-04-23T18:17:55.000Z


Thanks a lot for the fix. Really helped me out.


51 . Jeff Morrision at 2009-09-19T11:29:21.000Z

Jeff Morrision

intresting and it ad worth to the reality

52 . Mark at 2009-10-01T09:15:04.000Z


f*** microsoft... this isn't working - could it be because I'm using ie8? Tried several other approaches too, but still getting that stupid messagebar... any ideas?

53 . Vlad at 2010-07-09T15:59:03.000Z


"Click to activate and use this control" fix for Opera 10

54 . Matt at 2010-08-12T13:01:59.000Z


Top stuff, this worked great!

55 . Kevin at 2011-03-08T07:02:17.000Z


Thanks for creating and sharing this solution. It's the best I've found so far. I like that it doesn't require one to reformat all of the object code.

56 . jeeef at 2011-08-24T14:16:58.000Z


Cool article

57 . naruto at 2011-08-24T18:50:23.000Z


I will share this article in my language Can I?

58 . Jesse Skinner at 2011-08-24T18:53:53.000Z

Jesse Skinner

@naruto - sure go ahead.