You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Shazron <sh...@gmail.com> on 2012/11/21 22:02:38 UTC

InAppBrowser - events

The only diff between InAppBrowser and ChildBrowser is events support. Any
ideas for a 'web standard' way to handle this? Most users use the
ChildBrowser for OAuth, and need events.

I'm thinking of the "message" event (and MessageEvent object) from the
window.postMessage API:

1. https://developer.mozilla.org/en-US/docs/DOM/window.postMessage
2. http://www.w3.org/TR/2008/WD-html5-20080610/comms.html

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
I'd like to, if everyone agrees. I'd like to wipe out ChildBrowser use if I
can, and this (events) is the only thing I believe that people are still
using ChilBrowser for.
Is this required for the 2.3.0 release?

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:

> Great! Let's stick with one API, since we have Chrome members on the
> Cordova team the choice is obvious :)
>
>
> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > Looks that way. Given how similar they are, I don't think it matters
> which
> > one we go with (or if we come up with our own event names), but it'd be
> > good to follow the same pattern of having events and an API like
> > canGoBack(), goForward(), etc. If they ever move to standardize, then we
> > can follow suit.
> >
> >
> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > Mozilla's 'locationchange' is similar to what we have for
ChildBrowser,
> > but
> > > I don't see the equivalent in the Chrome example - I suppose it is
> > > 'loadstop'?
> > >
> > > I suppose if we were to adopt either, it would go something like this:
> > >
> > > var iab = window.open('http://apache.org', '_blank');
> > > // Firefox
> > > iab.addEventListener('locationchange', handleLocationChange);
> > > // Chrome
> > > iab.addEventListener('loadstop', handleLoadStop);
> > >
> > > // Firefox
> > > function handleLocationChange(e) {
> > >      console.log('location changed to: ' + e.detail);
> > > }
> > > // Chrome
> > > function handleLoadStop(e) {
> > >      console.log('location changed to: ' + e.url);
> > > }
> > >
> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
> > > wrote:
> > >
> > > >
> > > >
> > >
> >
>
https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> > >
> >
>

Re: InAppBrowser - events

Posted by Tommy-Carlos Williams <to...@devgeeks.org>.
Max said he only really watches the URL change, so this would be great to have in there.




On 28/11/2012, at 9:31 AM, Shazron <sh...@gmail.com> wrote:

> Simon, Let's get this in for 2.3.0?
> 
> 
> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <simon.macdonald@gmail.com
>> wrote:
> 
>> Is this required for the 2.3.0 release?
>> 
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>> 
>> 
>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>> 
>>> Great! Let's stick with one API, since we have Chrome members on the
>>> Cordova team the choice is obvious :)
>>> 
>>> 
>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>>> wrote:
>>> 
>>>> Looks that way. Given how similar they are, I don't think it matters
>>> which
>>>> one we go with (or if we come up with our own event names), but it'd be
>>>> good to follow the same pattern of having events and an API like
>>>> canGoBack(), goForward(), etc. If they ever move to standardize, then
>> we
>>>> can follow suit.
>>>> 
>>>> 
>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>>>> 
>>>>> Mozilla's 'locationchange' is similar to what we have for
>> ChildBrowser,
>>>> but
>>>>> I don't see the equivalent in the Chrome example - I suppose it is
>>>>> 'loadstop'?
>>>>> 
>>>>> I suppose if we were to adopt either, it would go something like
>> this:
>>>>> 
>>>>> var iab = window.open('http://apache.org', '_blank');
>>>>> // Firefox
>>>>> iab.addEventListener('locationchange', handleLocationChange);
>>>>> // Chrome
>>>>> iab.addEventListener('loadstop', handleLoadStop);
>>>>> 
>>>>> // Firefox
>>>>> function handleLocationChange(e) {
>>>>>     console.log('location changed to: ' + e.detail);
>>>>> }
>>>>> // Chrome
>>>>> function handleLoadStop(e) {
>>>>>     console.log('location changed to: ' + e.url);
>>>>> }
>>>>> 
>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <agrieve@chromium.org
>>> 
>>>>> wrote:
>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>>>>> 
>>>> 
>>> 
>> 


Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
IIRC that was a hold over from when I converted the ChildBrowser
(Plugin) to InAppBrowser (CordovaPlugin). The browserCallbackId was
the string that held what ID to call on the JS side and it has been
superseded by callbackContext so it looks like it is safe to delete.

Thanks for doing the events Shaz!
Simon Mac Donald
http://hi.im/simonmacdonald


