oalders / http-browserdetect

Determine the Web browser, version, and platform from an HTTP user agent string
http://www.browserdetect.org
Other
58 stars 47 forks source link

Webview detection uses wrong version number #174

Open oalders opened 4 years ago

oalders commented 4 years ago

As reported by email:

the pattern matching for webview detection, lines 974-978. In this code block you're matching anything that's chrome + android + version 30.0 or greater. This isn't correct, according to the Google link in the documentation (See: https://developer.chrome.com/multidevice/user-agent#webview_user_agent ), the version number should not be included in the pattern matching but rather the Version/_X.X string. So rather than matching browser_major > 30, it should be a pattern match for the presence of Version/_X.X.

Using the code as-is, all android hits that are version 30.0 or greater are being reported as android - webview.