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

Add WebView detection #140

Open
lancedikson opened this issue May 9, 2016 · 15 comments · May be fixed by #452
Open

Add WebView detection #140

lancedikson opened this issue May 9, 2016 · 15 comments · May be fixed by #452

Comments

@lancedikson
Copy link
Collaborator

lancedikson commented May 9, 2016

Detect WebView on Android and iOS.
Android Docs

@cekvenich
Copy link

+1

2 similar comments
@karthikbr82
Copy link

+1

@dayAlone
Copy link

+1

@tetreault
Copy link

+1 - just had to sniff for social app webviews (as best as possible) and not use bower if those were detected

@cpv
Copy link

cpv commented Nov 17, 2017

+1

@daniel-nagy
Copy link

Here are some UAs I've received from error logging.

Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16B92 Instagram 70.1.0.15.98 (iPhone10,2; iOS 12_1; en_US; en-US; scale=2.61; gamut=wide; 1080x1920; 130350235)
Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) Safari/538.1 Daum/4.1
Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A404 Instagram 70.1.0.15.98 (iPhone9,1; iOS 12_0_1; en_US; en-US; scale=2.00; gamut=wide; 750x1334; 130350235)
Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16B92
Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) GSA/61.0.217752169 Mobile/16A404 Safari/604.1
Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A404 [FBAN/FBIOS;FBAV/192.0.0.61.85;FBBV/126707849;FBDV/iPhone10,1;FBMD/iPhone;FBSN/iOS;FBSV/12.0.1;FBSS/2;FBCR/Sprint;FBID/phone;FBLC/en_US;FBOP/5;FBRV/127817253]
Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A404 Instagram 70.0.0.14.98 (iPhone10,3; iOS 12_0_1; en_US; en-US; scale=3.00; gamut=wide; 1125x2436; 129989597)
Mozilla/5.0 (iPad; CPU OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 [FBAN/MessengerForiOS;FBAV/189.0.0.41.99;FBBV/128677242;FBDV/iPad5,3;FBMD/iPad;FBSN/iOS;FBSV/10.3.3;FBSS/2;FBCR/;FBID/tablet;FBLC/en_US;FBOP/5]

Looks like Instagram and Facebook Messenger for the most part.

@henriquecustodia
Copy link

Any news about this feature? It's very useful for my project

@lancedikson
Copy link
Collaborator Author

Unfortunately, not. But seems to be quite a wanted feature. I guess I won't have enough time to do it, so it's open for an enthusiastic programmer to code it :)

@maerzhase
Copy link

yes would be definitely a great feature. I am wondering: Could you say "webview" is same as "websoftware" because i would also love to know if the ua is coming from e.g. Microsoft Office, etc.

@lancedikson
Copy link
Collaborator Author

@maerzhase, well, the terms seem very close to me. However, we could add MS Office detection regardless of the webview detection I guess.

@maerzhase
Copy link

@lancedikson Do you have an idea how to implement the ms office detection? Sorry i didn't yet look at the code yet but I would be up for helping with the implementation. Maybe you have a good place to start?

@eimanip eimanip linked a pull request Oct 16, 2020 that will close this issue
@eimanip
Copy link

eimanip commented Oct 16, 2020

I submitted a pull request regarding this issue: #452

@nejcm
Copy link

nejcm commented Jan 12, 2021

This would be super useful! WebViews are limited in certain features and detecting them would be great.

@tobsn
Copy link

tobsn commented May 4, 2021

@eimanip randomly found this issue - I checked the code and I don't think this detects a webview, just detects safari on iOS or chrome android? not specifically a webview - let me know if I'm wrong because I'm trying to do the same ;)

@eimanip
Copy link

eimanip commented Jul 24, 2021

@eimanip randomly found this issue - I checked the code and I don't think this detects a webview, just detects safari on iOS or chrome android? not specifically a webview - let me know if I'm wrong because I'm trying to do the same ;)

Sorry for the delayed response.
Did you check the tests in the pull request? It does specifically checks if it's a webview. Basically, for iOS you should check for the absence of Safari word in the user agent. On the other hand, you should check for the presence of wv in the user agent for Android webview.
You can check out the following resources for more information: is-ua-webview, Stackoverflow, Stackoverflow

@polar-sh polar-sh bot added Fund and removed Fund labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.