Mobile-Detect icon indicating copy to clipboard operation
Mobile-Detect copied to clipboard

Chromium-based WebView incorrectly detected as Chrome browser on Android 4.4 and above

Open five1 opened this issue 7 years ago • 1 comments

The WebView UA can be detected by looking for "Version/X.X".

Example Chromium-based WebView UA: Mozilla/5.0 (Linux; Android 4.4.2; en-au; SAMSUNG SM-T520 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Safari/537.36

Example Chrome UA: Mozilla/5.0 (Linux; Android 4.4.2; SM-T520 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Safari/537.36

If you’re attempting to differentiate between the WebView and Chrome for Android, you should look for the presence of the Version/X.X string in the WebView user-agent string. https://developer.chrome.com/multidevice/user-agent#webview_user_agent

five1 avatar Apr 05 '17 23:04 five1

Also having this issue.

For reference, this is the UA string we are getting: Mozilla/5.0 (Linux; Android 7.1.2; KFKAWI Build/NS6301; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Safari/537.36

One difference between our case and the OP is I noticed a small "wv" after the build number, which does not appear in general Chrome UAs.

The device in question is an Amazon Fire Tablet.

Spotnyk avatar Jul 17 '19 16:07 Spotnyk