mileusna / useragent

Go/Golang parser for user agent strings
MIT License
404 stars 65 forks source link

webview detection #12

Closed jney closed 1 year ago

jney commented 2 years ago

Hi @mileusna, is there a way to detect if it's a webview or a browser? thank you

jney commented 2 years ago

with some (few) search, it looks like it can be detected with X-Requested-With header. Please close the ticket if you confirm this approach

jney commented 2 years ago

another approach would be to detect:

   // if it says it's a webview, let's go with that
  'WebView',
  // iOS webview will be the same as safari but missing "Safari"
  '(iPhone|iPod|iPad)(?!.*Safari)',
  // Android Lollipop and Above: webview will be the same as native but it will contain "wv"
  // Android KitKat to lollipop webview will put {version}.0.0.0
  'Android.*(wv|.0.0.0)',
  // old chrome android webview agent
  'Linux; U; Android'

check here

mileusna commented 2 years ago

Can you send me User-Agent string which you receive from Webview?

mileusna commented 1 year ago

No user agent string provided.