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.
当前为
// ==UserScript==
// @name Auto Click "Show More..." Button
// @version 1.0
// @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.
// @namespace Goga)
// @match https://online-fix.me/*
// @run-at document-end
// @author Gleb237237
// @grant none
// @license MIT
// ==/UserScript==
(function() {
var showMoreButton = document.querySelector('.btn.btn-small.btn-success[onclick="ajax_show_more(); return false;"]');
var clicked = false;
function clickShowMoreButton() {
showMoreButton.click();
clicked = true;
setTimeout(function() {
clicked = false;
}, 2000);
}
function scrollHandler() {
if (!clicked && (window.innerHeight + window.scrollY) >= (document.body.offsetHeight - 500)) {
clickShowMoreButton();
}
}
window.addEventListener('scroll', scrollHandler);
})();