On Fri, Nov 30, 2012 at 8:56 AM, Shazron <sh...@gmail.com> wrote:
> Tested and checked in changes for InAppBrowser events for Android.
> Simon -- I didn't know how the variable browserCallbackId fit in, so I
> commented it out for now :P
>
>
> On Wed, Nov 28, 2012 at 5:48 PM, Shazron <sh...@gmail.com> wrote:
>
>> Checked in changes for InAppBrowser events for iOS.
>>
>> Example usage:
>>
>> var ref = window.open('http://google.com', '_blank');
>> ref.addEventListener('loadstart', function(event) { alert(event.type + ' -
>> ' + event.url); } );
>> ref.addEventListener('loadstop', function(event) { alert(event.type + ' -
>> ' + event.url); } );
>> ref.addEventListener('exit', function(event) { alert(event.type); } );
>>
>> // also, you can do webviewRef.removeEventListener('loadstart', myfunc) ..
>> etc
>>
>>  I'll work on Android tomorrow.
>>
>>
>> On Wed, Nov 28, 2012 at 1:34 PM, Simon MacDonald <
>> simon.macdonald@gmail.com> wrote:
>>
>>> Wut!
>>>
>>> Go for it. The Java code may need to be modified but I've clearly
>>> marked it in the InAppBrowser.java class with TODO's.
>>> Simon Mac Donald
>>> http://hi.im/simonmacdonald
>>>
>>>
>>> On Wed, Nov 28, 2012 at 4:29 PM, Shazron <sh...@gmail.com> wrote:
>>> > No worries Simon - I'll add the support to the InAppBrowser window
>>> object.
>>> > Maybe I will even make some Android commits ;)
>>> >
>>> >
>>> > On Wed, Nov 28, 2012 at 12:46 PM, Simon MacDonald <
>>> simon.macdonald@gmail.com
>>> >> wrote:
>>> >
>>> >> I didn't get a ton of time to work on it but I posted a commit that
>>> calls
>>> >> the
>>> >>
>>> >> loadstart
>>> >> loadstop
>>> >> exit
>>> >>
>>> >> events on the window object. The main window object not the
>>> >> InAppBrowser window object. I know that will need to be fixed but it
>>> >> gave me the ability to do some testing.
>>> >>
>>> >> Plug away at the JS changes as I will be in Toronto Thursday and
>>> >> Friday on vacation. So I'll pick them up when I get back.
>>> >> Simon Mac Donald
>>> >> http://hi.im/simonmacdonald
>>> >>
>>> >>
>>> >> On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com>
>>> >> wrote:
>>> >> > I reckon we'll be doing the same bits for the js so ping me privately
>>> >> > or post here to discuss approach.
>>> >> >
>>> >> > On 2012-11-27, at 9:08 PM, Simon MacDonald <
>>> simon.macdonald@gmail.com>
>>> >> wrote:
>>> >> >
>>> >> >> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
>>> >> >> and Friday but this looks doable before 2.3.0 is out.
>>> >> >> Simon Mac Donald
>>> >> >> http://hi.im/simonmacdonald
>>> >> >>
>>> >> >>
>>> >> >> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
>>> >> >>> Simon, Let's get this in for 2.3.0?
>>> >> >>>
>>> >> >>>
>>> >> >>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <
>>> >> simon.macdonald@gmail.com
>>> >> >>>> wrote:
>>> >> >>>
>>> >> >>>> Is this required for the 2.3.0 release?
>>> >> >>>>
>>> >> >>>> Simon Mac Donald
>>> >> >>>> http://hi.im/simonmacdonald
>>> >> >>>>
>>> >> >>>>
>>> >> >>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com>
>>> wrote:
>>> >> >>>>
>>> >> >>>>> Great! Let's stick with one API, since we have Chrome members on
>>> the
>>> >> >>>>> Cordova team the choice is obvious :)
>>> >> >>>>>
>>> >> >>>>>
>>> >> >>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <
>>> agrieve@chromium.org
>>> >> >
>>> >> >>>>> wrote:
>>> >> >>>>>
>>> >> >>>>>> Looks that way. Given how similar they are, I don't think it
>>> matters
>>> >> >>>>> which
>>> >> >>>>>> one we go with (or if we come up with our own event names), but
>>> >> it'd be
>>> >> >>>>>> good to follow the same pattern of having events and an API like
>>> >> >>>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
>>> >> then
>>> >> >>>> we
>>> >> >>>>>> can follow suit.
>>> >> >>>>>>
>>> >> >>>>>>
>>> >> >>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com>
>>> wrote:
>>> >> >>>>>>
>>> >> >>>>>>> Mozilla's 'locationchange' is similar to what we have for
>>> >> >>>> ChildBrowser,
>>> >> >>>>>> but
>>> >> >>>>>>> I don't see the equivalent in the Chrome example - I suppose
>>> it is
>>> >> >>>>>>> 'loadstop'?
>>> >> >>>>>>>
>>> >> >>>>>>> I suppose if we were to adopt either, it would go something
>>> like
>>> >> >>>> this:
>>> >> >>>>>>>
>>> >> >>>>>>> var iab = window.open('http://apache.org', '_blank');
>>> >> >>>>>>> // Firefox
>>> >> >>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>>> >> >>>>>>> // Chrome
>>> >> >>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>>> >> >>>>>>>
>>> >> >>>>>>> // Firefox
>>> >> >>>>>>> function handleLocationChange(e) {
>>> >> >>>>>>>     console.log('location changed to: ' + e.detail);
>>> >> >>>>>>> }
>>> >> >>>>>>> // Chrome
>>> >> >>>>>>> function handleLoadStop(e) {
>>> >> >>>>>>>     console.log('location changed to: ' + e.url);
>>> >> >>>>>>> }
>>> >> >>>>>>>
>>> >> >>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
>>> >> agrieve@chromium.org
>>> >> >>>>>
>>> >> >>>>>>> wrote:
>>> >> >>>>>>>
>>> >> >>>>>>>>
>>> >> >>>>>>>>
>>> >> >>>>>>>
>>> >> >>>>>>
>>> >> >>>>>
>>> >> >>>>
>>> >>
>>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>>> >> >>>>>>>
>>> >> >>>>>>
>>> >> >>>>>
>>> >> >>>>
>>> >>
>>>
>>
>>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Tested and checked in changes for InAppBrowser events for Android.
Simon -- I didn't know how the variable browserCallbackId fit in, so I
commented it out for now :P


On Wed, Nov 28, 2012 at 5:48 PM, Shazron <sh...@gmail.com> wrote:

> Checked in changes for InAppBrowser events for iOS.
>
> Example usage:
>
> var ref = window.open('http://google.com', '_blank');
> ref.addEventListener('loadstart', function(event) { alert(event.type + ' -
> ' + event.url); } );
> ref.addEventListener('loadstop', function(event) { alert(event.type + ' -
> ' + event.url); } );
> ref.addEventListener('exit', function(event) { alert(event.type); } );
>
> // also, you can do webviewRef.removeEventListener('loadstart', myfunc) ..
> etc
>
>  I'll work on Android tomorrow.
>
>
> On Wed, Nov 28, 2012 at 1:34 PM, Simon MacDonald <
> simon.macdonald@gmail.com> wrote:
>
>> Wut!
>>
>> Go for it. The Java code may need to be modified but I've clearly
>> marked it in the InAppBrowser.java class with TODO's.
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>>
>>
>> On Wed, Nov 28, 2012 at 4:29 PM, Shazron <sh...@gmail.com> wrote:
>> > No worries Simon - I'll add the support to the InAppBrowser window
>> object.
>> > Maybe I will even make some Android commits ;)
>> >
>> >
>> > On Wed, Nov 28, 2012 at 12:46 PM, Simon MacDonald <
>> simon.macdonald@gmail.com
>> >> wrote:
>> >
>> >> I didn't get a ton of time to work on it but I posted a commit that
>> calls
>> >> the
>> >>
>> >> loadstart
>> >> loadstop
>> >> exit
>> >>
>> >> events on the window object. The main window object not the
>> >> InAppBrowser window object. I know that will need to be fixed but it
>> >> gave me the ability to do some testing.
>> >>
>> >> Plug away at the JS changes as I will be in Toronto Thursday and
>> >> Friday on vacation. So I'll pick them up when I get back.
>> >> Simon Mac Donald
>> >> http://hi.im/simonmacdonald
>> >>
>> >>
>> >> On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com>
>> >> wrote:
>> >> > I reckon we'll be doing the same bits for the js so ping me privately
>> >> > or post here to discuss approach.
>> >> >
>> >> > On 2012-11-27, at 9:08 PM, Simon MacDonald <
>> simon.macdonald@gmail.com>
>> >> wrote:
>> >> >
>> >> >> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
>> >> >> and Friday but this looks doable before 2.3.0 is out.
>> >> >> Simon Mac Donald
>> >> >> http://hi.im/simonmacdonald
>> >> >>
>> >> >>
>> >> >> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
>> >> >>> Simon, Let's get this in for 2.3.0?
>> >> >>>
>> >> >>>
>> >> >>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <
>> >> simon.macdonald@gmail.com
>> >> >>>> wrote:
>> >> >>>
>> >> >>>> Is this required for the 2.3.0 release?
>> >> >>>>
>> >> >>>> Simon Mac Donald
>> >> >>>> http://hi.im/simonmacdonald
>> >> >>>>
>> >> >>>>
>> >> >>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com>
>> wrote:
>> >> >>>>
>> >> >>>>> Great! Let's stick with one API, since we have Chrome members on
>> the
>> >> >>>>> Cordova team the choice is obvious :)
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <
>> agrieve@chromium.org
>> >> >
>> >> >>>>> wrote:
>> >> >>>>>
>> >> >>>>>> Looks that way. Given how similar they are, I don't think it
>> matters
>> >> >>>>> which
>> >> >>>>>> one we go with (or if we come up with our own event names), but
>> >> it'd be
>> >> >>>>>> good to follow the same pattern of having events and an API like
>> >> >>>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
>> >> then
>> >> >>>> we
>> >> >>>>>> can follow suit.
>> >> >>>>>>
>> >> >>>>>>
>> >> >>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com>
>> wrote:
>> >> >>>>>>
>> >> >>>>>>> Mozilla's 'locationchange' is similar to what we have for
>> >> >>>> ChildBrowser,
>> >> >>>>>> but
>> >> >>>>>>> I don't see the equivalent in the Chrome example - I suppose
>> it is
>> >> >>>>>>> 'loadstop'?
>> >> >>>>>>>
>> >> >>>>>>> I suppose if we were to adopt either, it would go something
>> like
>> >> >>>> this:
>> >> >>>>>>>
>> >> >>>>>>> var iab = window.open('http://apache.org', '_blank');
>> >> >>>>>>> // Firefox
>> >> >>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>> >> >>>>>>> // Chrome
>> >> >>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>> >> >>>>>>>
>> >> >>>>>>> // Firefox
>> >> >>>>>>> function handleLocationChange(e) {
>> >> >>>>>>>     console.log('location changed to: ' + e.detail);
>> >> >>>>>>> }
>> >> >>>>>>> // Chrome
>> >> >>>>>>> function handleLoadStop(e) {
>> >> >>>>>>>     console.log('location changed to: ' + e.url);
>> >> >>>>>>> }
>> >> >>>>>>>
>> >> >>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
>> >> agrieve@chromium.org
>> >> >>>>>
>> >> >>>>>>> wrote:
>> >> >>>>>>>
>> >> >>>>>>>>
>> >> >>>>>>>>
>> >> >>>>>>>
>> >> >>>>>>
>> >> >>>>>
>> >> >>>>
>> >>
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>> >> >>>>>>>
>> >> >>>>>>
>> >> >>>>>
>> >> >>>>
>> >>
>>
>
>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Checked in changes for InAppBrowser events for iOS.

Example usage:

var ref = window.open('http://google.com', '_blank');
ref.addEventListener('loadstart', function(event) { alert(event.type + ' -
' + event.url); } );
ref.addEventListener('loadstop', function(event) { alert(event.type + ' - '
+ event.url); } );
ref.addEventListener('exit', function(event) { alert(event.type); } );

// also, you can do webviewRef.removeEventListener('loadstart', myfunc) ..
etc

I'll work on Android tomorrow.


On Wed, Nov 28, 2012 at 1:34 PM, Simon MacDonald
<si...@gmail.com>wrote:

> Wut!
>
> Go for it. The Java code may need to be modified but I've clearly
> marked it in the InAppBrowser.java class with TODO's.
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Wed, Nov 28, 2012 at 4:29 PM, Shazron <sh...@gmail.com> wrote:
> > No worries Simon - I'll add the support to the InAppBrowser window
> object.
> > Maybe I will even make some Android commits ;)
> >
> >
> > On Wed, Nov 28, 2012 at 12:46 PM, Simon MacDonald <
> simon.macdonald@gmail.com
> >> wrote:
> >
> >> I didn't get a ton of time to work on it but I posted a commit that
> calls
> >> the
> >>
> >> loadstart
> >> loadstop
> >> exit
> >>
> >> events on the window object. The main window object not the
> >> InAppBrowser window object. I know that will need to be fixed but it
> >> gave me the ability to do some testing.
> >>
> >> Plug away at the JS changes as I will be in Toronto Thursday and
> >> Friday on vacation. So I'll pick them up when I get back.
> >> Simon Mac Donald
> >> http://hi.im/simonmacdonald
> >>
> >>
> >> On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com>
> >> wrote:
> >> > I reckon we'll be doing the same bits for the js so ping me privately
> >> > or post here to discuss approach.
> >> >
> >> > On 2012-11-27, at 9:08 PM, Simon MacDonald <simon.macdonald@gmail.com
> >
> >> wrote:
> >> >
> >> >> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
> >> >> and Friday but this looks doable before 2.3.0 is out.
> >> >> Simon Mac Donald
> >> >> http://hi.im/simonmacdonald
> >> >>
> >> >>
> >> >> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
> >> >>> Simon, Let's get this in for 2.3.0?
> >> >>>
> >> >>>
> >> >>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <
> >> simon.macdonald@gmail.com
> >> >>>> wrote:
> >> >>>
> >> >>>> Is this required for the 2.3.0 release?
> >> >>>>
> >> >>>> Simon Mac Donald
> >> >>>> http://hi.im/simonmacdonald
> >> >>>>
> >> >>>>
> >> >>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com>
> wrote:
> >> >>>>
> >> >>>>> Great! Let's stick with one API, since we have Chrome members on
> the
> >> >>>>> Cordova team the choice is obvious :)
> >> >>>>>
> >> >>>>>
> >> >>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <
> agrieve@chromium.org
> >> >
> >> >>>>> wrote:
> >> >>>>>
> >> >>>>>> Looks that way. Given how similar they are, I don't think it
> matters
> >> >>>>> which
> >> >>>>>> one we go with (or if we come up with our own event names), but
> >> it'd be
> >> >>>>>> good to follow the same pattern of having events and an API like
> >> >>>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
> >> then
> >> >>>> we
> >> >>>>>> can follow suit.
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com>
> wrote:
> >> >>>>>>
> >> >>>>>>> Mozilla's 'locationchange' is similar to what we have for
> >> >>>> ChildBrowser,
> >> >>>>>> but
> >> >>>>>>> I don't see the equivalent in the Chrome example - I suppose it
> is
> >> >>>>>>> 'loadstop'?
> >> >>>>>>>
> >> >>>>>>> I suppose if we were to adopt either, it would go something like
> >> >>>> this:
> >> >>>>>>>
> >> >>>>>>> var iab = window.open('http://apache.org', '_blank');
> >> >>>>>>> // Firefox
> >> >>>>>>> iab.addEventListener('locationchange', handleLocationChange);
> >> >>>>>>> // Chrome
> >> >>>>>>> iab.addEventListener('loadstop', handleLoadStop);
> >> >>>>>>>
> >> >>>>>>> // Firefox
> >> >>>>>>> function handleLocationChange(e) {
> >> >>>>>>>     console.log('location changed to: ' + e.detail);
> >> >>>>>>> }
> >> >>>>>>> // Chrome
> >> >>>>>>> function handleLoadStop(e) {
> >> >>>>>>>     console.log('location changed to: ' + e.url);
> >> >>>>>>> }
> >> >>>>>>>
> >> >>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> >> agrieve@chromium.org
> >> >>>>>
> >> >>>>>>> wrote:
> >> >>>>>>>
> >> >>>>>>>>
> >> >>>>>>>>
> >> >>>>>>>
> >> >>>>>>
> >> >>>>>
> >> >>>>
> >>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >> >>>>>>>
> >> >>>>>>
> >> >>>>>
> >> >>>>
> >>
>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
Wut!

Go for it. The Java code may need to be modified but I've clearly
marked it in the InAppBrowser.java class with TODO's.
Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Nov 28, 2012 at 4:29 PM, Shazron <sh...@gmail.com> wrote:
> No worries Simon - I'll add the support to the InAppBrowser window object.
> Maybe I will even make some Android commits ;)
>
>
> On Wed, Nov 28, 2012 at 12:46 PM, Simon MacDonald <simon.macdonald@gmail.com
>> wrote:
>
>> I didn't get a ton of time to work on it but I posted a commit that calls
>> the
>>
>> loadstart
>> loadstop
>> exit
>>
>> events on the window object. The main window object not the
>> InAppBrowser window object. I know that will need to be fixed but it
>> gave me the ability to do some testing.
>>
>> Plug away at the JS changes as I will be in Toronto Thursday and
>> Friday on vacation. So I'll pick them up when I get back.
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>>
>>
>> On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com>
>> wrote:
>> > I reckon we'll be doing the same bits for the js so ping me privately
>> > or post here to discuss approach.
>> >
>> > On 2012-11-27, at 9:08 PM, Simon MacDonald <si...@gmail.com>
>> wrote:
>> >
>> >> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
>> >> and Friday but this looks doable before 2.3.0 is out.
>> >> Simon Mac Donald
>> >> http://hi.im/simonmacdonald
>> >>
>> >>
>> >> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
>> >>> Simon, Let's get this in for 2.3.0?
>> >>>
>> >>>
>> >>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <
>> simon.macdonald@gmail.com
>> >>>> wrote:
>> >>>
>> >>>> Is this required for the 2.3.0 release?
>> >>>>
>> >>>> Simon Mac Donald
>> >>>> http://hi.im/simonmacdonald
>> >>>>
>> >>>>
>> >>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>> >>>>
>> >>>>> Great! Let's stick with one API, since we have Chrome members on the
>> >>>>> Cordova team the choice is obvious :)
>> >>>>>
>> >>>>>
>> >>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <agrieve@chromium.org
>> >
>> >>>>> wrote:
>> >>>>>
>> >>>>>> Looks that way. Given how similar they are, I don't think it matters
>> >>>>> which
>> >>>>>> one we go with (or if we come up with our own event names), but
>> it'd be
>> >>>>>> good to follow the same pattern of having events and an API like
>> >>>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
>> then
>> >>>> we
>> >>>>>> can follow suit.
>> >>>>>>
>> >>>>>>
>> >>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>> >>>>>>
>> >>>>>>> Mozilla's 'locationchange' is similar to what we have for
>> >>>> ChildBrowser,
>> >>>>>> but
>> >>>>>>> I don't see the equivalent in the Chrome example - I suppose it is
>> >>>>>>> 'loadstop'?
>> >>>>>>>
>> >>>>>>> I suppose if we were to adopt either, it would go something like
>> >>>> this:
>> >>>>>>>
>> >>>>>>> var iab = window.open('http://apache.org', '_blank');
>> >>>>>>> // Firefox
>> >>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>> >>>>>>> // Chrome
>> >>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>> >>>>>>>
>> >>>>>>> // Firefox
>> >>>>>>> function handleLocationChange(e) {
>> >>>>>>>     console.log('location changed to: ' + e.detail);
>> >>>>>>> }
>> >>>>>>> // Chrome
>> >>>>>>> function handleLoadStop(e) {
>> >>>>>>>     console.log('location changed to: ' + e.url);
>> >>>>>>> }
>> >>>>>>>
>> >>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
>> agrieve@chromium.org
>> >>>>>
>> >>>>>>> wrote:
>> >>>>>>>
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>
>> >>>>>>
>> >>>>>
>> >>>>
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>> >>>>>>>
>> >>>>>>
>> >>>>>
>> >>>>
>>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
No worries Simon - I'll add the support to the InAppBrowser window object.
Maybe I will even make some Android commits ;)


On Wed, Nov 28, 2012 at 12:46 PM, Simon MacDonald <simon.macdonald@gmail.com
> wrote:

> I didn't get a ton of time to work on it but I posted a commit that calls
> the
>
> loadstart
> loadstop
> exit
>
> events on the window object. The main window object not the
> InAppBrowser window object. I know that will need to be fixed but it
> gave me the ability to do some testing.
>
> Plug away at the JS changes as I will be in Toronto Thursday and
> Friday on vacation. So I'll pick them up when I get back.
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com>
> wrote:
> > I reckon we'll be doing the same bits for the js so ping me privately
> > or post here to discuss approach.
> >
> > On 2012-11-27, at 9:08 PM, Simon MacDonald <si...@gmail.com>
> wrote:
> >
> >> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
> >> and Friday but this looks doable before 2.3.0 is out.
> >> Simon Mac Donald
> >> http://hi.im/simonmacdonald
> >>
> >>
> >> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
> >>> Simon, Let's get this in for 2.3.0?
> >>>
> >>>
> >>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <
> simon.macdonald@gmail.com
> >>>> wrote:
> >>>
> >>>> Is this required for the 2.3.0 release?
> >>>>
> >>>> Simon Mac Donald
> >>>> http://hi.im/simonmacdonald
> >>>>
> >>>>
> >>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
> >>>>
> >>>>> Great! Let's stick with one API, since we have Chrome members on the
> >>>>> Cordova team the choice is obvious :)
> >>>>>
> >>>>>
> >>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <agrieve@chromium.org
> >
> >>>>> wrote:
> >>>>>
> >>>>>> Looks that way. Given how similar they are, I don't think it matters
> >>>>> which
> >>>>>> one we go with (or if we come up with our own event names), but
> it'd be
> >>>>>> good to follow the same pattern of having events and an API like
> >>>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
> then
> >>>> we
> >>>>>> can follow suit.
> >>>>>>
> >>>>>>
> >>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>>
> >>>>>>> Mozilla's 'locationchange' is similar to what we have for
> >>>> ChildBrowser,
> >>>>>> but
> >>>>>>> I don't see the equivalent in the Chrome example - I suppose it is
> >>>>>>> 'loadstop'?
> >>>>>>>
> >>>>>>> I suppose if we were to adopt either, it would go something like
> >>>> this:
> >>>>>>>
> >>>>>>> var iab = window.open('http://apache.org', '_blank');
> >>>>>>> // Firefox
> >>>>>>> iab.addEventListener('locationchange', handleLocationChange);
> >>>>>>> // Chrome
> >>>>>>> iab.addEventListener('loadstop', handleLoadStop);
> >>>>>>>
> >>>>>>> // Firefox
> >>>>>>> function handleLocationChange(e) {
> >>>>>>>     console.log('location changed to: ' + e.detail);
> >>>>>>> }
> >>>>>>> // Chrome
> >>>>>>> function handleLoadStop(e) {
> >>>>>>>     console.log('location changed to: ' + e.url);
> >>>>>>> }
> >>>>>>>
> >>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> agrieve@chromium.org
> >>>>>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
I didn't get a ton of time to work on it but I posted a commit that calls the

loadstart
loadstop
exit

events on the window object. The main window object not the
InAppBrowser window object. I know that will need to be fixed but it
gave me the ability to do some testing.

Plug away at the JS changes as I will be in Toronto Thursday and
Friday on vacation. So I'll pick them up when I get back.
Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Nov 28, 2012 at 2:56 AM, Shazron Abdullah <sh...@gmail.com> wrote:
> I reckon we'll be doing the same bits for the js so ping me privately
> or post here to discuss approach.
>
> On 2012-11-27, at 9:08 PM, Simon MacDonald <si...@gmail.com> wrote:
>
>> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
>> and Friday but this looks doable before 2.3.0 is out.
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>>
>>
>> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
>>> Simon, Let's get this in for 2.3.0?
>>>
>>>
>>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <simon.macdonald@gmail.com
>>>> wrote:
>>>
>>>> Is this required for the 2.3.0 release?
>>>>
>>>> Simon Mac Donald
>>>> http://hi.im/simonmacdonald
>>>>
>>>>
>>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>>>>
>>>>> Great! Let's stick with one API, since we have Chrome members on the
>>>>> Cordova team the choice is obvious :)
>>>>>
>>>>>
>>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>>>>> wrote:
>>>>>
>>>>>> Looks that way. Given how similar they are, I don't think it matters
>>>>> which
>>>>>> one we go with (or if we come up with our own event names), but it'd be
>>>>>> good to follow the same pattern of having events and an API like
>>>>>> canGoBack(), goForward(), etc. If they ever move to standardize, then
>>>> we
>>>>>> can follow suit.
>>>>>>
>>>>>>
>>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>>>>>>
>>>>>>> Mozilla's 'locationchange' is similar to what we have for
>>>> ChildBrowser,
>>>>>> but
>>>>>>> I don't see the equivalent in the Chrome example - I suppose it is
>>>>>>> 'loadstop'?
>>>>>>>
>>>>>>> I suppose if we were to adopt either, it would go something like
>>>> this:
>>>>>>>
>>>>>>> var iab = window.open('http://apache.org', '_blank');
>>>>>>> // Firefox
>>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>>>>>>> // Chrome
>>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>>>>>>>
>>>>>>> // Firefox
>>>>>>> function handleLocationChange(e) {
>>>>>>>     console.log('location changed to: ' + e.detail);
>>>>>>> }
>>>>>>> // Chrome
>>>>>>> function handleLoadStop(e) {
>>>>>>>     console.log('location changed to: ' + e.url);
>>>>>>> }
>>>>>>>
>>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <agrieve@chromium.org
>>>>>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>>>>>>>
>>>>>>
>>>>>
>>>>

Re: InAppBrowser - events

Posted by Shazron Abdullah <sh...@gmail.com>.
I reckon we'll be doing the same bits for the js so ping me privately
or post here to discuss approach.

On 2012-11-27, at 9:08 PM, Simon MacDonald <si...@gmail.com> wrote:

> Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
> and Friday but this looks doable before 2.3.0 is out.
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
>> Simon, Let's get this in for 2.3.0?
>>
>>
>> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <simon.macdonald@gmail.com
>>> wrote:
>>
>>> Is this required for the 2.3.0 release?
>>>
>>> Simon Mac Donald
>>> http://hi.im/simonmacdonald
>>>
>>>
>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>>>
>>>> Great! Let's stick with one API, since we have Chrome members on the
>>>> Cordova team the choice is obvious :)
>>>>
>>>>
>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>>>> wrote:
>>>>
>>>>> Looks that way. Given how similar they are, I don't think it matters
>>>> which
>>>>> one we go with (or if we come up with our own event names), but it'd be
>>>>> good to follow the same pattern of having events and an API like
>>>>> canGoBack(), goForward(), etc. If they ever move to standardize, then
>>> we
>>>>> can follow suit.
>>>>>
>>>>>
>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>>>>>
>>>>>> Mozilla's 'locationchange' is similar to what we have for
>>> ChildBrowser,
>>>>> but
>>>>>> I don't see the equivalent in the Chrome example - I suppose it is
>>>>>> 'loadstop'?
>>>>>>
>>>>>> I suppose if we were to adopt either, it would go something like
>>> this:
>>>>>>
>>>>>> var iab = window.open('http://apache.org', '_blank');
>>>>>> // Firefox
>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>>>>>> // Chrome
>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>>>>>>
>>>>>> // Firefox
>>>>>> function handleLocationChange(e) {
>>>>>>     console.log('location changed to: ' + e.detail);
>>>>>> }
>>>>>> // Chrome
>>>>>> function handleLoadStop(e) {
>>>>>>     console.log('location changed to: ' + e.url);
>>>>>> }
>>>>>>
>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <agrieve@chromium.org
>>>>
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>>>>>>
>>>>>
>>>>
>>>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
Yeah, I will start on it tomorrow morning. I'm on vacation Thursday
and Friday but this looks doable before 2.3.0 is out.
Simon Mac Donald
http://hi.im/simonmacdonald


On Tue, Nov 27, 2012 at 5:31 PM, Shazron <sh...@gmail.com> wrote:
> Simon, Let's get this in for 2.3.0?
>
>
> On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <simon.macdonald@gmail.com
>> wrote:
>
>> Is this required for the 2.3.0 release?
>>
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>>
>>
>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>>
>> > Great! Let's stick with one API, since we have Chrome members on the
>> > Cordova team the choice is obvious :)
>> >
>> >
>> > On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>> > wrote:
>> >
>> > > Looks that way. Given how similar they are, I don't think it matters
>> > which
>> > > one we go with (or if we come up with our own event names), but it'd be
>> > > good to follow the same pattern of having events and an API like
>> > > canGoBack(), goForward(), etc. If they ever move to standardize, then
>> we
>> > > can follow suit.
>> > >
>> > >
>> > > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>> > >
>> > > > Mozilla's 'locationchange' is similar to what we have for
>> ChildBrowser,
>> > > but
>> > > > I don't see the equivalent in the Chrome example - I suppose it is
>> > > > 'loadstop'?
>> > > >
>> > > > I suppose if we were to adopt either, it would go something like
>> this:
>> > > >
>> > > > var iab = window.open('http://apache.org', '_blank');
>> > > > // Firefox
>> > > > iab.addEventListener('locationchange', handleLocationChange);
>> > > > // Chrome
>> > > > iab.addEventListener('loadstop', handleLoadStop);
>> > > >
>> > > > // Firefox
>> > > > function handleLocationChange(e) {
>> > > >      console.log('location changed to: ' + e.detail);
>> > > > }
>> > > > // Chrome
>> > > > function handleLoadStop(e) {
>> > > >      console.log('location changed to: ' + e.url);
>> > > > }
>> > > >
>> > > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <agrieve@chromium.org
>> >
>> > > > wrote:
>> > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>> > > >
>> > >
>> >
>>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Simon, Let's get this in for 2.3.0?


On Thu, Nov 22, 2012 at 10:53 AM, Simon MacDonald <simon.macdonald@gmail.com
> wrote:

> Is this required for the 2.3.0 release?
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>
> > Great! Let's stick with one API, since we have Chrome members on the
> > Cordova team the choice is obvious :)
> >
> >
> > On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> >
> > > Looks that way. Given how similar they are, I don't think it matters
> > which
> > > one we go with (or if we come up with our own event names), but it'd be
> > > good to follow the same pattern of having events and an API like
> > > canGoBack(), goForward(), etc. If they ever move to standardize, then
> we
> > > can follow suit.
> > >
> > >
> > > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> > >
> > > > Mozilla's 'locationchange' is similar to what we have for
> ChildBrowser,
> > > but
> > > > I don't see the equivalent in the Chrome example - I suppose it is
> > > > 'loadstop'?
> > > >
> > > > I suppose if we were to adopt either, it would go something like
> this:
> > > >
> > > > var iab = window.open('http://apache.org', '_blank');
> > > > // Firefox
> > > > iab.addEventListener('locationchange', handleLocationChange);
> > > > // Chrome
> > > > iab.addEventListener('loadstop', handleLoadStop);
> > > >
> > > > // Firefox
> > > > function handleLocationChange(e) {
> > > >      console.log('location changed to: ' + e.detail);
> > > > }
> > > > // Chrome
> > > > function handleLoadStop(e) {
> > > >      console.log('location changed to: ' + e.url);
> > > > }
> > > >
> > > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <agrieve@chromium.org
> >
> > > > wrote:
> > > >
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> > > >
> > >
> >
>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
The Cat-Signal that the Internet Defence League would be purr-fect.

http://internetdefenseleague.org/

Simon Mac Donald
http://hi.im/simonmacdonald


On Fri, Nov 23, 2012 at 7:53 AM, Brian LeRoux <b...@brian.io> wrote:

> We need a MAX-signal. It'd be like the bat signal but with cats.
>
>
> On Fri, Nov 23, 2012 at 12:43 AM, Tommy-Carlos Williams
> <to...@devgeeks.org>wrote:
>
> > At some point Gather used ChildBrowser for Oauth, but I think they might
> > not be anymore. Max left the list shortly after joining, so I could try
> and
> > ping him on IRC if it would help?
> >
> >
> > On 23/11/2012, at 10:40 AM, Andrew Grieve <ag...@chromium.org> wrote:
> >
> > > The more events the better! :) Really though, it would be good if
> someone
> > > knew of an app that used ChildBrowser for the purposes of OAuth. That
> > seems
> > > like one of the most important use-cases, so we should make sure to
> have
> > > all of the events that it requires.
> > >
> > >
> > > On Thu, Nov 22, 2012 at 4:26 PM, Simon MacDonald
> > > <si...@gmail.com>wrote:
> > >
> > >> Just looking at this again and...
> > >>
> > >>  webview.addEventListener('exit', handleExit);
> > >>  webview.addEventListener('loadstart', handleLoadStart);
> > >>
> > >> would seem to map to our:
> > >>
> > >> onClose
> > >> onLocationChanged
> > >>
> > >> methods from the ChildBrowser. At least on Android I fire location
> > changed
> > >> event when the page starts to load not when it is finished.
> > >>
> > >> Simon Mac Donald
> > >> http://hi.im/simonmacdonald
> > >>
> > >>
> > >> On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
> > >> <si...@gmail.com>wrote:
> > >>
> > >>> Is this required for the 2.3.0 release?
> > >>>
> > >>> Simon Mac Donald
> > >>> http://hi.im/simonmacdonald
> > >>>
> > >>>
> > >>>
> > >>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
> > >>>
> > >>>> Great! Let's stick with one API, since we have Chrome members on the
> > >>>> Cordova team the choice is obvious :)
> > >>>>
> > >>>>
> > >>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <
> agrieve@chromium.org>
> > >>>> wrote:
> > >>>>
> > >>>>> Looks that way. Given how similar they are, I don't think it
> matters
> > >>>> which
> > >>>>> one we go with (or if we come up with our own event names), but
> it'd
> > >> be
> > >>>>> good to follow the same pattern of having events and an API like
> > >>>>> canGoBack(), goForward(), etc. If they ever move to standardize,
> then
> > >> we
> > >>>>> can follow suit.
> > >>>>>
> > >>>>>
> > >>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com>
> wrote:
> > >>>>>
> > >>>>>> Mozilla's 'locationchange' is similar to what we have for
> > >>>> ChildBrowser,
> > >>>>> but
> > >>>>>> I don't see the equivalent in the Chrome example - I suppose it is
> > >>>>>> 'loadstop'?
> > >>>>>>
> > >>>>>> I suppose if we were to adopt either, it would go something like
> > >> this:
> > >>>>>>
> > >>>>>> var iab = window.open('http://apache.org', '_blank');
> > >>>>>> // Firefox
> > >>>>>> iab.addEventListener('locationchange', handleLocationChange);
> > >>>>>> // Chrome
> > >>>>>> iab.addEventListener('loadstop', handleLoadStop);
> > >>>>>>
> > >>>>>> // Firefox
> > >>>>>> function handleLocationChange(e) {
> > >>>>>>     console.log('location changed to: ' + e.detail);
> > >>>>>> }
> > >>>>>> // Chrome
> > >>>>>> function handleLoadStop(e) {
> > >>>>>>     console.log('location changed to: ' + e.url);
> > >>>>>> }
> > >>>>>>
> > >>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> > >> agrieve@chromium.org>
> > >>>>>> wrote:
> > >>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>
> > >>>>
> > >>
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> > >>>>>>
> > >>>>>
> > >>>>
> > >>>
> > >>>
> > >>
> >
> >
>

