MCPcopy Index your code
hub / github.com/XIU2/UserScript / pausePageEvent

Function pausePageEvent

Autopage.user.js:2622–2635  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2620 }
2621 // 左键双击网页空白处暂停翻页
2622 function pausePageEvent() {
2623 if (!GM_getValue('menu_pause_page')) return
2624 if (curSite.SiteTypeID === 0) return
2625 if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
2626 document.body.addEventListener('dblclick', function () {
2627 if (pausePage) {GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});} else {GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});}
2628 if (document.querySelector('#Autopage_number')) { // 如果同时开启了左下角页码功能,则模拟点击(为了数字变成红色+斜体)
2629 document.querySelector('#Autopage_number').shadowRoot.querySelector('#Autopage_number_button').click();
2630 } else {
2631 pausePage = !pausePage;
2632 if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
2633 }
2634 });
2635 }
2636 // 自定义翻页规则
2637 function customRules() {
2638 if (getCSS('#Autopage_customRules')) return

Callers 2

getRulesUrl_Function · 0.85
Autopage.user.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected