mitro-co / mitro

Repository for all Mitro client & server code
GNU General Public License v3.0
1.64k stars 242 forks source link

Fix Firefox 32 #69

Closed ahilss closed 10 years ago

ahilss commented 10 years ago

Event objects passed into page_worker message handlers now appear to be immutable in FF32. We were mutating the event object by adding a setResponse function and replacing _callback_x strings in the message args with onSuccess and onError handlers. This is why we were seeing exceptions about onError being undefined. Making a deep copy of the message data fixes the issue.

It looks like events passed in contexts other than page_worker are still mutable, but we should still fix them to protect against changes like this in the future. Mutating input parameters is a bad idea, especially when those parameters come from third-party code.

rnewman commented 10 years ago

It would be worthwhile testing with Electrolysis enabled in a current Nightly; it'll bump into issues similar to this one.

https://wiki.mozilla.org/Electrolysis https://developer.mozilla.org/en-US/Add-ons/Working_with_multiprocess_Firefox https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox

denadai2 commented 10 years ago

@ahilss I love you

splnlss commented 10 years ago

Yeah, thanks a ton for the fix!

On Oct 13, 2014, at 9:53 AM, Marco De Nadai notifications@github.com wrote:

@ahilss I love you

— Reply to this email directly or view it on GitHub.

DashW commented 9 years ago

Any idea when this fix might make it into a stable release? Especially considering we're up to Firefox 35 now o_0