bowser icon indicating copy to clipboard operation
bowser copied to clipboard

Add WebView detection

Open lancedikson opened this issue 9 years ago • 15 comments

Detect WebView on Android and iOS. Android Docs

lancedikson avatar May 09 '16 06:05 lancedikson

+1

cekvenich avatar Sep 30 '16 22:09 cekvenich

+1

karthikbr82 avatar Jan 05 '17 15:01 karthikbr82

+1

dayAlone avatar Jan 27 '17 03:01 dayAlone

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

tetreault avatar Jul 23 '17 20:07 tetreault

+1

cpv avatar Nov 17 '17 01:11 cpv

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.

daniel-nagy avatar Nov 12 '18 00:11 daniel-nagy

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

henriquecustodia avatar Apr 10 '19 13:04 henriquecustodia

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 :)

lancedikson avatar Apr 10 '19 14:04 lancedikson

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.

  • https://developers.whatismybrowser.com/useragents/parse/168832-office-windows-trident

maerzhase avatar Sep 02 '20 10:09 maerzhase

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

lancedikson avatar Sep 06 '20 10:09 lancedikson

@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?

maerzhase avatar Oct 07 '20 16:10 maerzhase

I submitted a pull request regarding this issue: #452

eimanip avatar Oct 16 '20 18:10 eimanip

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

nejcm avatar Jan 12 '21 08:01 nejcm

@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 ;)

tobsn avatar May 04 '21 20:05 tobsn

@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

eimanip avatar Jul 24 '21 00:07 eimanip