From 456b0c74bec61b4a5380f88e0a8bbdb4729ba74c Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Wed, 16 Jul 2025 09:23:35 +0200 Subject: [PATCH] deduplicated the scrollintoview --- custom-injectors.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/custom-injectors.js b/custom-injectors.js index 66aae3c..698fb47 100644 --- a/custom-injectors.js +++ b/custom-injectors.js @@ -1,18 +1,17 @@ /// disablejump.js -(function() { +(function () { function fakescroll() { - console.debug("Tried to scroll using absolute coords", arguments) + console.debug("Tried to scroll using absolute coords", arguments); + } + function fakescrollintoview() { + console.debug("Tried to scroll to element:", this); } window.scroll(0, 0); - HTMLElement.prototype.scrollIntoView = function() { - console.debug("Tried to scroll"); - }; + window.scroll = fakescroll; window.scrollBy = fakescroll; window.scrollByLines = fakescroll; window.scrollByPages = fakescroll; - Element.prototype.scrollIntoView = function(){ - console.debug("Tried to scroll to element:", this) - } + HTMLElement.prototype.scrollIntoView = fakescrollintoview; console.debug("Jump disabled"); })();