您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
link the last image to next chapter.
当前为
// ==UserScript== // @name FZDM Chapter Portal // @namespace https://mutoo.im // @version 0.1.1 // @description link the last image to next chapter. // @author [email protected] // @match https://manhua.fzdm.com/* // @match https://manhua.fffdm.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function detectElement(selector, interval = 500, retry = 10) { return new Promise((resolve, reject) => { setTimeout(function detect() { let dom = document.querySelector(selector); if (dom) { resolve(dom); } else if (retry > 0) { setTimeout(detect, interval); retry -= 1; } else { reject(`can not found ${selector} on the page`); } }, interval); }); } Promise.all([ detectElement('.navigation > [href^="../"]', 500, 20), detectElement('#mhpic', 500, 20), ]) .then(([nextChapter, image]) => { image.style.cursor = "pointer"; image.addEventListener('click', () => {window.location.href = nextChapter.href;}); }, err => null); })();