Auto Click "Show More..." Button

This Tampermonkey script automatically clicks the "Show More..." button on the website https://online-fix.me/ before reaching the end of the page, and restarts after each click.

目前为 2023-04-19 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Click "Show More..." Button
  3. // @version 1.0
  4. // @description This Tampermonkey script automatically clicks the "Show More..." button on the website https://online-fix.me/ before reaching the end of the page, and restarts after each click.
  5. // @namespace Goga)
  6. // @match https://online-fix.me/*
  7. // @run-at document-end
  8. // @author Gleb237237
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. var showMoreButton = document.querySelector('.btn.btn-small.btn-success[onclick="ajax_show_more(); return false;"]');
  15. var clicked = false;
  16.  
  17. function clickShowMoreButton() {
  18. showMoreButton.click();
  19. clicked = true;
  20. setTimeout(function() {
  21. clicked = false;
  22. }, 2000);
  23. }
  24.  
  25. function scrollHandler() {
  26. if (!clicked && (window.innerHeight + window.scrollY) >= (document.body.offsetHeight - 500)) {
  27. clickShowMoreButton();
  28. }
  29. }
  30.  
  31. window.addEventListener('scroll', scrollHandler);
  32. })();