Re: InAppBrowser - events

Posted by Brian LeRoux <b...@brian.io>.
We need a MAX-signal. It'd be like the bat signal but with cats.


On Fri, Nov 23, 2012 at 12:43 AM, Tommy-Carlos Williams
<to...@devgeeks.org>wrote:

> At some point Gather used ChildBrowser for Oauth, but I think they might
> not be anymore. Max left the list shortly after joining, so I could try and
> ping him on IRC if it would help?
>
>
> On 23/11/2012, at 10:40 AM, Andrew Grieve <ag...@chromium.org> wrote:
>
> > The more events the better! :) Really though, it would be good if someone
> > knew of an app that used ChildBrowser for the purposes of OAuth. That
> seems
> > like one of the most important use-cases, so we should make sure to have
> > all of the events that it requires.
> >
> >
> > On Thu, Nov 22, 2012 at 4:26 PM, Simon MacDonald
> > <si...@gmail.com>wrote:
> >
> >> Just looking at this again and...
> >>
> >>  webview.addEventListener('exit', handleExit);
> >>  webview.addEventListener('loadstart', handleLoadStart);
> >>
> >> would seem to map to our:
> >>
> >> onClose
> >> onLocationChanged
> >>
> >> methods from the ChildBrowser. At least on Android I fire location
> changed
> >> event when the page starts to load not when it is finished.
> >>
> >> Simon Mac Donald
> >> http://hi.im/simonmacdonald
> >>
> >>
> >> On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
> >> <si...@gmail.com>wrote:
> >>
> >>> Is this required for the 2.3.0 release?
> >>>
> >>> Simon Mac Donald
> >>> http://hi.im/simonmacdonald
> >>>
> >>>
> >>>
> >>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
> >>>
> >>>> Great! Let's stick with one API, since we have Chrome members on the
> >>>> Cordova team the choice is obvious :)
> >>>>
> >>>>
> >>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> >>>> wrote:
> >>>>
> >>>>> Looks that way. Given how similar they are, I don't think it matters
> >>>> which
> >>>>> one we go with (or if we come up with our own event names), but it'd
> >> be
> >>>>> good to follow the same pattern of having events and an API like
> >>>>> canGoBack(), goForward(), etc. If they ever move to standardize, then
> >> we
> >>>>> can follow suit.
> >>>>>
> >>>>>
> >>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >>>>>
> >>>>>> Mozilla's 'locationchange' is similar to what we have for
> >>>> ChildBrowser,
> >>>>> but
> >>>>>> I don't see the equivalent in the Chrome example - I suppose it is
> >>>>>> 'loadstop'?
> >>>>>>
> >>>>>> I suppose if we were to adopt either, it would go something like
> >> this:
> >>>>>>
> >>>>>> var iab = window.open('http://apache.org', '_blank');
> >>>>>> // Firefox
> >>>>>> iab.addEventListener('locationchange', handleLocationChange);
> >>>>>> // Chrome
> >>>>>> iab.addEventListener('loadstop', handleLoadStop);
> >>>>>>
> >>>>>> // Firefox
> >>>>>> function handleLocationChange(e) {
> >>>>>>     console.log('location changed to: ' + e.detail);
> >>>>>> }
> >>>>>> // Chrome
> >>>>>> function handleLoadStop(e) {
> >>>>>>     console.log('location changed to: ' + e.url);
> >>>>>> }
> >>>>>>
> >>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> >> agrieve@chromium.org>
> >>>>>> wrote:
> >>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>
>
>

