Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scroll problems
#11
(04-22-2019, 03:08 PM)rock888 Wrote: Settings  --> search gesture

I just checked enable mouse gesture is set to off
Reply
#12
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
Reply
#13
(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.
Reply
#14
can you fix it?
or do you think I should get rid of it?
maybe the loop is in order to serve its cause?
Reply
#15
(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.
Reply
#16
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?
Reply
#17
(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);".
Reply
#18
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
Reply
#19
(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.
Reply
#20
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
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)