Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A2699DE5 for ; Fri, 31 Aug 2012 20:22:16 +0000 (UTC) Received: (qmail 43389 invoked by uid 500); 31 Aug 2012 20:22:16 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 43368 invoked by uid 500); 31 Aug 2012 20:22:16 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 43360 invoked by uid 99); 31 Aug 2012 20:22:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 20:22:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simon.macdonald@gmail.com designates 209.85.210.47 as permitted sender) Received: from [209.85.210.47] (HELO mail-pz0-f47.google.com) (209.85.210.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 20:22:09 +0000 Received: by daks35 with SMTP id s35so2161028dak.6 for ; Fri, 31 Aug 2012 13:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=xnq3e5igX45wu1INeI0vXB5PxfpwptwJCE2ZTkkDsyo=; b=EpkUO5cF2CbpnUtLcTnUhnlPgoQSmsvJbBjiG2m0n9WO8TKzSjYWS6JuHstamOMWRm 9gD+dF9RWdn1DO9g3DKt+typa8EdLEAFSRHsnm+DKyp4HW5aRipOYo7AbiQnvP1Uix0b EzozzyBNYpy9lcQ1eLPazi/+lnSlPt3/wVcK7AUTG0aj8tbL7AdW9zPkFS7sMrXqXe8A oPFsWabT2tW6P6DWZDPcO4ATGN8mG3yYzFIIjCsDQ2ylwlSSZrY/pOEZzy0yb4eNuhav AH0B5R17BlEWD3rsZ4XIgBvA57YxHDZbJNx74MpbFPqX8GHm6hMDCuIiHZBt9wL2BRE9 Pimg== Received: by 10.68.242.42 with SMTP id wn10mr8959799pbc.105.1346444509167; Fri, 31 Aug 2012 13:21:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.21.5 with HTTP; Fri, 31 Aug 2012 13:21:28 -0700 (PDT) In-Reply-To: References: From: Simon MacDonald Date: Fri, 31 Aug 2012 16:21:28 -0400 Message-ID: Subject: Re: online events To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b339bf1adc0aa04c8958a45 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b339bf1adc0aa04c8958a45 Content-Type: text/plain; charset=ISO-8859-1 Yeah, specs change. Here is the one we originally implemented: http://www.w3.org/TR/netinfo-api/ sharp eyes will note they are using navigator.connection.type and we are using navigator.network.connection.type. That's because the Android web view would not allow us to over-ride navigator.connection. It seems to be a read only object. Simon Mac Donald http://hi.im/simonmacdonald On Fri, Aug 31, 2012 at 3:49 PM, Andrew Grieve wrote: > 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? > --047d7b339bf1adc0aa04c8958a45--