您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
清水河畔帖子详情页面下滑至底部自动翻页
当前为
// ==UserScript== // @name 清水河畔自动翻页 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 清水河畔帖子详情页面下滑至底部自动翻页 // @author Zhenger233 // @match http://bbs.uestc.edu.cn/forum.php?mod=viewthread* // @grant none // ==/UserScript== (function() { 'use strict'; var xmlhttp = new XMLHttpRequest(); var p = 2; var thisurl = window.location.href; var maxp = Math.ceil((Number(document.getElementsByClassName('xi1')[1].innerText) + 1) / 20); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('postlistreply').previousElementSibling.appendChild(new DOMParser().parseFromString(xmlhttp.responseText, 'text/html').getElementById('postlist')); } }; var mysend = function mysend() { console.log('send', p); if (p <= maxp) { xmlhttp.open('GET', thisurl + '&page=' + String(p++), false); xmlhttp.send(); } }; document.onscroll = function () { document.getElementById('postlistreply').getBoundingClientRect().y < 500 ? mysend():{}; }; // Your code here... })();