Re: InAppBrowser - events

Posted by Tommy-Carlos Williams <to...@devgeeks.org>.
At some point Gather used ChildBrowser for Oauth, but I think they might not be anymore. Max left the list shortly after joining, so I could try and ping him on IRC if it would help?


On 23/11/2012, at 10:40 AM, Andrew Grieve <ag...@chromium.org> wrote:

> The more events the better! :) Really though, it would be good if someone
> knew of an app that used ChildBrowser for the purposes of OAuth. That seems
> like one of the most important use-cases, so we should make sure to have
> all of the events that it requires.
> 
> 
> On Thu, Nov 22, 2012 at 4:26 PM, Simon MacDonald
> <si...@gmail.com>wrote:
> 
>> Just looking at this again and...
>> 
>>  webview.addEventListener('exit', handleExit);
>>  webview.addEventListener('loadstart', handleLoadStart);
>> 
>> would seem to map to our:
>> 
>> onClose
>> onLocationChanged
>> 
>> methods from the ChildBrowser. At least on Android I fire location changed
>> event when the page starts to load not when it is finished.
>> 
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>> 
>> 
>> On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
>> <si...@gmail.com>wrote:
>> 
>>> Is this required for the 2.3.0 release?
>>> 
>>> Simon Mac Donald
>>> http://hi.im/simonmacdonald
>>> 
>>> 
>>> 
>>> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>>> 
>>>> Great! Let's stick with one API, since we have Chrome members on the
>>>> Cordova team the choice is obvious :)
>>>> 
>>>> 
>>>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>>>> wrote:
>>>> 
>>>>> Looks that way. Given how similar they are, I don't think it matters
>>>> which
>>>>> one we go with (or if we come up with our own event names), but it'd
>> be
>>>>> good to follow the same pattern of having events and an API like
>>>>> canGoBack(), goForward(), etc. If they ever move to standardize, then
>> we
>>>>> can follow suit.
>>>>> 
>>>>> 
>>>>> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>>>>> 
>>>>>> Mozilla's 'locationchange' is similar to what we have for
>>>> ChildBrowser,
>>>>> but
>>>>>> I don't see the equivalent in the Chrome example - I suppose it is
>>>>>> 'loadstop'?
>>>>>> 
>>>>>> I suppose if we were to adopt either, it would go something like
>> this:
>>>>>> 
>>>>>> var iab = window.open('http://apache.org', '_blank');
>>>>>> // Firefox
>>>>>> iab.addEventListener('locationchange', handleLocationChange);
>>>>>> // Chrome
>>>>>> iab.addEventListener('loadstop', handleLoadStop);
>>>>>> 
>>>>>> // Firefox
>>>>>> function handleLocationChange(e) {
>>>>>>     console.log('location changed to: ' + e.detail);
>>>>>> }
>>>>>> // Chrome
>>>>>> function handleLoadStop(e) {
>>>>>>     console.log('location changed to: ' + e.url);
>>>>>> }
>>>>>> 
>>>>>> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
>> agrieve@chromium.org>
>>>>>> wrote:
>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 


