I need to stop redirect to a particular url. There is a piece of encrypted async js code which redirects to another page on adding any external/3rd party js. Is it possible to have an event or anything which can detect the redirect to that specific url alone? I have used this code
var back = false;
back = true; //Somewhere, the condition is set to true
window.onbeforeunload = function (e) {
if(back == true)
return "Are you sure to exit?";
}
Is it possible to autopress cancel after popup?