Eink-NGAAuto

Automatically click next button when page reaches bottom

  1. // ==UserScript==
  2. // @name Eink-NGAAuto
  3. // @namespace https://gf.qytechs.cn/users/169007
  4. // @version 1.0.6
  5. // @description Automatically click next button when page reaches bottom
  6. // @author ZZYSonny
  7. // @match https://bbs.nga.cn/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11. (function () {
  12. 'use strict';
  13. let resolveError = () => setTimeout(()=>{
  14. const tipTitle = document.getElementsByClassName("tip_title")[0];
  15. if(tipTitle!=null) {
  16. const tipParent = tipTitle.parentElement;
  17. if(tipParent.children[1].children[0].textContent.includes("ERROR")){
  18. console.log("Error Occured");
  19. tipTitle.children[0].click();
  20. }
  21. }
  22. },3000);
  23.  
  24. resolveError();
  25.  
  26. var lastHeight = 0;
  27. document.addEventListener('scroll', function(event){
  28. const btn = document.querySelector('[title="加载下一页"]');
  29. if(btn!=null){
  30. const rect = btn.getBoundingClientRect();
  31. if (window.scrollY+rect.top>lastHeight && rect.top < window.innerHeight + 100){
  32. lastHeight=window.scrollY+rect.top;
  33. btn.click();
  34. resolveError();
  35. console.log("Scroll",lastHeight)
  36. }
  37. }
  38. });
  39.  
  40. })();

QingJ © 2025

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