Re: InAppBrowser - events

Posted by Andrew Grieve <ag...@chromium.org>.
The more events the better! :) Really though, it would be good if someone
knew of an app that used ChildBrowser for the purposes of OAuth. That seems
like one of the most important use-cases, so we should make sure to have
all of the events that it requires.


On Thu, Nov 22, 2012 at 4:26 PM, Simon MacDonald
<si...@gmail.com>wrote:

> Just looking at this again and...
>
>   webview.addEventListener('exit', handleExit);
>   webview.addEventListener('loadstart', handleLoadStart);
>
> would seem to map to our:
>
> onClose
> onLocationChanged
>
> methods from the ChildBrowser. At least on Android I fire location changed
> event when the page starts to load not when it is finished.
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
> <si...@gmail.com>wrote:
>
> > Is this required for the 2.3.0 release?
> >
> > Simon Mac Donald
> > http://hi.im/simonmacdonald
> >
> >
> >
> > On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
> >
> >> Great! Let's stick with one API, since we have Chrome members on the
> >> Cordova team the choice is obvious :)
> >>
> >>
> >> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> >> wrote:
> >>
> >> > Looks that way. Given how similar they are, I don't think it matters
> >> which
> >> > one we go with (or if we come up with our own event names), but it'd
> be
> >> > good to follow the same pattern of having events and an API like
> >> > canGoBack(), goForward(), etc. If they ever move to standardize, then
> we
> >> > can follow suit.
> >> >
> >> >
> >> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >> >
> >> > > Mozilla's 'locationchange' is similar to what we have for
> >> ChildBrowser,
> >> > but
> >> > > I don't see the equivalent in the Chrome example - I suppose it is
> >> > > 'loadstop'?
> >> > >
> >> > > I suppose if we were to adopt either, it would go something like
> this:
> >> > >
> >> > > var iab = window.open('http://apache.org', '_blank');
> >> > > // Firefox
> >> > > iab.addEventListener('locationchange', handleLocationChange);
> >> > > // Chrome
> >> > > iab.addEventListener('loadstop', handleLoadStop);
> >> > >
> >> > > // Firefox
> >> > > function handleLocationChange(e) {
> >> > >      console.log('location changed to: ' + e.detail);
> >> > > }
> >> > > // Chrome
> >> > > function handleLoadStop(e) {
> >> > >      console.log('location changed to: ' + e.url);
> >> > > }
> >> > >
> >> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> agrieve@chromium.org>
> >> > > wrote:
> >> > >
> >> > > >
> >> > > >
> >> > >
> >> >
> >>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >> > >
> >> >
> >>
> >
> >
>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Those events sound good to me.
On Nov 22, 2012 1:27 PM, "Simon MacDonald" <si...@gmail.com>
wrote:

