1

Possible Duplicate:
detect ipad/iphone webview via javascript

I need to disable a script on our mobile site when accessed from a native mobile app webview.

Is there a javascript conditional statement that I can use to target the iOS UIWebView from the client side?

Community
  • 1
  • 1
HjalmarCarlson
  • 868
  • 2
  • 17
  • 34

1 Answers1

1

Here is the solution, thanks to @nivas :

var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);

HjalmarCarlson
  • 868
  • 2
  • 17
  • 34