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

ios-webview is shown as just "ios" #110

Open
RusseII opened this issue May 20, 2019 · 10 comments
Open

ios-webview is shown as just "ios" #110

RusseII opened this issue May 20, 2019 · 10 comments
Assignees

Comments

@RusseII
Copy link

RusseII commented May 20, 2019

image

I believe this should be detected as ios-webview

@DamonOehlman
Copy link
Owner

Thanks @RusseII - would you mind dropping the UA that the webview is reporting into this issue and I can do some further testing to get to the bottom of this please?

I think some folks have used sites like https://www.whatismybrowser.com/detect/what-is-my-user-agent to achieve this in the past. I think you should be able to select and copy and paste the text into this issue.

Thanks heaps,
Damon.

@RusseII
Copy link
Author

RusseII commented May 21, 2019 via email

@RusseII
Copy link
Author

RusseII commented May 21, 2019 via email

@RusseII
Copy link
Author

RusseII commented May 23, 2019

@DamonOehlman anymore thoughts on this?

@DamonOehlman
Copy link
Owner

@RusseII apologies got buried with other things. They do indeed look identical. My familiarity with ios has dropped off in recent years. Perhaps they have lifted their game on apps having the real mobile browser rather than a webview that is lagging behind (which probably causes other problems for app developers).

@Fjohn666
Copy link

Fjohn666 commented Jul 4, 2019

Hello, We have the same problem here with Safari. The browser is detected as "ios". Maybe the regex need to be updated ?

@RusseII
Copy link
Author

RusseII commented Jul 6, 2019

@Fjohn666 It seems that the current method of detection will not work as the User Agent for native Safari, and a Safari webview seem to be identical.

@DamonOehlman
Copy link
Owner

Yep (and thanks for commenting @RUSSEIL) I think we have hit some limitations with iOS detection. If anyone comes up with any ideas then we can definitely consider implementing them.

@RusseII
Copy link
Author

RusseII commented Jul 8, 2019

I am not sure how to do it with purely a regex, but right now I'm using this library https://github.com/muaz-khan/DetectRTC, which lets me identify if someone is using a safari webview with:

switch (DetectRTC && DetectRTC.osName) {
    case 'iOS':
      if (browser.name === 'Safari') {
        if (!DetectRTC.isGetUserMediaSupported){
          console.log("Safari Webview Detected!")
}}

Then you can see how they check isGetUserMediaSupported here: https://github.com/muaz-khan/DetectRTC/blob/master/dev/DetectRTC.js

Maybe we can do something similar to this approach?

@DamonOehlman
Copy link
Owner

@RusseII nice workaround :)

I think rather than try to implement any kind of detection hack into detect-browser itself, encouraging folks to use a technique similar to what you are doing above is best. I should probably add something to the README about this - probably a link to this issue and specifically your comment above is ideal.

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

3 participants