Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for UIWebView for in-app Browsers #121

Open
avcohen opened this issue Oct 10, 2019 · 5 comments
Open

Support for UIWebView for in-app Browsers #121

avcohen opened this issue Oct 10, 2019 · 5 comments

Comments

@avcohen
Copy link

avcohen commented Oct 10, 2019

Currently calling browser() returns null in this environment.

Issue was found on iOS when navigating to a UIWebView via in-app browsers (Facebook & Snapchat).

@avcohen avcohen closed this as completed Oct 10, 2019
@avcohen avcohen reopened this Oct 10, 2019
@avcohen avcohen changed the title Support for UIWebView Support for UIWebView for in-app Browsers Oct 10, 2019
@DamonOehlman
Copy link
Owner

@avcohen thanks for reporting the issue. Any chance you can capture the user agents in that UIWebView so I can investigate further? Unfortunately I have limited access to iOS devices.

@avcohen
Copy link
Author

avcohen commented Oct 14, 2019

No problem at all. Here's the output from navigator.userAgent:

Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301

To note I used this tool to get in there and inspect this.

@DamonOehlman
Copy link
Owner

@avcohen Thanks mate - out of interest what do you think the version number should be on this detection? It looks like 603.1.30 or 14E8301 would both be valid options. Not being familiar with the platform I'm not really sure.

Additionally, with a bit of reading it looks like UIWebView has been deprecated in favour of WKWebView so I guess I need to be considering that for UA detection also.

@DamonOehlman
Copy link
Owner

Actually... doing some testing with this locally now, I can see that the UA string provided above already satisfies the current uiwebview regex and thus this is the result returned from detection:

{ name: 'ios-webview', version: '603.1.30', os: 'iOS' }

(obviously I decided the 603.1.30 was the appropriate version number)

I think what is happening is that both Facebook and Snapchat have updated their apps to use the WKWebView and the UA detection is no longer working. I'll see if I can track down the user agent used.

@DamonOehlman
Copy link
Owner

Also remembering that an app can set a custom useragent also, so... may need a more detailed investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants