您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动加载页面
当前为
// ==UserScript== // @name 网络画板自动展开页面 // @namespace http://tampermonkey.net/ // @version 0.5 // @description 自动加载页面 // @author wuyudi/shigma // @match https://www.netpad.net.cn/personalCenter.html // @grant none // ==/UserScript== // thanks to https://github.com/Shigma // throttle 节流 // 使里面的函数两次调用的时间间隔不少于 1000ms // 能避免 client block // 那个 1000 可以调大,100 调小 (function () { const leaveHeight = 50; const waitTime = 1200; ("use strict"); function throttle(delay, callback) { let timeoutID; let lastExec = 0; function wrapper() { const self = this; const elapsed = Number(new Date()) - lastExec; const args = arguments; function exec() { lastExec = Number(new Date()); callback.apply(self, args); } clearTimeout(timeoutID); if (elapsed > delay) { exec(); } else { timeoutID = setTimeout(exec, delay - elapsed); } } return wrapper; } window.onscroll = throttle(waitTime, (ev) => { const el = document.querySelector(".loadMore"); if (!el) return; if (el.getBoundingClientRect().top <= innerHeight + leaveHeight) { document.querySelector(".loadMore").click(); } }); })();