04-23-2019, 06:00 AM
|
scroll problems
|
|
04-23-2019, 08:44 AM
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
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, I think there is dead loop in this script.
04-23-2019, 04:28 PM
can you fix it?
or do you think I should get rid of it? maybe the loop is in order to serve its cause?
04-24-2019, 02:11 PM
04-25-2019, 07:06 AM
(This post was last modified: 04-25-2019, 07:07 AM by patrickdrd.)
I need it for those annoying popups in pages asking me if I want to leave page/site,
is there any other way to turn this off?
04-25-2019, 08:26 AM
04-30-2019, 10:32 AM
actually I can't do that, because this part of code is needed for the correct working of the script,
e.g. go over to the page: https://regex101.com type anything in the two boxes and then try to close the tab, you will be asked if you're sure you want to leave the site, this kind of messages are eliminated with the above code
04-30-2019, 03:59 PM
(04-30-2019, 10:32 AM)patrickdrd Wrote: actually I can't do that, because this part of code is needed for the correct working of the script, You may suggest the author to add blacklist feature, so you can disable this script on websites where it will cause problem.
04-30-2019, 04:36 PM
this is already implemented in tampermonkey I'm using so as I said I disabled it on youtube where it was causing problems for me
|
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)


