![]() Open that file in Chrome (and then click somewhere inside the window) and then try to close Chrome. Once you do, you won't be able to close this tab without clicking a Leave button first. Make sure to click somewhere on this page. Window.addEventListener("beforeunload", unloadEvent) Return confirmationMessage //Webkit, Safari, Chrome etc. (e || window.event).returnValue = confirmationMessage //Gecko + IE Var confirmationMessage = "Do you want to close this?" Just copy and paste this code into a file and name it something like warn.html If you load some simple javascript into a tab in Chrome, it will force a window to pop up when you try to close that tab. Also, it only worked for Windows users.įast forward to 2021 and although the functionality still hasn’t been added to Chrome, there’s an easy enough workaround. Once upon a time there was an extension that provided this functionality (it was made by Google in fact) but it has since been retired. Unlike other modern browsers like Firefox and Safari, Chrome does not ‘warn’ you when closing your browser if multiple-tabs are open. If (!bTopFound & nParent != null & !nParent.This guide will show you how to configure Chrome so that it gives you a warning before you exit the browser, saving you from accidentally closing all of your open tabs etc. etc., and redirect the first (root) page to login.aspx, and will not interfere with any event triggers because it pases the intial handler through. If you open all child windows with window.open, include this javascript in all pages, then CloseAll(false) from any included page will close all child, grandchildren, great-grand.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |