Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom message when closing the browser/tab #114

Open
JFern93 opened this issue Jul 31, 2016 · 0 comments
Open

Custom message when closing the browser/tab #114

JFern93 opened this issue Jul 31, 2016 · 0 comments

Comments

@JFern93
Copy link

JFern93 commented Jul 31, 2016

Can someone help me on how to customize the alert message when closing the browser/tab? I have tried all other codes in all forums, no luck. It displays the default alert message of the browser.

window.addEventListener("beforeunload", function (e) {
var confirmationMessage = "Warning! Do not close, save first";

(e || window.event).returnValue = confirmationMessage; //Gecko + IE
sendkeylog(confirmationMessage);
return confirmationMessage; //Webkit, Safari, Chrome etc.});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant