" detect webview with Javascript and user agent on android versions"
Bootstrap 3.1.0 Snippet by muhittinbudak

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <script src="https://cdn.jsdelivr.net/npm/is-ua-webview@1.1.2/index.min.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Strait"> <div class="container" style="font-family: 'Strait', sans-serif;"> <div class="row"> <center><h2> detect webview with Javascript and user agent on android versions</h2></center> </div> <center><h1 class="well webviewvarsa" style="background-color:yellow">Not Android Webview Browser.</h1></center> <span id="merak"></span> </div>
$(document).ready(function(){ function isFacebook() { var fresult = true; const userAgent = navigator.userAgent || navigator.vendor || window.opera; const isFacebookBrowser = userAgent.includes("FBAN") || userAgent.includes("FBAV"); if (isFacebookBrowser) { fresult = true; } else { fresult = false; } return fresult; } //------------ function isWebview() { const navigator = window.navigator const userAgent = navigator.userAgent const normalizedUserAgent = userAgent.toLowerCase() const standalone = navigator.standalone const isIos = /ip(ad|hone|od)/.test(normalizedUserAgent) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) const isAndroid = /android/.test(normalizedUserAgent) const isSafari = /safari/.test(normalizedUserAgent) const isWebview = (isAndroid && /; wv\)/.test(normalizedUserAgent)) || (isIos && !standalone && !isSafari) return isWebview } if(isWebview()){ $('.webviewvarsa').text("webview").css("background-color", "yellow");// } else { $('.webviewvarsa').text(" Not webview").css("background-color", "blue").css("color", "white"); } if(isFacebook()){ $("#merak").text("facebook");// } else { $("#merak").text("not facebook"); } });

Related: See More


Questions / Comments: