您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在漫畫閱讀頁面(Manhuagui & manhuaren),將右上角頁碼改為下拉選單,選取即跳轉到指定頁。
当前为
// ==UserScript== // @name 看漫畫&漫畫人 手機版 - 新增頁數跳轉功能 // @namespace http://tampermonkey.net/ // @version 1.2.2 // @description 在漫畫閱讀頁面(Manhuagui & manhuaren),將右上角頁碼改為下拉選單,選取即跳轉到指定頁。 // @author shanlan(ChatGPT GPT-5) // @match https://m.manhuagui.com/comic/* // @match https://www.manhuaren.com/* // @grant none // @run-at document-end // @license MIT // ==/UserScript== (function(){ 'use strict'; if(location.hostname.indexOf("manhuaren.com") !== -1){ const label = document.querySelector("#lbcurrentpage"); if(!label) return; const titleP = label.closest(".view-fix-top-bar-title"); if(!titleP) return; const m = titleP.textContent.match(/\/\s*(\d+)\s*$/); const total = m ? +m[1] : 0; if(!total) return; const current = parseInt(label.textContent,10) || 1; const s = document.createElement("select"); s.style.cssText = "font-size:15px;line-height:1;height:22px;vertical-align:middle;padding:0 6px;margin-right:2px;border:1px solid #ccc;border-radius:4px;background:#fff;"; for(let i=1;i<=total;i++) s.add(new Option(i, i)); s.value = current; s.onchange = () => { let v = +s.value; v = Math.max(1, Math.min(total, v)); label.textContent = v; const pm = location.pathname.match(/^\/m(\d+)(?:-p\d+)?\/?$/); if(pm){ const id = pm[1]; const path = v === 1 ? `/m${id}/` : `/m${id}-p${v}/`; location.href = location.origin + path + location.search; } else { location.reload(); } }; label.parentNode.insertBefore(s, label); label.style.display = "none"; return; } const $ = s => document.querySelector(s), init = () => { const n = $('#pageNo'), w = $('.manga-page'); if(!n || !w) return; const total = (w.textContent.match(/\/\s*(\d+)\s*P/i)||[])[1]|0; if(!total) return; const gh = () => { const m = location.hash.match(/(?:^|#|&)p=(\d+)/); return m ? +m[1] : NaN; }; const h = gh(), cur = Number.isInteger(h) ? h : (parseInt(n.textContent)||1); const s = document.createElement('select'); s.style.cssText = 'font-size:15px;line-height:1;height:22px;vertical-align:middle;padding:0 6px;margin-right:2px;border:1px solid #ccc;border-radius:4px;background:#fff;'; for(let i=1; i<=total; i++) s.add(new Option(i,i)); s.value = cur; s.onchange = () => { let v = +s.value; v = Math.max(1, Math.min(total, v)); n.textContent = v; const nh = '#p=' + v; if(location.hash === nh) dispatchEvent(new HashChangeEvent('hashchange')); else location.hash = nh; }; n.before(s); n.style.display = 'none'; const sync = () => { const x = gh(); if(!Number.isInteger(x)) return; const v = Math.max(1, Math.min(total, x)), t = String(v); if(s.value !== t) s.value = t; if(n.textContent !== t) n.textContent = t; }; addEventListener('hashchange', sync); sync(); }; document.readyState==='loading'? addEventListener('DOMContentLoaded', init, {once:true}) : init(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址