This is my js code to prevent multiple tab in same browser.
<script type="text/javascript">
window.onload = function(){
if (document.cookie.indexOf("_instance=true") === -1) {
document.cookie = "_instance=true";
// Set the onunload function
window.onunload = function(){
document.cookie ="_instance=true;expires=Thu, 01-Jan-1970 00:00:01 GMT";
};
// Load the application
}
else {
alert(" Security Alerts.You Are Opening Multiple Window. This window will now close.");
var win = window.open("about:blank", "_self"); win.close();
// Notify the user
}
};
</script>
It is work fine in chrome and firefox But It always make alert in Safari Browser(Mac). Is there any other replace code for that. Thanks in advance.