You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Pridham, Marcus" <ma...@sap.com> on 2013/09/05 17:14:32 UTC

iOS InAppBrowser user agent troubles

Has anyone else run into issues with the iOS InAppBrowser changing the Cordova webviews user agent.

If I run the following JavaScript in the InAppBrowser:
window.location.hash = "anchor";

The user agent of the Cordova web view changes from:
Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141 (176830592)

Into:

Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141


The new user agent messes up the whitelist so all requests can go through and if I navigate to a new page in the Cordova web view deviceready does not fire :(

I create an issue with a sample app here:
https://issues.apache.org/jira/browse/CB-4740

Thanks
Marcus

Re: iOS InAppBrowser user agent troubles

Posted by Tim Robertson <ti...@gmail.com>.
I've seen the same thing FWIW, it manifested itself only with a 'fresh'
app. That is, one that hasn't had the user agent string stored previously.


On Thu, Sep 5, 2013 at 5:07 PM, Shazron <sh...@gmail.com> wrote:

> Well that's a new one. This was encountered some time ago as well:
> https://issues.apache.org/jira/browse/CB-2225 but with PDFs
>
>
> On Thu, Sep 5, 2013 at 11:14 PM, Pridham, Marcus <marcus.pridham@sap.com
> >wrote:
>
> > Has anyone else run into issues with the iOS InAppBrowser changing the
> > Cordova webviews user agent.
> >
> > If I run the following JavaScript in the InAppBrowser:
> > window.location.hash = "anchor";
> >
> > The user agent of the Cordova web view changes from:
> > Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26
> > (KHTML, like Gecko) Mobile/10B141 (176830592)
> >
> > Into:
> >
> > Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26
> > (KHTML, like Gecko) Mobile/10B141
> >
> >
> > The new user agent messes up the whitelist so all requests can go through
> > and if I navigate to a new page in the Cordova web view deviceready does
> > not fire :(
> >
> > I create an issue with a sample app here:
> > https://issues.apache.org/jira/browse/CB-4740
> >
> > Thanks
> > Marcus
> >
>

Re: iOS InAppBrowser user agent troubles

Posted by Shazron <sh...@gmail.com>.
Well that's a new one. This was encountered some time ago as well:
https://issues.apache.org/jira/browse/CB-2225 but with PDFs


On Thu, Sep 5, 2013 at 11:14 PM, Pridham, Marcus <ma...@sap.com>wrote:

> Has anyone else run into issues with the iOS InAppBrowser changing the
> Cordova webviews user agent.
>
> If I run the following JavaScript in the InAppBrowser:
> window.location.hash = "anchor";
>
> The user agent of the Cordova web view changes from:
> Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26
> (KHTML, like Gecko) Mobile/10B141 (176830592)
>
> Into:
>
> Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26
> (KHTML, like Gecko) Mobile/10B141
>
>
> The new user agent messes up the whitelist so all requests can go through
> and if I navigate to a new page in the Cordova web view deviceready does
> not fire :(
>
> I create an issue with a sample app here:
> https://issues.apache.org/jira/browse/CB-4740
>
> Thanks
> Marcus
>