You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Naik, Archana" <na...@lab126.com> on 2014/02/04 20:20:01 UTC

Android/amazon-fireos: web view callbacks

Hi, Devs

There are 2 classes - CordovaWebViewClient and CordovaChromeClient in amazon-fireos repo. They basically handle WebView callbacks. Recently, while using Cordova internally for our projects we needed to handle few more callbacks and noticed they were missing. I was wondering if there is any reason why some callbacks were not handled? If not, I am cool.
I would like to add the ones we need for now so want to make sure I am not missing anything. :)

Also, one more thing, we would like to pass on these callbacks to plugins incase they want to handle it. If no plugin wants handle it then callback handling will fallback to the default cordova one.

Please let me know your thoughts.
Thanks
Archana

Re: Android/amazon-fireos: web view callbacks

Posted by Joe Bowser <bo...@gmail.com>.
I think that both would be fine to add.  It's probably a good idea to
add these hooks, to be honest, since we don't have any default
behaviour associated with them AFAIK.

On Tue, Feb 4, 2014 at 3:22 PM, Andrew Grieve <ag...@chromium.org> wrote:
> I think both would be fine to add. onCreateWindow is a bit tougher though
> because you don't know the URL upfront. It'd be hard to multiplex it... we
> might just say that plugins can register to receive the next call to
> window.open() though. Did you have any ideas about how this would look?
>
>
> On Tue, Feb 4, 2014 at 3:12 PM, Naik, Archana <na...@lab126.com> wrote:
>
>> So for example, onCreateWindow() or onProgressChanged(). We might need to
>> add onCreateWindow() but onProgressChanged() not that urgent.
>>
>> More importantly, we want to let plugins handle there callbacks first and
>> incase they don't we want to fallback on default handlers in these classes.
>>
>> Archana
>>
>> On 2/4/14 11:29 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>>
>> >Which callbacks in particular are missing? There are some callbacks we
>> >don't touch because they can break the WebView.  These can include
>> >anything that handles gestures (which when done wrong, can break touch
>> >events), and other view related callbacks.  I'd highly recommend
>> >writing tests for the existing behaviour before adding the callbacks,
>> >since we've had very bad luck with this in the past w.r.t. the back
>> >button.
>> >
>> >On Tue, Feb 4, 2014 at 11:20 AM, Naik, Archana <na...@lab126.com> wrote:
>> >> Hi, Devs
>> >>
>> >> There are 2 classes - CordovaWebViewClient and CordovaChromeClient in
>> >>amazon-fireos repo. They basically handle WebView callbacks. Recently,
>> >>while using Cordova internally for our projects we needed to handle few
>> >>more callbacks and noticed they were missing. I was wondering if there
>> >>is any reason why some callbacks were not handled? If not, I am cool.
>> >> I would like to add the ones we need for now so want to make sure I am
>> >>not missing anything. :)
>> >>
>> >> Also, one more thing, we would like to pass on these callbacks to
>> >>plugins incase they want to handle it. If no plugin wants handle it then
>> >>callback handling will fallback to the default cordova one.
>> >>
>> >> Please let me know your thoughts.
>> >> Thanks
>> >> Archana
>>
>>

Re: Android/amazon-fireos: web view callbacks

Posted by Andrew Grieve <ag...@chromium.org>.
I think both would be fine to add. onCreateWindow is a bit tougher though
because you don't know the URL upfront. It'd be hard to multiplex it... we
might just say that plugins can register to receive the next call to
window.open() though. Did you have any ideas about how this would look?


On Tue, Feb 4, 2014 at 3:12 PM, Naik, Archana <na...@lab126.com> wrote:

> So for example, onCreateWindow() or onProgressChanged(). We might need to
> add onCreateWindow() but onProgressChanged() not that urgent.
>
> More importantly, we want to let plugins handle there callbacks first and
> incase they don't we want to fallback on default handlers in these classes.
>
> Archana
>
> On 2/4/14 11:29 AM, "Joe Bowser" <bo...@gmail.com> wrote:
>
> >Which callbacks in particular are missing? There are some callbacks we
> >don't touch because they can break the WebView.  These can include
> >anything that handles gestures (which when done wrong, can break touch
> >events), and other view related callbacks.  I'd highly recommend
> >writing tests for the existing behaviour before adding the callbacks,
> >since we've had very bad luck with this in the past w.r.t. the back
> >button.
> >
> >On Tue, Feb 4, 2014 at 11:20 AM, Naik, Archana <na...@lab126.com> wrote:
> >> Hi, Devs
> >>
> >> There are 2 classes - CordovaWebViewClient and CordovaChromeClient in
> >>amazon-fireos repo. They basically handle WebView callbacks. Recently,
> >>while using Cordova internally for our projects we needed to handle few
> >>more callbacks and noticed they were missing. I was wondering if there
> >>is any reason why some callbacks were not handled? If not, I am cool.
> >> I would like to add the ones we need for now so want to make sure I am
> >>not missing anything. :)
> >>
> >> Also, one more thing, we would like to pass on these callbacks to
> >>plugins incase they want to handle it. If no plugin wants handle it then
> >>callback handling will fallback to the default cordova one.
> >>
> >> Please let me know your thoughts.
> >> Thanks
> >> Archana
>
>

