bowser-js / bowser

a browser detector
Other
5.5k stars 487 forks source link

Add WebView detection #140

Open lancedikson opened 8 years ago

lancedikson commented 8 years ago

Detect WebView on Android and iOS. Android Docs

cekvenich commented 8 years ago

+1

karthikbr82 commented 7 years ago

+1

dayAlone commented 7 years ago

+1

tetreault commented 7 years ago

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

cpv commented 6 years ago

+1

daniel-nagy commented 6 years ago

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 commented 5 years ago

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

lancedikson commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

maerzhase commented 4 years ago

@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 commented 4 years ago

I submitted a pull request regarding this issue: #452

nejcm commented 3 years ago

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

tobsn commented 3 years ago

@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 commented 3 years ago

@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