> Just looking at this again and...
>
>   webview.addEventListener('exit', handleExit);
>   webview.addEventListener('loadstart', handleLoadStart);
>
> would seem to map to our:
>
> onClose
> onLocationChanged
>
> methods from the ChildBrowser. At least on Android I fire location changed
> event when the page starts to load not when it is finished.
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
> <si...@gmail.com>wrote:
>
> > Is this required for the 2.3.0 release?
> >
> > Simon Mac Donald
> > http://hi.im/simonmacdonald
> >
> >
> >
> > On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
> >
> >> Great! Let's stick with one API, since we have Chrome members on the
> >> Cordova team the choice is obvious :)
> >>
> >>
> >> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> >> wrote:
> >>
> >> > Looks that way. Given how similar they are, I don't think it matters
> >> which
> >> > one we go with (or if we come up with our own event names), but it'd
> be
> >> > good to follow the same pattern of having events and an API like
> >> > canGoBack(), goForward(), etc. If they ever move to standardize, then
> we
> >> > can follow suit.
> >> >
> >> >
> >> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >> >
> >> > > Mozilla's 'locationchange' is similar to what we have for
> >> ChildBrowser,
> >> > but
> >> > > I don't see the equivalent in the Chrome example - I suppose it is
> >> > > 'loadstop'?
> >> > >
> >> > > I suppose if we were to adopt either, it would go something like
> this:
> >> > >
> >> > > var iab = window.open('http://apache.org', '_blank');
> >> > > // Firefox
> >> > > iab.addEventListener('locationchange', handleLocationChange);
> >> > > // Chrome
> >> > > iab.addEventListener('loadstop', handleLoadStop);
> >> > >
> >> > > // Firefox
> >> > > function handleLocationChange(e) {
> >> > >      console.log('location changed to: ' + e.detail);
> >> > > }
> >> > > // Chrome
> >> > > function handleLoadStop(e) {
> >> > >      console.log('location changed to: ' + e.url);
> >> > > }
> >> > >
> >> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <
> agrieve@chromium.org>
> >> > > wrote:
> >> > >
> >> > > >
> >> > > >
> >> > >
> >> >
> >>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >> > >
> >> >
> >>
> >
> >
>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
Just looking at this again and...

  webview.addEventListener('exit', handleExit);
  webview.addEventListener('loadstart', handleLoadStart);

