0

What is the most solid way to check whether a user is on a webview inside a App or another web browser?

We can get details of the OS running using javascript window.navigator.userAgent, but is there a way to specifically identify whether user is using a webview or a web browser?

Ishara Abeykoon
  • 540
  • 1
  • 6
  • 24
  • Does this answer your question? [Detect if user is using webview for android/iOS or a regular browser](https://stackoverflow.com/questions/37591279/detect-if-user-is-using-webview-for-android-ios-or-a-regular-browser) – Daan May 14 '20 at 07:25
  • Actually it's not it's checking the Operating system and the Browser and the implementations to check webview are only for ios are other are on PHP.But thanks :) – Ishara Abeykoon May 14 '20 at 07:36
  • I think I found a solution, could'nt check for ios but works well for desktop browsers and android webviews. – Ishara Abeykoon May 14 '20 at 07:37

1 Answers1

1

Following simple check worked out for a webview inside android application, not sure how it'll work on IOS though,

  if( navigator.userAgent.includes ('wv')){
     //Inside the webview      
  }else{
     //Not a webview
  }
Ishara Abeykoon
  • 540
  • 1
  • 6
  • 24