Re: Android/amazon-fireos: web view callbacks

Posted by "Naik, Archana" <na...@lab126.com>.
So for example, onCreateWindow() or onProgressChanged(). We might need to
add onCreateWindow() but onProgressChanged() not that urgent.

More importantly, we want to let plugins handle there callbacks first and
incase they don't we want to fallback on default handlers in these classes.

Archana

On 2/4/14 11:29 AM, "Joe Bowser" <bo...@gmail.com> wrote:

>Which callbacks in particular are missing? There are some callbacks we
>don't touch because they can break the WebView.  These can include
>anything that handles gestures (which when done wrong, can break touch
>events), and other view related callbacks.  I'd highly recommend
>writing tests for the existing behaviour before adding the callbacks,
>since we've had very bad luck with this in the past w.r.t. the back
>button.
>
>On Tue, Feb 4, 2014 at 11:20 AM, Naik, Archana <na...@lab126.com> wrote:
>> Hi, Devs
>>
>> There are 2 classes - CordovaWebViewClient and CordovaChromeClient in
>>amazon-fireos repo. They basically handle WebView callbacks. Recently,
>>while using Cordova internally for our projects we needed to handle few
>>more callbacks and noticed they were missing. I was wondering if there
>>is any reason why some callbacks were not handled? If not, I am cool.
>> I would like to add the ones we need for now so want to make sure I am
>>not missing anything. :)
>>
>> Also, one more thing, we would like to pass on these callbacks to
>>plugins incase they want to handle it. If no plugin wants handle it then
>>callback handling will fallback to the default cordova one.
>>
>> Please let me know your thoughts.
>> Thanks
>> Archana


Re: Android/amazon-fireos: web view callbacks

Posted by Joe Bowser <bo...@gmail.com>.
Which callbacks in particular are missing? There are some callbacks we
don't touch because they can break the WebView.  These can include
anything that handles gestures (which when done wrong, can break touch
events), and other view related callbacks.  I'd highly recommend
writing tests for the existing behaviour before adding the callbacks,
since we've had very bad luck with this in the past w.r.t. the back
button.

On Tue, Feb 4, 2014 at 11:20 AM, Naik, Archana <na...@lab126.com> wrote:
> Hi, Devs
>
> There are 2 classes - CordovaWebViewClient and CordovaChromeClient in amazon-fireos repo. They basically handle WebView callbacks. Recently, while using Cordova internally for our projects we needed to handle few more callbacks and noticed they were missing. I was wondering if there is any reason why some callbacks were not handled? If not, I am cool.
> I would like to add the ones we need for now so want to make sure I am not missing anything. :)
>
> Also, one more thing, we would like to pass on these callbacks to plugins incase they want to handle it. If no plugin wants handle it then callback handling will fallback to the default cordova one.
>
> Please let me know your thoughts.
> Thanks
> Archana

Re: Android/amazon-fireos: web view callbacks

Posted by Anis KADRI <an...@gmail.com>.
Which callbacks are we talking about?


On Tue, Feb 4, 2014 at 11:20 AM, Naik, Archana <na...@lab126.com> wrote:

> Hi, Devs
>
> There are 2 classes - CordovaWebViewClient and CordovaChromeClient in
> amazon-fireos repo. They basically handle WebView callbacks. Recently,
> while using Cordova internally for our projects we needed to handle few
> more callbacks and noticed they were missing. I was wondering if there is
> any reason why some callbacks were not handled? If not, I am cool.
> I would like to add the ones we need for now so want to make sure I am not
> missing anything. :)
>
> Also, one more thing, we would like to pass on these callbacks to plugins
> incase they want to handle it. If no plugin wants handle it then callback
> handling will fallback to the default cordova one.
>
> Please let me know your thoughts.
> Thanks
> Archana
>