NGA Auto Pager V2

NGA自动翻页插件

目前為 2017-10-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         NGA Auto Pager V2
// @version      1.03
// @description  NGA自动翻页插件
// @include      /^https?:\/\/(bbs\.ngacn\.cc|nga\.178\.com|bbs\.nga\.cn|bbs\.bigccq\.cn)\/(read\.php|thread\.php|wow|wow\/pvp|wow\/pve|wow\/rogue|wow\/druid|wow\/dk|wow\/mage|wow\/monk|wow\/priest|wow\/shaman|wow\/paladin|wow\/warrior|wow\/warlock|wow\/hunter|wow\/ui|wow\/lore|it|auto|ink|ng2|play|tvgame|wa2|wow\/justice|wow\/job|ccq|gw2|bns|heroes|lol|hs|wot|wowp|wows|jx3|coc|pad|d3|dota|wt|ff14|poi|gta|sc|ow|cr|king)/
// @author       Sunness
// @namespace https://greasyfork.org/users/63731
// ==/UserScript==

let threshold = 2400, delay = 1500, exist = true, running = false;

window.addEventListener('scroll', e => {
    if (exist && !running && (document.documentElement.scrollHeight - document.documentElement.scrollTop < threshold)) {
        running = true;
        let a = document.querySelector("a.uitxt1[title=加载下一页]");
        if (a !== null) {
            a.click();
            setTimeout(() => { running = false; }, delay);
        } else {
            exist = false;
        }
    }
});