IE 11 attachEvent (addEventListener)

2,560 views
Skip to first unread message

Schmoo

unread,
Nov 9, 2013, 1:50:04 AM11/9/13
to firebre...@googlegroups.com
I have been unable to get either attachEvent (no longer supported) or addEventListener to work with my ActiveX control in IE11.  

Has anyone else had any success?

Gordon.

Schmoo

unread,
Nov 9, 2013, 2:21:35 AM11/9/13
to firebre...@googlegroups.com
Ok I have no idea why the following works (but it does!):

            registerEvent: function (evt, func) {
                if (this._plugin) {
                    if (isIE11) {
                        this._plugin["on" + evt] = func;
                    } else if (isIE) {
                        return this._plugin.attachEvent("on" + evt, func, false);
                    } else {
                        return this._plugin.addEventListener(evt, func, false);
                    }
                }
                return false;
            }

I now need to work out how to correctly set isIE, isIE11 etc...

Gordon.

Schmoo

unread,
Nov 9, 2013, 2:22:28 AM11/9/13
to firebre...@googlegroups.com
Further - this technique also works in Chrome, does anyone know "why" it would work?


On Saturday, 9 November 2013 06:50:04 UTC, Schmoo wrote:

Richard Bateman

unread,
Nov 9, 2013, 3:20:03 PM11/9/13
to FireBreath Dev Group
It works because FireBreath has always supported the old method of attaching events.  The disadvantage is that only one handler is supported using this method.

There was a pull request that I has been accepted into master that fixes the issue you're experiencing.  https://github.com/firebreath/FireBreath/pull/121

Update to master and it should fix things.

Richard


--
 
---
You received this message because you are subscribed to the Google Groups "firebreath-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebreath-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Schmoo

unread,
Nov 11, 2013, 3:55:22 AM11/11/13
to firebre...@googlegroups.com
Thanks for the info - 

I am just eye-balling the diffs between 1.7 and master and it looks like some items which have been pulled into 1.7 have not been upmerged to master (eg https://github.com/firebreath/FireBreath/pull/94).

Also do you have any comments on master stability or the ETA of a 1.8 (or 1.7.1)?  IOW Should I jump to master or back port this specific fix to my 1.7 branch...

Thanks again,

Gordon.

Richard Bateman

unread,
Nov 11, 2013, 11:04:05 AM11/11/13
to FireBreath Dev Group

Everything in 1.7 *should* be in master.  if you find anything that isn’t let me know and I’ll pull it across. For now I’d use master; if someone can test it on all three platforms and tell me it’s working well I will pull the changes into the 1.7 branch.

Richard

Schmoo

unread,
Nov 12, 2013, 1:37:32 AM11/12/13
to firebre...@googlegroups.com
You can visually see the diff here:  https://github.com/firebreath/FireBreath/network

And the commits:
c335f5b707034eb54efbd60028138394a3908589
52fc50a61d83ee2434f3137d3ca18951c136d257
b73d7996b9641191667fb2445a0d50349072bb3c
798be2e91256ff010f8f03f4f8df84859bbaabf5
45ca8ea403e7faee379a61ea5dc0e1d915d80782
a8ed832029a708b85ef85f252154cc19fa38be8f
50c533faa333ffe6f162a68780fadbf97ca93804
33a76c6d9e9e20a6296c4a37c3c8fe2c21431b51
94481be4c7e7b7b6b12dfe180ae8eda053add833
3c4157733a7afa85b76cd24fa5b1210c649f7a12

Gordon.

ValB

unread,
Jan 4, 2014, 9:27:50 PM1/4/14
to firebre...@googlegroups.com
Hi,
   I am new to Firebreath and working with some existing plugin code to get it to work on IE 11.  I am finding the same behavior, even with the latest firebreath master branch.  Specifically (obj is the plugin)
obj["on" + event] = func;
works, but
obj.addEventListener(evt, func, false)
does not.  It seems the call to addEventListener succeeds but then events never get returned. 

Any suggestions or ideas on why/ what I am doing wrong?  Thanks!

Richard Bateman

unread,
Jan 4, 2014, 11:45:02 PM1/4/14
to FireBreath Dev Group

addEventListener doesn’t seem to work with actives controls in IE ever, not even in IE9 and later where it works for other things.

Always use attachEvent with IE.

Richard

Reply all
Reply to author
Forward
0 new messages