Question about:
https://github.com/apache/incubator-cordova-js/blob/master/lib/cordova.js specifically: document.addEventListener = function(evt, handler, capture) {...} window.addEventListener = function(evt, handler, capture) {...} document.removeEventListener = function(evt, handler, capture) {...} window.removeEventListener = function(evt, handler, capture) {...} The question is: GREAT ODIN'S RAVEN WHY ARE WE DOING THIS? Does the following just not work for user-created events? event = document.createEvent('Events') event.initEvent(blah) window.dispatchEvent(event) // or document.dispatchEvent(event) I dislike monkey patching, and my natural inclination is to blame it when you see problem reports of the ilk "I never got the deviceready (or whatever) message". OTOH, I do monkey patch these in weinre (I think - I used to, or something) so I can do some diagnostic work If we have to, we have to. But if we don't have to, I'd prefer we didn't. If we have to on some platform, but not others, I'd prefer we only do it on platforms that we need to do it. If we're doing it because there's (essentially) a magic linkage between these events and channels, and we muck with the "handlers" via the channels because they're magically linked, I'd prefer we didn't do that. -- Patrick Mueller http://muellerware.org
