The answer might be a resounding no, but I figured I'd ask anyway. I realize this might be a security nightmare.
I created the following test page that checks whether or not the user is using an in app browser or not and displays a link accordingly.
When the user does use an in app browser, I am displaying the "continue here" link and I would like him to be prompted to choose to open the link in his mobile's default browser rather than in the in app browser he is currently using.
<html>
<body>
<a id="btn" href="#" onclick="window.open('https://www.google.com', '_system'); return false;">Continue here</a>
<a id="btn2">not in app browser</a>
</body>
</html>
<script>
webviewCheck();
function webviewCheck() {
let standalone = window.navigator.standalone,
userAgent = window.navigator.userAgent.toLowerCase(),
safari = /safari/.test(userAgent),
ios = /iphone|ipod|ipad/.test(userAgent);
if (ios) {
if (!standalone && safari) {
// Safari
console.log("safari browser is being used");
document.getElementById("btn").hidden=true;
} else if (!standalone && !safari) {
// iOS webview
console.log("IOS webview is being used");
document.getElementById("btn2").hidden=true;
};
} else {
if (userAgent.includes('wv')) {
// Android webview
console.log("Android webview is being used");
document.getElementById("btn2").hidden=true;
} else {
// Chrome
console.log("Other browser is being used (firefox/chrome/edge/etc)");
document.getElementById("btn").hidden=true;
}
};
}
</script>