would seem to map to our:

onClose
onLocationChanged

methods from the ChildBrowser. At least on Android I fire location changed
event when the page starts to load not when it is finished.

Simon Mac Donald
http://hi.im/simonmacdonald


On Thu, Nov 22, 2012 at 1:53 PM, Simon MacDonald
<si...@gmail.com>wrote:

> Is this required for the 2.3.0 release?
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
>
> On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:
>
>> Great! Let's stick with one API, since we have Chrome members on the
>> Cordova team the choice is obvious :)
>>
>>
>> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
>> wrote:
>>
>> > Looks that way. Given how similar they are, I don't think it matters
>> which
>> > one we go with (or if we come up with our own event names), but it'd be
>> > good to follow the same pattern of having events and an API like
>> > canGoBack(), goForward(), etc. If they ever move to standardize, then we
>> > can follow suit.
>> >
>> >
>> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>> >
>> > > Mozilla's 'locationchange' is similar to what we have for
>> ChildBrowser,
>> > but
>> > > I don't see the equivalent in the Chrome example - I suppose it is
>> > > 'loadstop'?
>> > >
>> > > I suppose if we were to adopt either, it would go something like this:
>> > >
>> > > var iab = window.open('http://apache.org', '_blank');
>> > > // Firefox
>> > > iab.addEventListener('locationchange', handleLocationChange);
>> > > // Chrome
>> > > iab.addEventListener('loadstop', handleLoadStop);
>> > >
>> > > // Firefox
>> > > function handleLocationChange(e) {
>> > >      console.log('location changed to: ' + e.detail);
>> > > }
>> > > // Chrome
>> > > function handleLoadStop(e) {
>> > >      console.log('location changed to: ' + e.url);
>> > > }
>> > >
>> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
>> > > wrote:
>> > >
>> > > >
>> > > >
>> > >
>> >
>> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>> > >
>> >
>>
>
>

