incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@google.com>
Subject online events
Date Fri, 31 Aug 2012 19:49:59 GMT
It looks like there is code in network.js that fire online & offline events
when the network status changes. On any platform that already supports
online events, the browser will fire an event, and then the network plugin
will also fire an event.

There is also the fact that the event is fired only on document. The spec
says that listening on window should work as well (as well as
document.body): http://www.whatwg.org/specs/web-apps/current-work/

I made a test page:
https://dl.dropbox.com/u/6648754/webtests/online_events.html
Running it on android browser shows that the only two listener methods that
work are:
 -window.addEventListener
 -document.body.ononline =

So, clearly it's a bit broken. I'm wondering though, if we should do some
clean-up with these events.

Options:

1. Live with duplicate events for browsers that support them, but also fire
them on document.body and window.
2. Don't fire online/offline events from this plugin. Fire a custom
"networktypechange" event
3. Intercept all event registration an window/document/body so that the
browser's native events don't take effect. Have the only source of these
events be the network plugin.


Votes? Comments?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message