Infinity Scroll Truncation

Nuke unexepected infinity pools by limiting the max scroll of unknown pages

  1. // ==UserScript==
  2. // @name Infinity Scroll Truncation
  3. // @namespace primal.red
  4. // @version 0.1
  5. // @license MIT
  6. // @description Nuke unexepected infinity pools by limiting the max scroll of unknown pages
  7. // @match *://*/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. var limit = 6000;
  15. var skipList = ['duckduckgo.com']
  16. var increasedLengthPages = {
  17. 'steepster.com': 1.6
  18. }
  19. var skip = false
  20. for( let site of skipList ){
  21. if(skip){
  22. break
  23. }else{
  24. skip = document.URL.match(site) != null
  25. }
  26. }
  27. Object.entries(increasedLengthPages).map(entry => {
  28. let site = entry[0];
  29. let factor = entry[1];
  30. if( document.URL.match(site) != null ){
  31. limit *= factor;
  32. }
  33. })
  34.  
  35. if( !skip ){
  36. window.onscroll = function() {
  37. if(window.pageYOffset >= limit){
  38. window.scroll(0,limit)
  39. }
  40. }
  41. }
  42. })();