Skip to content

Commit

Permalink
IE Browser check added.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathy365 committed May 4, 2020
1 parent 1b74656 commit 7333459
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Myrtille.Web/js/securden.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
var disableUserClose = true;
var isSessionConnected = false;

this.isIEBrowserExceptEdge = function () {
var ua = navigator.userAgent;

// IE 10 or older
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return true;
}

// IE 11
var trident = ua.indexOf('Trident/');
if (trident > 0) {
return true;
}

return false;
};

window.onbeforeunload = function (evt) {
if (disableUserClose) {
return "Do you want to close tab?";
if (!isIEBrowserExceptEdge() || isSessionConnected) {
return "Do you want to close tab?";
}
}
}

window.onunload = function (evt) {
alert(isSessionConnected);
if (isSessionConnected) {
doDisconnect();
}
Expand Down

0 comments on commit 7333459

Please sign in to comment.