Re: InAppBrowser - events

Posted by Simon MacDonald <si...@gmail.com>.
Is this required for the 2.3.0 release?

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Nov 21, 2012 at 11:30 PM, Shazron <sh...@gmail.com> wrote:

> Great! Let's stick with one API, since we have Chrome members on the
> Cordova team the choice is obvious :)
>
>
> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > Looks that way. Given how similar they are, I don't think it matters
> which
> > one we go with (or if we come up with our own event names), but it'd be
> > good to follow the same pattern of having events and an API like
> > canGoBack(), goForward(), etc. If they ever move to standardize, then we
> > can follow suit.
> >
> >
> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > Mozilla's 'locationchange' is similar to what we have for ChildBrowser,
> > but
> > > I don't see the equivalent in the Chrome example - I suppose it is
> > > 'loadstop'?
> > >
> > > I suppose if we were to adopt either, it would go something like this:
> > >
> > > var iab = window.open('http://apache.org', '_blank');
> > > // Firefox
> > > iab.addEventListener('locationchange', handleLocationChange);
> > > // Chrome
> > > iab.addEventListener('loadstop', handleLoadStop);
> > >
> > > // Firefox
> > > function handleLocationChange(e) {
> > >      console.log('location changed to: ' + e.detail);
> > > }
> > > // Chrome
> > > function handleLoadStop(e) {
> > >      console.log('location changed to: ' + e.url);
> > > }
> > >
> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
> > > wrote:
> > >
> > > >
> > > >
> > >
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> > >
> >
>

Re: InAppBrowser - events

Posted by Brian LeRoux <b...@brian.io>.
agree, all of this work when completed will be documented as to what is
non-standard which we can then take back to the w3c


On Thu, Nov 22, 2012 at 4:30 AM, Shazron <sh...@gmail.com> wrote:

> Great! Let's stick with one API, since we have Chrome members on the
> Cordova team the choice is obvious :)
>
>
> On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > Looks that way. Given how similar they are, I don't think it matters
> which
> > one we go with (or if we come up with our own event names), but it'd be
> > good to follow the same pattern of having events and an API like
> > canGoBack(), goForward(), etc. If they ever move to standardize, then we
> > can follow suit.
> >
> >
> > On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > Mozilla's 'locationchange' is similar to what we have for ChildBrowser,
> > but
> > > I don't see the equivalent in the Chrome example - I suppose it is
> > > 'loadstop'?
> > >
> > > I suppose if we were to adopt either, it would go something like this:
> > >
> > > var iab = window.open('http://apache.org', '_blank');
> > > // Firefox
> > > iab.addEventListener('locationchange', handleLocationChange);
> > > // Chrome
> > > iab.addEventListener('loadstop', handleLoadStop);
> > >
> > > // Firefox
> > > function handleLocationChange(e) {
> > >      console.log('location changed to: ' + e.detail);
> > > }
> > > // Chrome
> > > function handleLoadStop(e) {
> > >      console.log('location changed to: ' + e.url);
> > > }
> > >
> > > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
> > > wrote:
> > >
> > > >
> > > >
> > >
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> > >
> >
>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Great! Let's stick with one API, since we have Chrome members on the
Cordova team the choice is obvious :)


On Wed, Nov 21, 2012 at 8:06 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Looks that way. Given how similar they are, I don't think it matters which
> one we go with (or if we come up with our own event names), but it'd be
> good to follow the same pattern of having events and an API like
> canGoBack(), goForward(), etc. If they ever move to standardize, then we
> can follow suit.
>
>
> On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:
>
> > Mozilla's 'locationchange' is similar to what we have for ChildBrowser,
> but
> > I don't see the equivalent in the Chrome example - I suppose it is
> > 'loadstop'?
> >
> > I suppose if we were to adopt either, it would go something like this:
> >
> > var iab = window.open('http://apache.org', '_blank');
> > // Firefox
> > iab.addEventListener('locationchange', handleLocationChange);
> > // Chrome
> > iab.addEventListener('loadstop', handleLoadStop);
> >
> > // Firefox
> > function handleLocationChange(e) {
> >      console.log('location changed to: ' + e.detail);
> > }
> > // Chrome
> > function handleLoadStop(e) {
> >      console.log('location changed to: ' + e.url);
> > }
> >
> > On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> >
> > >
> > >
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
> >
>

Re: InAppBrowser - events

Posted by Andrew Grieve <ag...@chromium.org>.
Looks that way. Given how similar they are, I don't think it matters which
one we go with (or if we come up with our own event names), but it'd be
good to follow the same pattern of having events and an API like
canGoBack(), goForward(), etc. If they ever move to standardize, then we
can follow suit.


On Wed, Nov 21, 2012 at 7:18 PM, Shazron <sh...@gmail.com> wrote:

> Mozilla's 'locationchange' is similar to what we have for ChildBrowser, but
> I don't see the equivalent in the Chrome example - I suppose it is
> 'loadstop'?
>
> I suppose if we were to adopt either, it would go something like this:
>
> var iab = window.open('http://apache.org', '_blank');
> // Firefox
> iab.addEventListener('locationchange', handleLocationChange);
> // Chrome
> iab.addEventListener('loadstop', handleLoadStop);
>
> // Firefox
> function handleLocationChange(e) {
>      console.log('location changed to: ' + e.detail);
> }
> // Chrome
> function handleLoadStop(e) {
>      console.log('location changed to: ' + e.url);
> }
>
> On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> >
> >
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js
>

Re: InAppBrowser - events

Posted by Shazron <sh...@gmail.com>.
Mozilla's 'locationchange' is similar to what we have for ChildBrowser, but
I don't see the equivalent in the Chrome example - I suppose it is
'loadstop'?

I suppose if we were to adopt either, it would go something like this:

var iab = window.open('http://apache.org', '_blank');
// Firefox
iab.addEventListener('locationchange', handleLocationChange);
// Chrome
iab.addEventListener('loadstop', handleLoadStop);

// Firefox
function handleLocationChange(e) {
     console.log('location changed to: ' + e.detail);
}
// Chrome
function handleLoadStop(e) {
     console.log('location changed to: ' + e.url);
}

On Wed, Nov 21, 2012 at 1:32 PM, Andrew Grieve <ag...@chromium.org> wrote:

>
> https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js

Re: InAppBrowser - events

Posted by Andrew Grieve <ag...@chromium.org>.
Both Chrome and Firefox are working on similar APIs, but I don't think
there's much progress towards standardizing yet.

Firefox's is documented here:
https://wiki.mozilla.org/WebAPI/BrowserAPI

Chrome doesn't have docs for it yet, but use them in a sample app:
https://github.com/GoogleChrome/chrome-app-samples/blob/master/browser/browser.js




On Wed, Nov 21, 2012 at 4:02 PM, Shazron <sh...@gmail.com> wrote:

> The only diff between InAppBrowser and ChildBrowser is events support. Any
> ideas for a 'web standard' way to handle this? Most users use the
> ChildBrowser for OAuth, and need events.
>
> I'm thinking of the "message" event (and MessageEvent object) from the
> window.postMessage API:
>
> 1. https://developer.mozilla.org/en-US/docs/DOM/window.postMessage
> 2. http://www.w3.org/TR/2008/WD-html5-20080610/comms.html
>