How can I globally and PERMANENTLY disable chromes ability to open
"Leave Site?" "Changes may not be saved" popups.
I want to close every tab of every chrome window and I know what I'm doing I don't need the nanny app to prevent my shutdown or get in my way when I'm trying to close out.
I tried tampermonkey scripts for disabling "onbeforeunload" events but they're not stopping this obnoxious behavior from chrome.
beforeunload
listener before the page does by declaring @run-at document-start
in the metadata block.stopImmediatePropagation
to prevent the subsequently added page listeners from seeing the event. window.onbeforeunload
.// ==UserScript==
// @name ignore beforeunload
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
window.addEventListener('beforeunload', e => {
window.onbeforeunload = null;
e.stopImmediatePropagation();
});