Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
(04-22-2019, 03:08 PM)rock888 Wrote: Settings --> search gesture
I just checked enable mouse gesture is set to off
Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
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
Posts: 6,176
Threads: 90
Joined: Oct 2014
Reputation:
365
(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.
Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
can you fix it?
or do you think I should get rid of it?
maybe the loop is in order to serve its cause?
Posts: 6,176
Threads: 90
Joined: Oct 2014
Reputation:
365
(04-23-2019, 04:28 PM)patrickdrd Wrote: can you fix it?
or do you think I should get rid of it?
maybe the loop is in order to serve its cause?
Yes, it intends to do that.
I suggest disabling or removing it.
Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
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?
Posts: 6,176
Threads: 90
Joined: Oct 2014
Reputation:
365
(04-25-2019, 07:06 AM)patrickdrd Wrote: 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?
Just try adding "//"(without quotes) in front of " setTimeout(unsetOnBeforeUnload, 300);".
Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
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
Posts: 6,176
Threads: 90
Joined: Oct 2014
Reputation:
365
(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,
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
You may suggest the author to add blacklist feature, so you can disable this script on websites where it will cause problem.
Posts: 188
Threads: 23
Joined: Dec 2018
Reputation:
10
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
|