If a user clicks a link from inside Facebook native iOS or Android app, the default is that a webview is opened inside the FB app instead of the regular browser. Is there a way to ask a user whether to leave or not when they try to close the webview?
In regular browsers, it's done like with javascript:
<script type="text/javascript">
var popit = true;
window.onbeforeunload = function() {
if(popit == true) {
popit = false;
return "Are you sure you want to leave?";
}
}
</script>
This does nothing in the in-app browser. Is there an equivalent that works? Note: I'm talking about website not mobile apps.