04-23-2019, 03:37 PM
(04-23-2019, 08:44 AM)patrickdrd Wrote: I think I found it, I have a script in tampermonkey to disable all these annoying "close this page" popups,
here's the code:
Code:// ==UserScript== // @name kill_beforeunload // @namespace Violentmonkey Scripts // @include * // @grant none // @run-at document-start // ==/UserScript== // EventTarget.prototype.addEventListenerBase = EventTarget.prototype.addEventListener; EventTarget.prototype.addEventListener = function(type, listener) { if(type=="beforeunload") { return; //ignore attempts to add a beforeunload event } this.addEventListenerBase(type, listener); //treat all other events normally }; function unsetOnBeforeUnload() { window.onbeforeunload = function(event) {}; setTimeout(unsetOnBeforeUnload, 300); //optional, but some pages might set the event later in the page's lifecycle } document.addEventListener("DOMContentLoaded", unsetOnBeforeUnload);
I disabled it for youtube and now scrolling works when I switch to new comments for example,
which was impossible to work without that
I think there is dead loop in this script.

