tildeio / MessageChannel.js

27 stars 3 forks source link

addEventListener is not being redifined #18

Closed jackd1 closed 10 years ago

jackd1 commented 10 years ago

I noticed while trying to use this that in Firefox Nightly, it doesn't seem to allow you to change the Window.prototype.addEventListener method from the default native function, so the listener just gets the raw data.

hjdivad commented 10 years ago

sure enough tests fail on nightly firefox. >_<

hjdivad commented 10 years ago

see https://bugzilla.mozilla.org/show_bug.cgi?id=973702

Also see https://github.com/tildeio/MessageChannel.js/tree/fix-firefox-nightly and 6e478988c359e4f9ea55f97cca9ccd7eef840613 for a patch. Please let me know if you still have problems with this patch: the test suite at least passes in firefox nightly with it.

I'm somewhat disinclined to merge the patch unless the firefox bug makes it to a released version, but hopefully the patch on our end makes your life easier.

jackd1 commented 10 years ago

Thank you, this fixes the problem for now, and I guess we'll see if Firefox makes a patch.

hjdivad commented 10 years ago

@jackd1 glad to hear this fixes the problem on your end. If this FF bug makes it to an actual released version I think we'll need to include the workaround in a released version of MessageChannel.js, but hopefully FF will just fix it upstream.

bzbarsky commented 10 years ago

The current Firefox behavior is what the WebIDL spec calls for. So unless it's not web-compatible (in the "actual sites out there are broken" sense), it will be shipping in Firefox 28. Otherwise, the spec needs to change somehow... (which introduces other problems, since the spec is the way it is for a reason).

hjdivad commented 10 years ago

Thanks for the head's up @bzbarsky. We'll include this change for 0.1.5