Infinity Scroll

expands biggest element when user reaches bottom of page.

目前為 2022-10-23 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Infinity Scroll
  3. // @namespace -
  4. // @version 1.0.0
  5. // @description expands biggest element when user reaches bottom of page.
  6. // @author NotYou
  7. // @include *
  8. // @run-at document-idle
  9. // @license GPL-3.0-or-later
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13.  
  14. (function() {
  15. let longestDiv = Array.from(document.querySelectorAll(':not(body) > div')).sort((a, e) => e.offsetHeight - a.offsetHeight)[0]
  16.  
  17. window.addEventListener('scroll', e => {
  18. if((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 100) {
  19. longestDiv.style.height = longestDiv.offsetHeight + 100 + 'px'
  20. }
  21. })
  22. })()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址