diff --git a/Autopage.user.js b/Autopage.user.js index 2bd6940b2..7062dbdb2 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -3,7 +3,7 @@ // @name:zh-CN 自动无缝翻页 // @name:zh-TW 自動無縫翻頁 // @name:ru Автостраничник -// @version 6.6.74 +// @version 6.6.75 // @author X.I.U // @description ⭐Append the next page content to the bottom seamlessly (like a waterfall, Unlimited scrolling, no need to manually click on the next page) ⭐, support various forums, social networking, games, comics, novels, academics, search engines (Google, Bing, Yahoo...) and other websites~ // @description:zh-CN ⭐无缝加载 下一页内容 至网页底部(类似瀑布流,无限滚动,无需手动点击下一页)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、MyBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、NGA、V2EX、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、动漫屋、漫画猫、漫画屋、漫画 DB、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分常见网站,更多的写不下了... @@ -327,7 +327,9 @@ } - if (getCSS('a.next, a.next-page')) { + if (getCSS('a.next.page-numbers, a.next-page.page-numbers')) { + DBSite.wp_article.pager.nextL = 'a.next.page-numbers, a.next-page.page-numbers' + } else if (getCSS('a.next, a.next-page')) { DBSite.wp_article.pager.nextL = 'a.next, a.next-page' } else if (getCSS('a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]')) { DBSite.wp_article.pager.nextL = 'a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]' @@ -565,6 +567,9 @@ function: { url: ()=> { if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) { curSite = DBSite.wp_article; + if (!getCSS(DBSite.wp_article.pager.replaceE)){ // 如果没找到常见的页码父元素,则删除 replaceE 让脚本自行判断 + delete curSite.pager.replaceE + } // 自适应瀑布流样式 setTimeout(()=>{if (getOne(curSite.pager.pageE).style.cssText.indexOf('position: absolute') != -1){insStyle(curSite.pager.pageE + '{position: static !important; float: left !important; height: '+ parseInt(getCSS(curSite.pager.pageE).offsetHeight * 1.1) + 'px !important;}');}}, 1500); } diff --git a/DarkMode.user.js b/DarkMode.user.js index 95ef28c95..bc83ea2f7 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -3,7 +3,7 @@ // @name:zh-CN 护眼模式 // @name:zh-TW 護眼模式 // @name:ru Тёмный режим -// @version 1.5.6 +// @version 1.5.8 // @author X.I.U // @description Simple and effective network-wide eye protection mode (night mode, dark mode, black mode) // @description:zh-CN 简单有效的全网通用护眼模式(夜间模式、暗黑模式、深色模式) @@ -441,14 +441,14 @@ clearInterval(timer); // 取消定时器(每 5 毫秒一次的) setTimeout(function(){ // 为了避免太快 body 的 CSS 还没加载上,先延迟 150 毫秒(缺点就是可能会出现短暂一闪而过的暗黑滤镜) console.log('[护眼模式] html:', window.getComputedStyle(document.lastElementChild).backgroundColor, 'body:', window.getComputedStyle(document.body).backgroundColor) - if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgba(0, 0, 0, 0)' && !(document.querySelector('head>meta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches)) { - // 如果 body 没有 CSS 背景颜色(或是在资源页 且 浏览器为白天模式),那就需要添加一个背景颜色,否则影响滤镜效果 + if (!(checkChallenge()) && window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgba(0, 0, 0, 0)' && !(document.querySelector('head>meta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches)) { + // 如果不是在 (CF CDN 的人机验证页面 且 浏览器为暗黑模式) 或 body 没有 CSS 背景颜色(或是在资源页 且 浏览器为白天模式),那就需要添加一个背景颜色,否则影响滤镜效果 let style_Add2 = document.createElement('style'); style_Add2.id = 'XIU2DarkMode2'; document.lastElementChild.appendChild(style_Add2).textContent = style_00; - } else if ((document.querySelector('head>meta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches) || (document.querySelector('html[class*=dark], html[data-dark-theme*=dark], html[data-theme*=dark], html[data-color-mode*=dark], body[class*=dark]')) || (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)') || (getColorValue(document.body) > 0 && getColorValue(document.body) < 898989) || (getColorValue(document.lastElementChild) > 0 && getColorValue(document.lastElementChild) < 898989) || (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgb(0, 0, 0)')) { - // 如果是在资源页 且 浏览器为暗黑模式,或 html/body 元素包含 dark 标识,或底色为黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 + } else if (checkChallenge() || (document.querySelector('head>meta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches) || (document.querySelector('html[class*=dark], html[data-dark-theme*=dark], html[data-theme*=dark], html[data-color-mode*=dark], body[class*=dark]')) || (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)') || (getColorValue(document.body) > 0 && getColorValue(document.body) < 898989) || (getColorValue(document.lastElementChild) > 0 && getColorValue(document.lastElementChild) < 898989) || (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgb(0, 0, 0)')) { + // 如果是在 (CF CDN 的人机验证页面 且 浏览器为暗黑模式) 或 (资源页 且 浏览器为暗黑模式),或 html/body 元素包含 dark 标识,或底色为黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) for (let i=0;imeta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches) || (document.querySelector('html[class*=dark], html[data-dark-theme*=dark], html[data-theme*=dark], html[data-color-mode*=dark], body[class*=dark]')) || (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)') || (getColorValue(document.body) > 0 && getColorValue(document.body) < 898989) || (getColorValue(document.lastElementChild) > 0 && getColorValue(document.lastElementChild) < 898989) || (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgb(0, 0, 0)')) { - // 如果是在资源页 且 浏览器为暗黑模式,或 html/body 元素包含 dark 标识,或底色为黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 + if (checkChallenge() || (document.querySelector('head>meta[name="color-scheme"],head>link[href^="resource:"]') && window.matchMedia('(prefers-color-scheme: dark)').matches) || (document.querySelector('html[class*=dark], html[data-dark-theme*=dark], html[data-theme*=dark], html[data-color-mode*=dark], body[class*=dark]')) || (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)') || (getColorValue(document.body) > 0 && getColorValue(document.body) < 898989) || (getColorValue(document.lastElementChild) > 0 && getColorValue(document.lastElementChild) < 898989) || (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastElementChild).backgroundColor === 'rgb(0, 0, 0)')) { + // 如果是在 (CF CDN 的人机验证页面 且 浏览器为暗黑模式) 或 (资源页 且 浏览器为暗黑模式),或 html/body 元素包含 dark 标识,或底色为黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) for (let i=0;imeta[content*="https://challenges.cloudflare.com"]') && document.querySelector('body>script[nonce]')) + } + // 获取背景颜色值 function getColorValue(e) { let rgbValueArry = window.getComputedStyle(e).backgroundColor.replace(/rgba|rgb|\(|\)| /g, '').split (',') diff --git a/other/Autopage/rules.json b/other/Autopage/rules.json index af95f717a..c5c32cd15 100644 --- a/other/Autopage/rules.json +++ b/other/Autopage/rules.json @@ -1191,6 +1191,16 @@ "replaceE": ".pagination:not(#breadcrumb_multipage_popup)" } }, + "kaspersky 论坛": { + "host": "forum.kaspersky.com", + "url": "/^\\/forum\\//", + "blank": 3, + "pager": { + "nextL": ".ipsPagination_next>a", + "pageE": ".ipsDataItem", + "replaceE": "div[data-role=tablePagination]>.ipsPagination" + } + }, "ptt.cc": { "host": "www.ptt.cc", "url": "/^\\/bbs\\/.+\\/index/", @@ -6161,6 +6171,16 @@ "replaceE": ".pages" } }, + "2048 论坛": { + "host": "hjd2048.com", + "url": "/\\/thread\\.php/", + "style": "tr[onmouseover]", + "pager": { + "nextL": ".pages>b+a", + "pageE": "#ajaxtable>tbody[style]>tr", + "replaceE": ".pages" + } + }, "M系镜像": { "host": "mirror.chromaso.net", "url": "if(fun.indexOF(/^\\/thread\\/.+/)){rule.thread=true;rule.pager.pageE='.container>.mm-post';return true;}else if(fun.indexOF(/^\\/(forum|search)\\/.+/)){rule.blank=3;return true;}",