From c398a6aa70c01df033bdd596c2f0d72a750c566f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:49:09 +0800 Subject: [PATCH 0001/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Pixiv]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81;=20=E6=9B=B4=E6=96=B0=20[Github=20-=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5]=20=E8=A7=84=E5=88=99;=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20[Flarum]=20=E8=A7=84=E5=88=99;=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 753 ++++++++++++++++++++++++++--------------------- 1 file changed, 413 insertions(+), 340 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 7b1b6bc5b..107de1877 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.5.6 +// @version 3.5.7 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -100,6 +100,10 @@ 5 = 插入 iframe 方式来加载下一页 insStyle: 加载 iframe 前要插入的 CSS Style 样式 iframe: 这个必须加到 page{} 外面 + forceTarget:强制新标签页打开链接 + 6 = 通过 iframe 获取下一页动态加载内容 + loadTime: 预留的网页加载时间,确保网页加载完成 + forceTarget:强制新标签页打开链接 nextL: 下一页链接所在元素 pageE: 要获取的主体内容 insertP: 主体内容插入的位置 @@ -200,20 +204,20 @@ } }, // Discuz! 论坛 - 淘帖页 flarum: { - functionStart: function() {locationChange = true;if (location.pathname.indexOf('/d/') === -1) {curSite = DBSite.flarum;}}, + functionStart: function() {locationChange = true;if (!indexOF('/d/')) {curSite = DBSite.flarum;}}, pager: { type: 2, - nextL: 'css;.DiscussionList-loadMore > button[title]', - interval: 500, + nextL: 'css;.DiscussionList-loadMore > button', + isHidden: true, scrollD: 1000 } }, // Flarum 论坛 phpbb: { - functionStart: function() {if (location.pathname.indexOf('/viewforum.php') > -1) { + functionStart: function() {if (indexOF('/viewforum.php')) { curSite = DBSite.phpbb; - } else if (location.pathname.indexOf('/viewtopic.php') > -1 && GM_getValue('menu_discuz_thread_page')) { + } else if (indexOF('/viewtopic.php') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.phpbb_post; - } else if (location.pathname.indexOf('/search.php') > -1) { + } else if (indexOF('/search.php')) { curSite = DBSite.phpbb_search; }}, pager: { @@ -246,11 +250,11 @@ } }, // phpBB 论坛 - 搜索页 xenforo: { - functionStart: function() {if (location.pathname.indexOf('/forums/') > -1 || location.pathname.indexOf('/f/') > -1) { + functionStart: function() {if (indexOF('/forums/') || indexOF('/f/')) { curSite = DBSite.xenforo; - } else if ((location.pathname.indexOf('/threads/') > -1 || location.pathname.indexOf('/t/') > -1) && GM_getValue('menu_discuz_thread_page')) { + } else if ((indexOF('/threads/') || indexOF('/t/')) && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.xenforo_post; - } else if (location.pathname.indexOf('/search/') > -1) { + } else if (indexOF('/search/')) { curSite = DBSite.xenforo_search; }}, pager: { @@ -283,9 +287,9 @@ } }, // XenForo 论坛 - 搜索页 xiuno: { - functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/index') > -1 || location.pathname.indexOf('/forum') > -1) { + functionStart: function() {if (location.pathname === '/' || indexOF('/index') || indexOF('/forum')) { curSite = DBSite.xiuno; - } else if (location.pathname.indexOf('/thread') > -1 && GM_getValue('menu_discuz_thread_page')) { + } else if (indexOF('/thread') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.xiuno_post; if (getCSS('ul.postlist > li.newpost')) curSite.pager.insertP = ['(//ul[contains(@class, "postlist")][./li[contains(@class, "newpost")]])[last()]', 1]; // 有的带回复框,需要插入到前面 }}, @@ -309,7 +313,7 @@ } }, // Xiuno 论坛 - 帖子内 dux: { - functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;}, + functionStart: function() {if (!indexOF('.html')) curSite = DBSite.dux;}, host: 'www.puresys.net', pager: { type: 1, @@ -325,7 +329,7 @@ } }, // WordPress 的 DUX、XIU、D8 主题 begin: { - functionStart: function() {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.begin_search;} else if (location.pathname.indexOf('.html') === -1) {curSite = DBSite.begin;}}, + functionStart: function() {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.begin_search;} else if (!indexOF('.html')) {curSite = DBSite.begin;}}, pager: { type: 2, nextL: 'css;div[id^="ias_trigger_"]', @@ -369,7 +373,7 @@ }, // 百度 搜素 google: { host: /\.google\./, - functionStart: function() {if (location.pathname === '/search' && location.search.indexOf('tbm=isch') === -1) { + functionStart: function() {if (location.pathname === '/search' && !indexOF('tbm=isch', 's')) { curSite = DBSite.google; } else if (location.pathname === '/scholar') { curSite = DBSite.google_scholar; @@ -483,7 +487,7 @@ }, // DuckDuckGo 搜索 startpage: { host: ['startpage.com', 'www.startpage.com'], - functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.startpage;}}, + functionStart: function() {if (indexOF('/search')) {curSite = DBSite.startpage;}}, pager: { type: 1, nextL: startpage_nextL, @@ -507,7 +511,7 @@ }, // Yandex 搜索 yahoo: { host: 'search.yahoo.com', - functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo;}}, + functionStart: function() {if (indexOF('/search')) {curSite = DBSite.yahoo;}}, pager: { type: 1, nextL: 'css;.pagination a.next', @@ -519,7 +523,7 @@ }, // Yahoo 搜索 yahoo_jp: { host: 'search.yahoo.co.jp', - functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo_jp;}}, + functionStart: function() {if (indexOF('/search')) {curSite = DBSite.yahoo_jp;}}, pager: { type: 1, nextL: 'css;.Pagenation__next > a', @@ -531,7 +535,7 @@ }, // Yahoo 搜索 (JP) qwant: { host: 'www.qwant.com', - functionStart: function() {locationChange = true; if (location.search.indexOf('q=') > -1 && location.search.indexOf('t=web') > -1) {curSite = DBSite.qwant;}}, + functionStart: function() {locationChange = true; if (indexOF('q=', 's') && indexOF('t=web', 's')) {curSite = DBSite.qwant;}}, pager: { type: 2, nextL: 'css;button[data-testid="buttonShowMore"]', @@ -566,7 +570,7 @@ functionStart: function() {if (location.pathname === '/f') { baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题) curSite = DBSite.baidu_tieba; - } else if (location.pathname.indexOf('/p/') > -1 && GM_getValue('menu_discuz_thread_page')) { + } else if (indexOF('/p/') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.baidu_tieba_post; } else if (location.pathname === '/f/search/res') { curSite = DBSite.baidu_tieba_search; @@ -581,7 +585,7 @@ insertE: baidu_tieba_insertE, replaceE: 'css;#frs_list_pager', interval: 2000, - scrollD: 2000 + scrollD: 2500 }, function: { bF: src_bF, @@ -591,6 +595,7 @@ baidu_tieba_post: { insStyle: '.d_sign_split, img.j_user_sign, .d_author .d_pb_icons, .save_face_bg, .save_face_bg_2, li.d_name a.icon_tbworld, .lzl_cnt a.icon_tbworld, .topic_list_box.topic-fixed {display: none !important;} a.p_author_face.j_frame_guide {background: none repeat scroll 0 0 #FFF !important;border: 1px solid #CCC !important;padding: inherit !important;} .red_text, .red-text, .vip_red, .vip-red, .vip_red:hover, .vip-red:hover, .vip_red:visited, .vip-red:visited {color: #2d64b3 !important;}', // 签名、印记、头像边框、VIP 元素 hiddenPN: true, + forceTarget: true, pager: { type: 5, nextL: '//li[contains(@class,"pb_list_pager")]/a[contains(text(),"下一页")]', @@ -611,13 +616,13 @@ }, // 百度贴吧 - 搜索页 douban_subject_comments: { host: 'movie.douban.com', - functionStart: function() {if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { + functionStart: function() {if (indexOF('/subject') && indexOF('/comments')) { curSite = DBSite.douban_subject_comments; - } else if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/reviews') > -1) { + } else if (indexOF('/subject') && indexOF('/reviews')) { curSite = DBSite.douban_subject_reviews; - } else if(location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/episode') > -1 || location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/tv_discuss') > -1) { + } else if(indexOF('/subject') && indexOF('/episode') || indexOF('/subject') && indexOF('/tv_discuss')) { curSite = DBSite.douban_subject_episode; - } else if(location.pathname.indexOf('/people') > -1 && location.pathname.indexOf('/collect') > -1) { // 看过的电影 + } else if(indexOF('/people') && indexOF('/collect')) { // 看过的电影 curSite = DBSite.douban_people_collect; }}, pager: { @@ -661,11 +666,11 @@ }, // 豆瓣 - 看过的电影 douban_group: { host: 'www.douban.com', - functionStart: function() {if (location.pathname.indexOf('/group/topic/') > -1) { + functionStart: function() {if (indexOF('/group/topic/')) { curSite = DBSite.douban_group_topic; - } else if (location.pathname.indexOf('/group/explore') > -1) { + } else if (indexOF('/group/explore')) { curSite = DBSite.douban_group_explore; - } else if (location.pathname.indexOf('/group/') > -1 && location.pathname.indexOf('/discussion') > -1) { + } else if (indexOF('/group/') && indexOF('/discussion')) { curSite = DBSite.douban_group; }}, pager: { @@ -708,9 +713,9 @@ }, // 微博评论 tianya: { host: 'bbs.tianya.cn', - functionStart: function() {if (location.pathname.indexOf('/list') > -1) { + functionStart: function() {if (indexOF('/list')) { curSite = DBSite.tianya; - } else if (location.pathname.indexOf('/post') > -1) { + } else if (indexOF('/post')) { curSite = DBSite.tianya_post; }}, pager: { @@ -777,10 +782,10 @@ v2ex_aF('#Main a[href^="/t/"]:not([target])'); } else if (location.pathname === '/balance') { curSite = DBSite.v2ex_balance; - } else if (location.pathname.indexOf('/go/') > -1) { + } else if (indexOF('/go/')) { curSite = DBSite.v2ex_go; v2ex_aF('#Main a.topic-link:not([target])'); - } else if (location.pathname.indexOf('/replies') > -1) { + } else if (indexOF('/replies')) { curSite = DBSite.v2ex_replies; v2ex_aF('#Main a[href^="/t/"]:not([target])'); }}, @@ -851,7 +856,7 @@ }, // V2EX - 账户余额页 jandan: { host: 'jandan.net', - functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/page/') > -1) { + functionStart: function() {if (location.pathname === '/' || indexOF('/page/')) { curSite = DBSite.jandan; } else if (location.pathname === '/dzh') { curSite = DBSite.jandan_dzh; @@ -897,7 +902,7 @@ functionStart: function() {insStyle('.qrcode-wrap, .qrcode-wrap-img, .index-side-left-AD1 {display: none !important;}'); if (location.pathname === '/') { curSite = DBSite.qiushibaike; - } else if (location.pathname.indexOf('/article/') === -1) { + } else if (!indexOF('/article/')) { curSite = DBSite.qiushibaike_; }}, pager: { @@ -921,9 +926,9 @@ }, // 糗事百科 - 分类页 lkong: { host: 'www.lkong.com', - functionStart: function() {if (location.pathname.indexOf('/forum/') > -1) { + functionStart: function() {if (indexOF('/forum/')) { curSite = DBSite.lkong; - } else if (location.pathname.indexOf('/thread/') > -1) { + } else if (indexOF('/thread/')) { curSite = DBSite.lkong_thread; }}, pager: { @@ -949,9 +954,9 @@ }, // 龙的天空 - 帖子内 pediy_forum: { host: 'bbs.pediy.com', - functionStart: function() {if (location.pathname.indexOf('/forum-') > -1) { + functionStart: function() {if (indexOF('/forum-')) { curSite = DBSite.pediy_forum; - } else if (location.pathname.indexOf('/thread-') > -1) { + } else if (indexOF('/thread-')) { if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.pediy_thread;} }}, pager: { @@ -976,9 +981,9 @@ bangumitv: { host: 'bangumi.tv', functionStart: function() { - if (location.pathname.indexOf('/browser') > -1 || location.pathname.indexOf('/subject_search') > -1) { + if (indexOF('/browser') || indexOF('/subject_search')) { curSite = DBSite.bangumitv; - } else if (location.pathname.indexOf('/forum') > -1) { + } else if (indexOF('/forum')) { curSite = DBSite.bangumitv_forum; }}, pager: { @@ -1003,9 +1008,9 @@ kdslife: { host: 'club.kdslife.com', functionStart: function() { - if (location.pathname.indexOf('/f_') > -1) { + if (indexOF('/f_')) { curSite = DBSite.kdslife; - } else if (location.pathname.indexOf('/t_') > -1) { + } else if (indexOF('/t_')) { curSite = DBSite.kdslife_t; }}, pager: { @@ -1031,13 +1036,13 @@ libaclub: { host: 'www.libaclub.com', functionStart: function() { - if (location.pathname === '/' || location.pathname.indexOf('/date_') > -1) { + if (location.pathname === '/' || indexOF('/date_')) { curSite = DBSite.libaclub; - } else if (location.pathname.indexOf('/f_') > -1) { + } else if (indexOF('/f_')) { curSite = DBSite.libaclub_f; - } else if (location.pathname.indexOf('/t_') > -1 || location.pathname.indexOf('/reply_') > -1) { + } else if (indexOF('/t_') || indexOF('/reply_')) { curSite = DBSite.libaclub_t; - } else if (location.pathname.indexOf('/prt_') > -1) { + } else if (indexOF('/prt_')) { curSite = DBSite.libaclub_prt; } else if (location.pathname === '/facade.php') { curSite = DBSite.libaclub_search; @@ -1099,9 +1104,9 @@ taoguba: { host: 'www.taoguba.com.cn', functionStart: function() {insStyle('#joinTGB {display: none !important;}') - if (location.pathname.indexOf('/Article/') > -1) { + if (indexOF('/Article/')) { curSite = DBSite.taoguba_t; - } else if (location.pathname.indexOf('/shenghuoba/') > -1) { + } else if (indexOF('/shenghuoba/')) { curSite = DBSite.taoguba_; } else if (/\/bbs|zongban|dianzan|jinghua\//.test(location.pathname)) { curSite = DBSite.taoguba; @@ -1174,7 +1179,7 @@ }, // LowEndTalk lieyou: { host: 'bbs.lieyou888.com', - functionStart: function() {if (location.pathname.indexOf('/forum') > -1) {curSite = DBSite.lieyou;}}, + functionStart: function() {if (indexOF('/forum')) {curSite = DBSite.lieyou;}}, pager: { type: 1, nextL: '//div[contains(@class, "_pageNav")]/a[contains(text(), "下一页")]', @@ -1202,9 +1207,9 @@ }, // 爱卡汽车网论坛 - 各版块帖子列表 flyert_forumdisplay: { host: 'www.flyert.com', - functionStart: function() {if (location.pathname.indexOf('/forum-') > -1 || location.search.indexOf('mod=forumdisplay') > -1) { + functionStart: function() {if (indexOF('/forum-') || indexOF('mod=forumdisplay', 's')) { curSite = DBSite.flyert_forumdisplay; - } else if (location.pathname.indexOf('/forum') > -1 || location.search.indexOf('mod=viewthread') > -1) { + } else if (indexOF('/forum') || indexOF('mod=viewthread', 's')) { if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;} }}, pager: { @@ -1229,13 +1234,13 @@ adnmb3: { host: ['adnmb3.com', 'www.tnmb.org'], functionStart: function() { - if (location.pathname.indexOf('/m/f/') > -1) { + if (indexOF('/m/f/')) { curSite = DBSite.adnmb3_mf; - } else if (location.pathname.indexOf('/m/t/') > -1) { + } else if (indexOF('/m/t/')) { curSite = DBSite.adnmb3_mt; - } else if (location.pathname.indexOf('/f/') > -1 || location.pathname.indexOf('/Forum/') > -1) { + } else if (indexOF('/f/') || indexOF('/Forum/')) { curSite = DBSite.adnmb3; - } else if (location.pathname.indexOf('/t/') > -1) { + } else if (indexOF('/t/')) { curSite = DBSite.adnmb3_t; }}, pager: { @@ -1317,24 +1322,49 @@ scrollD: 1500 } }, // IT 之家 - /*pixiv: { + pixiv: { host: 'www.pixiv.net', - functionStart: function() {if (location.pathname.indexOf('/tags/') > -1) {curSite = DBSite.pixiv;}}, - hiddenPN: true, + functionStart: function() { + if (indexOF('/tags/') && self == top) { + curSite = DBSite.pixiv; + } else if (indexOF('/users/') && /\/(artworks|illustrations|manga)/.test(location.pathname)) { + curSite = DBSite.pixiv_user; + } else if (indexOF('/artworks/')) { + setTimeout(function(){getXpath('//button[contains(string(), "查看全部") or contains(string(), "See all") or contains(string(), "すべて見る") or contains(string(), "모두 보기")]').click();}, 1000) + } + }, + forceTarget: true, iframe: true, + insStyle: 'div[class*="-0 "] > div[class*="-4 "] > section:first-of-type {display: none}', + pager: { + type: 6, + nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', + pageE: '//ul[contains(@class, "-1 ")]/li', + insertP: ['//ul[contains(@class, "-1 ")]', 3], + replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + loadTime: 1000, + scrollD: 1000 + } + }, // Pixiv - 分类页 + pixiv_user: { + forceTarget: true, + hiddenPN: true, pager: { type: 5, - nextL: '//a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")][@href][last()]', - scrollD: 2500 + nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', + pageE: '//ul[contains(@class, "-1 ")]/li', + insertP: ['//ul[contains(@class, "-1 ")]', 3], + replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + scrollD: 2000 } - },*/ // Pixiv + }, // Pixiv - 用户作品页 _58pic: { host: 'www.58pic.com', functionStart: function() {insStyle('.qt-model-t.login-model {display: none !important;}'); - if (location.pathname.indexOf('/tupian/') > -1 || location.pathname.indexOf('/piccate/') > -1) { + if (indexOF('/tupian/') || indexOF('/piccate/')) { curSite = DBSite._58pic; - if (location.pathname.indexOf('/piccate/') > -1 && getCSS('.card-grid-box .qt-card-box[style*="width:"]')) insStyle('.card-grid-box .qt-card-box {display: block;height: 300px;min-height: 250px;}') - } else if (location.pathname.indexOf('/c/') > -1) { + if (indexOF('/piccate/') && getCSS('.card-grid-box .qt-card-box[style*="width:"]')) insStyle('.card-grid-box .qt-card-box {display: block;height: 300px;min-height: 250px;}') + } else if (indexOF('/c/')) { curSite = DBSite._58pic_c; }}, insStyle: '.qtw-card.place-box, .card-lazy, .is-line .is-back {display: none !important;}', @@ -1414,7 +1444,7 @@ }, // Pixabay logosc: { host: 'www.logosc.cn', - functionStart: function() {if (location.pathname.indexOf('/so/') > -1) {curSite = DBSite.logosc;}}, + functionStart: function() {if (indexOF('/so/')) {curSite = DBSite.logosc;}}, pager: { type: 2, nextL: 'css;button.so-pablo-button', @@ -1461,7 +1491,7 @@ } } else if (getCSS('body#nv_forum.pg_viewthread') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.xuexiniu_thread; - } else if (location.pathname.indexOf('/search.php') > -1) { + } else if (indexOF('/search.php')) { curSite = DBSite.xuexiniu_search; } else { curSite = DBSite.xuexiniu; @@ -1538,7 +1568,7 @@ curSite = DBSite._3dmgame_list; } else if (getCSS('.newsleft > ul')) { curSite = DBSite._3dmgame_list2; - } else if (location.pathname.indexOf('/resource') > -1) { + } else if (indexOF('/resource')) { curSite = DBSite._3dmgame_list3; } else { curSite = DBSite._3dmgame; @@ -1659,7 +1689,7 @@ }, // 游侠网 - 图库 gamersky_ent: { host: 'www.gamersky.com', - functionStart: function() {if (location.pathname.indexOf('/ent/') > -1) {curSite = DBSite.gamersky_ent;} else {curSite = DBSite.gamersky_gl;}}, + functionStart: function() {if (indexOF('/ent/')) {curSite = DBSite.gamersky_ent;} else {curSite = DBSite.gamersky_gl;}}, pager: { type: 3, nextL: '//div[@class="page_css"]/a[text()="下一页"]', @@ -1710,7 +1740,7 @@ }, // CurseForge steamcommunity: { host: 'steamcommunity.com', - functionStart: function() {if (location.pathname.indexOf('/workshop/browse') > -1) {curSite = DBSite.steamcommunity;}}, + functionStart: function() {if (indexOF('/workshop/browse')) {curSite = DBSite.steamcommunity;}}, pager: { type: 1, nextL: '//a[@class="pagebtn"][last()]', @@ -1840,7 +1870,7 @@ }, // 茶杯狐 novipnoad: { host: 'www.novipnoad.com', - functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('.html') === -1) {curSite = DBSite.novipnoad;}}, + functionStart: function() {if (location.pathname != '/' && !indexOF('.html')) {curSite = DBSite.novipnoad;}}, pager: { type: 1, nextL: 'css;a.nextpostslink', @@ -1856,7 +1886,7 @@ }, // NO视频 ddrk: { host: ['ddrk.me', 'ddys.tv'], - functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1 || location.pathname.indexOf('/tag/') > -1) {curSite = DBSite.ddrk;}}, + functionStart: function() {if (location.pathname === '/' || indexOF('/category/') || indexOF('/tag/')) {curSite = DBSite.ddrk;}}, pager: { type: 1, nextL: 'css;a.next', @@ -1868,7 +1898,7 @@ }, // 低端影视 nfmovies: { host: 'www.nfmovies.com', - functionStart: function() {if (location.pathname === '/search.php' || location.pathname.indexOf('/list/') > -1) {curSite = DBSite.nfmovies;}}, + functionStart: function() {if (location.pathname === '/search.php' || indexOF('/list/')) {curSite = DBSite.nfmovies;}}, pager: { type: 1, nextL: '//ul[contains(@class, "myui-page")]/li/a[contains(text(), "下一页")]', @@ -1884,7 +1914,7 @@ }, // 奈菲影视 zxzj: { host: 'www.zxzj.me', - functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('/detail/') === -1 && location.pathname.indexOf('/video/') === -1) {curSite = DBSite.zxzj;}}, + functionStart: function() {if (location.pathname != '/' && !indexOF('/detail/') && !indexOF('/video/')) {curSite = DBSite.zxzj;}}, insStyle: 'div.stui-page__all {display: none !important;}', pager: { type: 1, @@ -1901,7 +1931,7 @@ }, // 在线之家 enlienli: { host: 'enlienli.com', - functionStart: function() {if (location.pathname.indexOf('/show/') > -1 || location.pathname.indexOf('/search') > -1) {curSite = DBSite.enlienli;}}, + functionStart: function() {if (indexOF('/show/') || indexOF('/search')) {curSite = DBSite.enlienli;}}, pager: { type: 1, nextL: 'css;a.page-number.page-next', @@ -1917,7 +1947,7 @@ }, // 嗯哩嗯哩 _91mjw: { host: '91mjw.com', - functionStart: function() {if (location.pathname.indexOf('/video/') === -1 || location.pathname.indexOf('/vplay/') === -1) {curSite = DBSite._91mjw;}}, + functionStart: function() {if (!indexOF('/video/') || !indexOF('/vplay/')) {curSite = DBSite._91mjw;}}, pager: { type: 1, nextL: 'css;.next-page > a', @@ -1933,7 +1963,7 @@ }, // 91 美剧网 zhenbuka: { host: ['www.zhenbuka3.com', 'www.zhenbuka5.com'], - functionStart: function() {if (location.pathname.indexOf('/vodtype/') > -1) {curSite = DBSite.zhenbuka;}}, + functionStart: function() {if (indexOF('/vodtype/')) {curSite = DBSite.zhenbuka;}}, pager: { type: 1, nextL: '//ul[contains(@class, "stui-page")]/li/a[contains(text(), "下一页")]', @@ -1950,9 +1980,9 @@ zzzfun: { host: 'www.zzzfun.com', functionStart: function() { - if (location.pathname.indexOf('/vod_type') > -1 || location.pathname.indexOf('/vod_show') > -1) { + if (indexOF('/vod_type') || indexOF('/vod_show')) { curSite = DBSite.zzzfun; - } else if (location.pathname.indexOf('/vod_search') > -1) { + } else if (indexOF('/vod_search')) { curSite = DBSite.zzzfun_search; }}, pager: { @@ -1984,9 +2014,9 @@ }, // ZzzFun 动漫 - 搜索页 tucao: { host: 'www.tucao.one', - functionStart: function() {if (location.pathname.indexOf('/list/') > -1) { + functionStart: function() {if (indexOF('/list/')) { curSite = DBSite.tucao; - } else if (location.search.indexOf('search') > -1) { + } else if (indexOF('search', 's')) { curSite = DBSite.tucao_search; }}, pager: { @@ -2010,7 +2040,7 @@ }, // 吐槽弹幕网 - 搜索页 mandao: { host: 'www.mandao.tv', - functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('/man') === -1) { + functionStart: function() {if (location.pathname != '/' && !indexOF('/man')) { curSite = DBSite.mandao; }}, pager: { @@ -2028,7 +2058,7 @@ }, // 漫岛动漫 yxdm: { host: 'www.yxdm.li', - functionStart: function() {if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/category') > -1) {curSite = DBSite.yxdm;}}, + functionStart: function() {if (indexOF('/search') || indexOF('/category')) {curSite = DBSite.yxdm;}}, pager: { type: 1, nextL: '//a[@class="nextPage" or contains(text(), "下一页")]', @@ -2040,7 +2070,7 @@ }, // 怡萱动漫 nicotv: { host: 'www.nicotv.me', - functionStart: function() {if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/type') > -1) {curSite = DBSite.nicotv;}}, + functionStart: function() {if (indexOF('/search') || indexOF('/type')) {curSite = DBSite.nicotv;}}, pager: { type: 1, nextL: '//ul[contains(@class, "pagination ")]//a[contains(text(), "»")]', @@ -2056,7 +2086,7 @@ }, // 妮可动漫 yhdm: { host: 'www.imomoe.la', - functionStart: function() {if (location.pathname.indexOf('/list/') > -1) { + functionStart: function() {if (indexOF('/list/')) { curSite = DBSite.yhdm; } else if (location.pathname === '/so.asp' || location.pathname === '/search.asp') { curSite = DBSite.yhdm_; @@ -2082,7 +2112,7 @@ }, // 樱花动漫 - 搜索页等 agefans: { host: 'www.agefans.cc', - functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/search') { + functionStart: function() {if (indexOF('/catalog/') || location.pathname === '/search') { curSite = DBSite.agefans; } else if (location.pathname === '/recommend' || location.pathname === '/update') { curSite = DBSite.agefans_; @@ -2120,7 +2150,7 @@ }, // AGE 动漫 - 排行榜 dm233: { host: 'www.dm233.cc', - functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/recommend/' || location.pathname === '/search') { + functionStart: function() {if (indexOF('/catalog/') || location.pathname === '/recommend/' || location.pathname === '/search') { curSite = DBSite.dm233; } else if (location.pathname === '/article/') { curSite = DBSite.dm233_article; @@ -2158,7 +2188,7 @@ }, // 233 动漫 - 排行榜 anime1: { host: 'anime1.me', - functionStart: function() {if (location.search.indexOf('s=') > -1) { + functionStart: function() {if (indexOF('s=', 's')) { curSite = DBSite.anime1_search; } else if (location.pathname === '/') { curSite = DBSite.anime1; @@ -2225,7 +2255,7 @@ yyds: { host: 'yyds.fans', functionStart: function() { - if (location.search != '' && location.search.indexOf('p=') === -1) { + if (location.search != '' && !indexOF('p=', 's')) { curSite = DBSite.yyds; }}, pager: { @@ -2338,9 +2368,9 @@ }, // RARBG subdh: { host: 'subdh.com', - functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/list/new') > -1) { + functionStart: function() {if (location.pathname === '/' || indexOF('/list/new')) { curSite = DBSite.subdh; - } else if (location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/search')) { curSite = DBSite.subdh_search; }}, pager: { @@ -2376,7 +2406,7 @@ }, // MINI4K bthaha: { host: /bthaha/, - functionStart: function() {if (location.pathname.indexOf('/search/') > -1) { + functionStart: function() {if (indexOF('/search/')) { curSite = DBSite.bthaha; getAllCSS('[id^="list_top"], [id^="list_bottom"]').forEach(function (one) {one.parentElement.parentElement.hidden = true;}); }}, @@ -2395,7 +2425,7 @@ }, // BTHaha a4k: { host: 'www.a4k.net', - functionStart: function() {if (location.pathname.indexOf('/subtitle/') === -1) {curSite = DBSite.a4k;};}, + functionStart: function() {if (!indexOF('/subtitle/')) {curSite = DBSite.a4k;};}, pager: { type: 1, nextL: 'css;a.pager__item--next', @@ -2422,7 +2452,7 @@ host: 'subhd.tv', functionStart: function() {if (location.pathname === '/forum/forum') { curSite = DBSite.subhd_forum; - } else if (location.pathname != '/' && location.pathname != '/zu' && location.pathname.indexOf('/a/') === -1 && location.pathname.indexOf('/d/') === -1 && location.pathname.indexOf('/forum/') === -1) { + } else if (location.pathname != '/' && location.pathname != '/zu' && !indexOF('/a/') && !indexOF('/d/') && !indexOF('/forum/')) { curSite = DBSite.subhd; }}, pager: { @@ -2457,11 +2487,11 @@ haoman: { host: 'www.haoman6.com', functionStart: function() { - if (location.pathname.indexOf('/chapter/') > -1) { + if (indexOF('/chapter/')) { curSite = DBSite.haoman; - } else if (location.pathname.indexOf('/comic/') > -1) { + } else if (indexOF('/comic/')) { if (getCSS('.chapter__more')) getCSS('.chapter__more').click(); - } else if (location.pathname.indexOf('/category/') > -1 || location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/category/') || indexOF('/search')) { curSite = DBSite.haoman_list; }}, insStyle: '.rd-guess, .rd-aside, .page-index__btn {display: none !important;} .rd-article__pic {display: initial !important;} .rd-article__pic > img {margin: 0 auto;display: block;height: auto;min-height: 200px;}', @@ -2496,7 +2526,7 @@ }, // 好漫 6 - 分类/搜索页 cartoonmad: { host: ['www.cartoonmad.com','www.cartoonmad.cc'], - functionStart: function() {if (location.pathname.indexOf('/comic/') > -1) { + functionStart: function() {if (indexOF('/comic/')) { getCSS('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接 curSite = DBSite.cartoonmad; } else if (location.pathname != '/') { @@ -2532,9 +2562,9 @@ } setTimeout(manhuacat_init, 100); curSite = DBSite.manhuacat; - } else if (location.pathname.indexOf('/list') > -1) { + } else if (indexOF('/list')) { curSite = DBSite.manhuacat_list; - } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) { + } else if (indexOF('/search') || indexOF('/update')) { curSite = DBSite.manhuacat_search; }}, insStyle: '#left, #right, #pull-load, .loading, .pagination, footer {display: none !important;} .img-content > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}', // 隐藏不需要的元素,调整图片 @@ -2574,11 +2604,11 @@ }, // 漫画猫 - 搜索页 manhuatai: { host: 'www.manhuatai.net', - functionStart: function() {if (location.pathname.indexOf('/manhua/') > -1) { + functionStart: function() {if (indexOF('/manhua/')) { curSite = DBSite.manhuatai; - } else if (location.pathname.indexOf('/fenlei_') > -1 || location.pathname.indexOf('/top_') > -1) { + } else if (indexOF('/fenlei_') || indexOF('/top_')) { curSite = DBSite.manhuatai_list; - } else if (location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/search')) { curSite = DBSite.manhuatai_search; }}, pager: { @@ -2618,7 +2648,7 @@ pausePage = false; setTimeout(manhuagui_init, 100); curSite = DBSite.manhuagui; - } else if (location.pathname.indexOf('list/') > -1 || location.pathname.indexOf('/s/') > -1) { + } else if (indexOF('list/') || indexOF('/s/')) { curSite = DBSite.manhuagui_list; }}, insStyle: '.sub-btn, .tc {display: none !important;} #mangaBox > img {width: auto !important;height: auto !important;display: block !important;margin: 0 auto !important;}', @@ -2653,9 +2683,9 @@ if (getCSS('img.img-fluid.show-pic')) getCSS('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复) setTimeout(manhuadb_init, 100); curSite = DBSite.manhuadb; - } else if (location.pathname.indexOf('/list') > -1) { + } else if (indexOF('/list')) { curSite = DBSite.manhuacat_list; - } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) { + } else if (indexOF('/search') || indexOF('/update')) { curSite = DBSite.manhuacat_search; }}, insStyle: '.row.m-0.pt-3.ad_2_wrap, .row.m-0.ad_1_wrap, .pagination.justify-content-center, #left, #right {display: none !important;}', @@ -2671,7 +2701,7 @@ }, // 漫画 DB hicomic: { host: 'www.hicomic.net', - functionStart: function() {if (location.pathname.indexOf('/chapters/') > -1) { + functionStart: function() {if (indexOF('/chapters/')) { setTimeout(hicomic_init, 100); curSite = DBSite.hicomic; }}, @@ -2687,16 +2717,16 @@ }, // HiComic (嗨漫画) dmzj: { host: 'www.dmzj.com', - functionStart: function() {if (location.pathname.indexOf('/view/') > -1) { + functionStart: function() {if (indexOF('/view/')) { if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式 document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式 location.reload(); // 刷新网页 } setTimeout(function() {dmzj_init('.comic_wraCon > a > img')}, 100); curSite = DBSite.dmzj; - } else if (location.pathname.indexOf('/category') > -1 || location.pathname.indexOf('/update') > -1) { + } else if (indexOF('/category') || indexOF('/update')) { curSite = DBSite.dmzj_list; - } else if (location.pathname.indexOf('/rank') > -1) { + } else if (indexOF('/rank')) { curSite = DBSite.dmzj_rank; }}, insStyle: 'p.mh_curr_page, .btmBtnBox, .float_code, #floatCode {display: none !important;} .comic_wraCon > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}', // 隐藏中间的页数信息 @@ -2739,7 +2769,7 @@ if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();} setTimeout(function() {dmzj_init('#center_box > .inner_img img[src]')}, 100); curSite = DBSite.dmzj_manhua; - } else if (location.pathname.indexOf('/update') > -1) { + } else if (indexOF('/update')) { curSite = DBSite.dmzj_manhua_update; }}, insStyle: 'p.curr_page, .btmBtnBox, .float_code, #floatCode {display: none !important;} #center_box > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}', // 隐藏中间的页数信息 @@ -2765,9 +2795,9 @@ }, //动漫之家 - 日漫 - 最新更新 copymanga: { host: /copymanga\./, - functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) { + functionStart: function() {if (indexOF('/chapter/')) { curSite = DBSite.copymanga; - } else if (location.pathname.indexOf('/comics') > -1) { + } else if (indexOF('/comics')) { curSite = DBSite.copymanga_list; }}, iframe: true, @@ -2841,9 +2871,9 @@ baozimh: { host: ['www.webmota.com', 'cn.webmota.com', 'cn.baozimh.com'], functionStart: function() { - if (location.pathname.indexOf('/chapter/') > -1) { + if (indexOF('/chapter/')) { curSite = DBSite.baozimh; - } else if (location.pathname.indexOf('/comic/') > -1) { + } else if (indexOF('/comic/')) { if (getCSS('#button_show_all_chatper')) getCSS('#button_show_all_chatper').click(); }}, insStyle: '#footer, #header {display: none !important;} .header, .bottom-bar {opacity: 0.3;}', @@ -2898,7 +2928,7 @@ let chapterScroll = getCSS('#chapter-scroll') // 强制为 [下拉阅读] 模式 if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();} curSite = DBSite.gufengmh; - } else if (location.pathname.indexOf('/update') > -1 || location.pathname.indexOf('/list') > -1 || location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/update') || indexOF('/list') || indexOF('/search')) { curSite = DBSite.gufengmh_list; }}, insStyle: 'p.img_info {display: none !important;}', // 隐藏中间的页数信息 @@ -2925,9 +2955,9 @@ szcdmj: { host: 'www.szcdmj.com', functionStart: function() { - if (location.pathname.indexOf('/szcchapter/') > -1) { + if (indexOF('/szcchapter/')) { curSite = DBSite.szcdmj; - } else if (location.pathname.indexOf('/szcbook/') > -1) { + } else if (indexOF('/szcbook/')) { if (getCSS('#detail-list-more')) getCSS('#detail-list-more').click(); } else if (location.pathname === '/szcbolist' || location.pathname === '/update') { curSite = DBSite.szcdmj_list; @@ -2964,7 +2994,7 @@ curSite = DBSite.mangabz; } else if (/\/\d+bz\//.test(location.pathname)) { if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click(); - } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') { + } else if (indexOF('/manga-list') || location.pathname === '/search') { curSite = DBSite.mangabz_list; }}, insStyle: 'body > .container > div:not([id]) {display: none !important;} .top-bar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important;width: auto !important; height: auto !important;}', @@ -2995,7 +3025,7 @@ curSite = DBSite.xmanhua; } else if (/\/\d+xm\//.test(location.pathname)) { if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click(); - } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') { + } else if (indexOF('/manga-list') || location.pathname === '/search') { curSite = DBSite.xmanhua_list; }}, hiddenPN: true, @@ -3022,7 +3052,7 @@ }, // Xmanhua 漫画 - 分类/搜索页 cocomanga: { host: 'www.cocomanga.com', - functionStart: function() {if (location.pathname.indexOf('.html') > -1) { + functionStart: function() {if (indexOF('.html')) { if (!(getCookie('mh_readmode') === '' || getCookie('mh_readmode') === '3')) { document.cookie='mh_readmode=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; // 强制开启自带的无缝翻页功能 location.reload(); // 刷新网页 @@ -3077,7 +3107,7 @@ }, // COCOMANGA 漫画 - 搜索页 qidian: { host: 'www.qidian.com', - functionStart: function() {if (location.pathname.indexOf('/all/') > -1) {curSite = DBSite.qidian;}}, + functionStart: function() {if (indexOF('/all/')) {curSite = DBSite.qidian;}}, pager: { type: 1, nextL: 'css;a[class*="pagination-next"]', @@ -3102,7 +3132,7 @@ }, // 起点小说 - 阅读页 baoshuu: { host: 'www.baoshuu.com', - functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu;}, + functionStart: function() {if (indexOF('/TXT/list')) curSite = DBSite.baoshuu;}, pager: { type: 1, nextL: '//div[@class="listl2"]//a[text()="下一页"]', @@ -3114,7 +3144,7 @@ }, // 宝书网 baoshuu_m: { host: 'm.baoshuu.com', - functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu_m;}, + functionStart: function() {if (indexOF('/TXT/list')) curSite = DBSite.baoshuu_m;}, pager: { type: 1, nextL: '//div[@class="man_first"]//a[text()="下一页"]', @@ -3126,11 +3156,11 @@ }, // 宝书网- 手机版 yushubo: { host: 'www.yushubo.com', - functionStart: function() {if (location.pathname.indexOf('/read_') > -1) { + functionStart: function() {if (indexOF('/read_')) { curSite = DBSite.yushubo; - } else if (location.pathname.indexOf('/lists/') > -1) { + } else if (indexOF('/lists/')) { curSite = DBSite.yushubo_list; - } else if (location.pathname.indexOf('/all') > -1) { + } else if (indexOF('/all')) { curSite = DBSite.yushubo_all; }}, insStyle: '.readbg.mt10 {display: none !important;}', @@ -3166,9 +3196,9 @@ }, // 御书网 - 书库页 xineyby: { host: 'www.xineyby.com', - functionStart: function() {if (location.pathname.indexOf('/read/') > -1) { + functionStart: function() {if (indexOF('/read/')) { curSite = DBSite.xineyby; - } else if (location.pathname.indexOf('/list/') > -1 || location.pathname.indexOf('/quanben/') > -1 || location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/list/') || indexOF('/quanben/') || indexOF('/search')) { curSite = DBSite.xineyby_list; }}, pager: { @@ -3195,7 +3225,7 @@ host: 'www.linovel.net', functionStart: function() {if (/\/book\/\d+\/.+\.html/.test(location.pathname)) { insStyle('.reward-section {display: none !important;}'); - } else if (location.pathname.indexOf('/cat/') > -1) { + } else if (indexOF('/cat/')) { curSite = DBSite.linovel; }}, pager: { @@ -3242,9 +3272,9 @@ host: 'www.linovelib.com', functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) { curSite = DBSite.linovelib; - } else if (location.pathname.indexOf('/wenku/') > -1) { + } else if (indexOF('/wenku/')) { curSite = DBSite.linovelib_wenku; - } else if (location.pathname.indexOf('/top/') > -1 || location.pathname.indexOf('/topfull/') > -1 || location.pathname.indexOf('toplist.php') > -1) { + } else if (indexOF('/top/') || indexOF('/topfull/') || indexOF('toplist.php')) { curSite = DBSite.linovelib_top; }}, pager: { @@ -3289,7 +3319,7 @@ host: 'w.linovelib.com', functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) { curSite = DBSite.linovelib_w; - } else if (location.pathname.indexOf('/wenku/') > -1 || location.pathname.indexOf('/sa/') > -1) { + } else if (indexOF('/wenku/') || indexOF('/sa/')) { curSite = DBSite.linovelib_w_wenku; }}, pager: { @@ -3319,7 +3349,7 @@ }, // 哔哩轻小说 (手机版) - 文库 _423down: { host: 'www.423down.com', - functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite._423down;}, + functionStart: function() {if (!indexOF('.html')) curSite = DBSite._423down;}, pager: { type: 1, nextL: '//div[@class="paging"]//a[contains(text(),"下一页")]', @@ -3343,7 +3373,7 @@ }, // 不死鸟 sharerw: { host: 'www.sharerw.com', - functionStart: function() {if (location.pathname.indexOf('.html') === -1) { + functionStart: function() {if (!indexOF('.html')) { if (location.pathname === '/search.php') {curSite = DBSite.sharerw_search;} else {curSite = DBSite.sharerw;};};}, pager: { type: 1, @@ -3435,7 +3465,7 @@ host: 'www.sixyin.com', functionStart: function() {if (location.pathname === '/' && location.search === '') { // 首页 curSite = DBSite.sixyin; - } else if (location.pathname.indexOf('.html') === -1) { // 分类页 + } else if (!indexOF('.html')) { // 分类页 curSite = DBSite.sixyin_list; }}, pager: { @@ -3457,7 +3487,7 @@ }, // 六音软件 - 分类页 apprcn: { host: ['www.apprcn.com', 'free.apprcn.com'], - functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1) {curSite = DBSite.apprcn;}}, + functionStart: function() {if (location.pathname === '/' || indexOF('/category/')) {curSite = DBSite.apprcn;}}, pager: { type: 1, nextL: '//div[@class="pagination"]//a[contains(text(), "Next")]', @@ -3469,9 +3499,9 @@ }, // 反斗软件 weidown: { host: 'www.weidown.com', - functionStart: function() {if (location.pathname.indexOf('/search/') > -1) { //搜索页 + functionStart: function() {if (indexOF('/search/')) { //搜索页 curSite = DBSite.weidown_search; - } else if (location.pathname.indexOf('/special') > -1) { // 专题页 + } else if (indexOF('/special')) { // 专题页 curSite = DBSite.weidown_special; } else { curSite = DBSite.weidown; @@ -3507,7 +3537,7 @@ }, // 微当下载 - 专题页 fsylr: { host: 'fsylr.com', - functionStart: function() {if (location.pathname.indexOf('.html') === -1) {curSite = DBSite.fsylr;}}, + functionStart: function() {if (!indexOF('.html')) {curSite = DBSite.fsylr;}}, pager: { type: 1, nextL: 'css;a.next.page-numbers', @@ -3519,7 +3549,7 @@ }, // 发烧友绿软 iplaysoft: { host: 'www.iplaysoft.com', - functionStart: function() {if (location.pathname.indexOf('.html') > -1 || location.pathname.indexOf('/p/') > -1) { // 文章内 + functionStart: function() {if (indexOF('.html') || indexOF('/p/')) { // 文章内 curSite = DBSite.iplaysoft_comment; } else { // 其他页面 curSite = DBSite.iplaysoft; @@ -3549,7 +3579,7 @@ host: 'www.mpyit.com', functionStart: function() {if (location.pathname === '/' && !location.search) { curSite = DBSite.mpyit; - } else if (location.pathname.indexOf('/category/') > -1 || location.search.indexOf('?s=') > -1) { // 搜索页 / 分类页 + } else if (indexOF('/category/') || indexOF('?s=', 's')) { // 搜索页 / 分类页 curSite = DBSite.mpyit_category; }}, pager: { @@ -3612,7 +3642,7 @@ functionStart: function() { if (location.pathname === '/sr.jsp') { curSite = DBSite.yrxitong_search; - } else if (location.pathname.indexOf('/h-nd-') === -1) { + } else if (!indexOF('/h-nd-')) { curSite = DBSite.yrxitong; } }, @@ -3652,7 +3682,7 @@ }, // (下面这几个都是国外博客网站) winaero: { host: 'winaero.com', - functionStart: function() {if (location.pathname === '/blog/' || location.pathname.indexOf('/category/') > -1) curSite = DBSite.winaero;}, + functionStart: function() {if (location.pathname === '/blog/' || indexOF('/category/')) curSite = DBSite.winaero;}, pager: { type: 1, nextL: 'css;.nav-previous > a', @@ -3664,7 +3694,7 @@ }, lrepacks: { host: 'lrepacks.net', - functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.lrepacks;}, + functionStart: function() {if (!indexOF('.html')) curSite = DBSite.lrepacks;}, pager: { type: 1, nextL: 'css;.page_next > a', @@ -3727,40 +3757,52 @@ github_star: { host: 'github.com', functionStart: function() {locationChange = true; - if (location.search.indexOf('tab=stars') > -1) { + if (indexOF('tab=stars', 's')) { curSite = DBSite.github_star; - } else if ((location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) || (location.pathname.indexOf('/pulls') > -1 && location.pathname.indexOf('/pulls/') === -1)) { + } else if ((indexOF('/issues') && !indexOF('/issues/')) || (indexOF('/pulls') && !indexOF('/pulls/'))) { curSite = DBSite.github_issues; - } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/discussions\/\d+/.test(location.pathname)) && location.pathname.indexOf('new') === -1) { + } else if (indexOF('/discussions') && !(/\/discussions\/\d+/.test(location.pathname)) && !indexOF('new')) { curSite = DBSite.github_discussions; - } else if (location.pathname.indexOf('/releases') > -1 && location.pathname.indexOf('/releases/tag/') === -1 && location.pathname.indexOf('edit') === -1) { + } else if (indexOF('/releases') && !indexOF('/releases/tag/') && !indexOF('edit')) { curSite = DBSite.github_releases; - } else if (location.pathname.indexOf('/tags') > -1 && location.pathname.indexOf('/tags/') === -1) { + } else if (indexOF('/tags') && !indexOF('/tags/')) { curSite = DBSite.github_tags; - } else if (location.pathname.indexOf('/commits') > -1) { + } else if (indexOF('/commits')) { curSite = DBSite.github_commits; - } else if (location.pathname.indexOf('/notifications') > -1) { + } else if (indexOF('/notifications')) { curSite = DBSite.github_notifications; - } else if (location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/search')) { if (!location.search) return - if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) { + if (indexOF('type=repositories', 's', true) || !indexOF('type=', 's')) { curSite = DBSite.github_search; - } else if (location.search.indexOf('type=code') > -1) { + } else { + console.log(DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')]) + curSite = DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')]; + } + /*} else if (indexOF('type=code', 's')) { curSite = DBSite.github_search_code; - } else if (location.search.indexOf('type=commits') > -1) { - curSite = DBSite.github_search_commit; - } else if (location.search.indexOf('type=issues') > -1 || location.search.indexOf('type=discussions') > -1) { - curSite = DBSite.github_search_issue; - } else if (location.search.indexOf('type=registrypackages') > -1) { - curSite = DBSite.github_search_package; - } else if (location.search.indexOf('type=marketplace') > -1) { + } else if (indexOF('type=commits', 's')) { + curSite = DBSite.github_search_commits; + } else if (indexOF('type=issues', 's')) { + curSite = DBSite.github_search_issues; + } else if (indexOF('type=discussions', 's')) { + curSite = DBSite.github_search_discussions; + } else if (indexOF('type=registrypackages', 's')) { + curSite = DBSite.github_search_registrypackages; + } else if (indexOF('type=marketplace', 's')) { curSite = DBSite.github_search_marketplace; - } else if (location.search.indexOf('type=topics') > -1) { + } else if (indexOF('type=topics', 's')) { curSite = DBSite.github_search_topics; - } else if (location.search.indexOf('type=wikis') > -1) { - curSite = DBSite.github_search_wiki; - } else if (location.search.indexOf('type=users') > -1) { - curSite = DBSite.github_search_user; + } else if (indexOF('type=wikis', 's')) { + curSite = DBSite.github_search_wikis; + } else if (indexOF('type=users', 's')) { + curSite = DBSite.github_search_users; + }*/ + if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) { + curSite.pager.type = 1; + curSite.pager.nextL = 'css;a.next_page'; + curSite.pager.replaceE = 'css;.pagination'; + curSite.pager.scrollD = 3000; } }}, pager: { @@ -3834,97 +3876,67 @@ }, // Github - Notifications 列表 github_search: { pager: { - type: 1, - nextL: 'css;a.next_page', pageE: 'css;ul.repo-list > li', insertP: ['css;ul.repo-list', 3], - replaceE: 'css;.pagination', - scrollD: 1500 } }, // Github - Search 列表 github_search_code: { pager: { - type: 1, - nextL: 'css;a.next_page', - pageE: 'css;.code-list > div', - insertP: ['css;.code-list', 3], - replaceE: 'css;.pagination', - scrollD: 1500 + pageE: 'css;.code-list-item', + insertP: ['css;.code-list-item:last-child', 1], } }, // Github - Search 列表 - Code - github_search_commit: { + github_search_commits: { pager: { - type: 1, - nextL: 'css;a.next_page', pageE: 'css;#commit_search_results > div', insertP: ['css;#commit_search_results', 3], - replaceE: 'css;.pagination', - scrollD: 1500 } - }, // Github - Search 列表 - Commit - github_search_issue: { + }, // Github - Search 列表 - Commit + github_search_issues: { pager: { - type: 1, - nextL: 'css;a.next_page', - pageE: 'css;.issue-list > div > div', - insertP: ['css;.issue-list > div', 3], - replaceE: 'css;.pagination', - scrollD: 1500 + pageE: 'css;.issue-list-item', + insertP: ['css;.issue-list-item:last-child', 1], } - }, // Github - Search 列表 - Issues/Discussions - github_search_package: { + }, // Github - Search 列表 - Issues + github_search_discussions: { + pager: { + pageE: 'css;.discussion-list-item', + insertP: ['css;.discussion-list-item:last-child', 1], + } + }, // Github - Search 列表 - Discussions + github_search_registrypackages: { pager: { - type: 1, - nextL: 'css;a.next_page', pageE: 'css;#package_search_results > div', insertP: ['css;#package_search_results', 3], - replaceE: 'css;.pagination', - scrollD: 1500 } - }, // Github - Search 列表 - Package + }, // Github - Search 列表 - Package github_search_marketplace: { pager: { - type: 1, - nextL: 'css;a.next_page', - pageE: 'css;.issue-list > div', - insertP: ['css;.issue-list', 3], - replaceE: 'css;.pagination', - scrollD: 1500 + pageE: 'css;#marketplace_search_results > div:first-child > div', + insertP: ['css;#marketplace_search_results > div:first-child', 3], } }, // Github - Search 列表 - Marketplace github_search_topics: { pager: { - type: 1, - nextL: 'css;a.next_page', - pageE: 'css;.topic-list > div', - insertP: ['css;.topic-list', 3], - replaceE: 'css;.pagination', - scrollD: 1500 + pageE: 'css;.topic-list-item', + insertP: ['css;.topic-list-item:last-child', 1], } }, // Github - Search 列表 - Topics - github_search_wiki: { + github_search_wikis: { pager: { - type: 1, - nextL: 'css;a.next_page', pageE: 'css;#wiki_search_results > div:first-child > div', insertP: ['css;#wiki_search_results > div:first-child', 3], - replaceE: 'css;.pagination', - scrollD: 1500 } - }, // Github - Search 列表 - wiki - github_search_user: { + }, // Github - Search 列表 - wiki + github_search_users: { pager: { - type: 1, - nextL: 'css;a.next_page', pageE: 'css;#user_search_results > div:first-child > div', insertP: ['css;#user_search_results > div:first-child', 3], - replaceE: 'css;.pagination', - scrollD: 1500 } - }, // Github - Search 列表 - user + }, // Github - Search 列表 - user stackoverflow: { host: 'stackoverflow.com', - functionStart: function() {if (location.pathname.indexOf('/questions') > -1) { + functionStart: function() {if (indexOF('/questions')) { curSite = DBSite.stackoverflow; } else if (location.pathname === '/search') { curSite = DBSite.stackoverflow_search; @@ -3975,7 +3987,7 @@ segmentfault: { host: 'segmentfault.com', functionStart: function() {locationChange = true; - if (location.pathname.indexOf('/questions') > -1) { + if (indexOF('/questions')) { curSite = DBSite.segmentfault; } else if (location.pathname === '/search') { curSite = DBSite.segmentfault_search; @@ -4161,7 +4173,7 @@ }, // 学术 acs: { host: ['pubs.acs.org','onlinelibrary.wiley.com'], - functionStart: function() {if (location.pathname.indexOf('/doSearch') > -1) {curSite = DBSite.acs;}}, + functionStart: function() {if (indexOF('/doSearch')) {curSite = DBSite.acs;}}, pager: { type: 1, nextL: 'css;a.pagination__btn--next', @@ -4174,7 +4186,7 @@ }, // 学术 x_mol: { host: 'www.x-mol.com', - functionStart: function() {if (location.pathname.indexOf('/search/q') > -1 || location.pathname.indexOf('/paper/') > -1) {curSite = DBSite.x_mol;}}, + functionStart: function() {if (indexOF('/search/q') || indexOF('/paper/')) {curSite = DBSite.x_mol;}}, pager: { type: 1, nextL: function() {return getPage_nextL('css;.pagination li.active+li > a', 'pageIndex=', /pageIndex=\d+/)}, @@ -4211,9 +4223,9 @@ host: 'xueshu.baidu.com', functionStart: function() {if (location.pathname === '/s') { curSite = DBSite.baidu_xueshu; - } else if (location.pathname.indexOf('journal/navigation') > -1) { + } else if (indexOF('journal/navigation')) { curSite = DBSite.baidu_xueshu_journal; - } else if (location.pathname.indexOf('paper/show') > -1) { + } else if (indexOF('paper/show')) { curSite = DBSite.baidu_xueshu_paper; }}, pager: { @@ -4260,11 +4272,11 @@ cadtutor: { host: 'www.cadtutor.net', functionStart: function() { - if (location.pathname.indexOf('/forum/forum/') > -1) { + if (indexOF('/forum/forum/')) { curSite = DBSite.cadtutor; - } else if (location.pathname.indexOf('/forum/topic/') > -1 && GM_getValue('menu_discuz_thread_page')) { + } else if (indexOF('/forum/topic/') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.cadtutor_post; - } else if (location.pathname.indexOf('/forum/search/') > -1) { + } else if (indexOF('/forum/search/')) { curSite = DBSite.cadtutor_search; }}, pager: { @@ -4300,9 +4312,9 @@ host: 'www.theswamp.org', functionStart: function() { if (!location.search) return - if (location.search.indexOf('board=') > -1) { + if (indexOF('board=', 's')) { curSite = DBSite.theswamp; - } else if (location.search.indexOf('topic=') > -1 && GM_getValue('menu_discuz_thread_page')) { + } else if (indexOF('topic=', 's') && GM_getValue('menu_discuz_thread_page')) { curSite = DBSite.theswamp_post; }}, pager: { @@ -4326,9 +4338,9 @@ }, // TheSwamp - 帖子内 wikihow: { host: ['www.wikihow.com', 'zh.wikihow.com'], - functionStart: function() {if (location.pathname.indexOf('/Category:') > -1) { + functionStart: function() {if (indexOF('/Category:')) { curSite = DBSite.wikihow; - } else if (location.pathname.indexOf('/wikiHowTo') > -1 && location.search.indexOf('?search=') > -1) { + } else if (indexOF('/wikiHowTo') && indexOF('?search=', 's')) { curSite = DBSite.wikihow_search; }}, pager: { @@ -4375,11 +4387,11 @@ }, // 直播 greasyfork: { host: 'greasyfork.org', - functionStart: function() {if (/\/scripts$/.test(location.pathname) || location.pathname.indexOf('/scripts/by-site/') > -1) { + functionStart: function() {if (/\/scripts$/.test(location.pathname) || indexOF('/scripts/by-site/')) { curSite = DBSite.greasyfork; } else if (/\/feedback$/.test(location.pathname)) { curSite = DBSite.greasyfork_feedback; - } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/\d+/.test(location.pathname))) { + } else if (indexOF('/discussions') && !(/\/\d+/.test(location.pathname))) { curSite = DBSite.greasyfork_discussions; }}, pager: { @@ -4413,7 +4425,7 @@ }, // 脚本 - 讨论页 smzdm: { host: ['www.smzdm.com', 'search.smzdm.com'], - functionStart: function() {if (location.host === 'search.smzdm.com' || location.pathname.indexOf('/fenlei/') > -1) { + functionStart: function() {if (location.host === 'search.smzdm.com' || indexOF('/fenlei/')) { curSite = DBSite.smzdm; }}, pager: { @@ -4427,7 +4439,7 @@ }, // 什么值得买 - 分类/搜索页 meidebi: { host: 'www.meidebi.com', - functionStart: function() {if (location.pathname.indexOf('/fenlei/') > -1 || location.pathname === '/Search') { + functionStart: function() {if (indexOF('/fenlei/') || location.pathname === '/Search') { curSite = DBSite.meidebi; }}, pager: { @@ -4480,7 +4492,7 @@ }, // 如意了教育 - 试卷 jiligamefun: { host: 'www.jiligamefun.com', - functionStart: function() {if (location.pathname.indexOf('/category/') > -1) {curSite = DBSite.jiligamefun;}}, + functionStart: function() {if (indexOF('/category/')) {curSite = DBSite.jiligamefun;}}, pager: { type: 1, nextL: 'css;a.poi-pager__item.poi-pager__item_next', @@ -4492,7 +4504,7 @@ }, // 叽哩叽哩日报 wendangku: { host: 'www.wendangku.net', - functionStart: function() {if (location.pathname.indexOf('/doc/') > -1) {curSite = DBSite.wendangku;}}, + functionStart: function() {if (indexOF('/doc/')) {curSite = DBSite.wendangku;}}, pager: { type: 1, nextL: 'css;a.next', @@ -4516,7 +4528,7 @@ }, // 彼岸图网 ioliu: { host: 'bing.ioliu.cn', - functionStart: function() {if (location.pathname.indexOf('/photo/') === -1 && location.pathname.indexOf('.html') === -1) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}}, + functionStart: function() {if (!indexOF('/photo/') && !indexOF('.html')) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}}, insStyle: '.progressive--not-loaded {filter: none !important;}', pager: { type: 1, @@ -4568,9 +4580,9 @@ tujigu: { host: 'www.tujigu.net', functionStart: function() { - if (location.pathname.indexOf('/a/') > -1) { + if (indexOF('/a/')) { curSite = DBSite.tujigu; - } else if (location.pathname != '/' && location.pathname.indexOf('/search/') === -1) { + } else if (location.pathname != '/' && !indexOF('/search/')) { curSite = DBSite.tujigu_list; }}, insStyle: '.content img {display: block !important;}', @@ -4599,7 +4611,7 @@ }, // 图集谷 - 分类页 mvtui: { host: 'mvtui.com', - functionStart: function() {if (location.pathname.indexOf('.html') > -1) {curSite = DBSite.mvtui;} else {curSite = DBSite.mvtui_list;}}, + functionStart: function() {if (indexOF('.html')) {curSite = DBSite.mvtui;} else {curSite = DBSite.mvtui_list;}}, pager: { type: 1, nextL: 'css;.article-paging span.current+a', @@ -4652,9 +4664,9 @@ xiurenji: { host: /\.xiurenji\./, functionStart: function() {insStyle('img[src$=".gif"]:not([src*="logo"]) {display: none !important;}'); - if (location.pathname.indexOf('.html') > -1 && location.pathname.indexOf('/index') === -1) { + if (indexOF('.html') && !indexOF('/index')) { curSite = DBSite.xiurenji; - } else if (location.pathname.indexOf('search') > -1) { + } else if (indexOF('search')) { curSite = DBSite.xiurenji_search; } else { curSite = DBSite.xiurenji_list; @@ -4690,7 +4702,7 @@ }, // 秀人集 - 搜索页 mm131: { host: 'www.mm131.net', - functionStart: function() {if (location.pathname.indexOf('.html') > -1) {curSite = DBSite.mm131;} else {curSite = DBSite.mm131_list;}}, + functionStart: function() {if (indexOF('.html')) {curSite = DBSite.mm131;} else {curSite = DBSite.mm131_list;}}, pager: { type: 1, nextL: '//div[@class="content-page"]/a[contains(text(), "下一页")]', @@ -4713,13 +4725,13 @@ fnvshen: { host: 'www.fnvshen.com', functionStart: function() { - if (location.pathname.indexOf('/gallery/') > -1 || location.pathname.indexOf('/tag/') > -1) { + if (indexOF('/gallery/') || indexOF('/tag/')) { curSite = DBSite.fnvshen_list; - } else if (location.pathname.indexOf('/g/') > -1) { + } else if (indexOF('/g/')) { curSite = DBSite.fnvshen; } else if (/\/article\/\d+\//.test(location.pathname)) { curSite = DBSite.fnvshen_article; - } else if (location.pathname.indexOf('/article/') > -1) { + } else if (indexOF('/article/')) { curSite = DBSite.fnvshen_article_list; }}, pager: { @@ -4770,7 +4782,7 @@ host: 'www.xrmn5.com', functionStart: function() {if (/\d+\.html/.test(location.pathname)) { curSite = DBSite.xrmn5; - } else if (location.pathname.indexOf('/search') > -1) { + } else if (indexOF('/search')) { curSite = DBSite.xrmn5_search; /*} else { curSite = DBSite.xrmn5_list;*/ @@ -4844,6 +4856,8 @@ if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 左键双击网页空白处暂停翻页 pausePageEvent(); + // 强制新标签页打开链接(翻页模式 5/6) + if (curSite.forceTarget) forceTarget(); if (locationChange) { // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则 nowLocation = location.href @@ -4910,31 +4924,31 @@ } // 如果上面没有匹配的则继续 < 搜索结果 > if (curSite.SiteTypeID === 0) { - if (location.pathname.indexOf('search') > -1 || getCSS('body[id="nv_search"][onkeydown*="27"]')) { + if (indexOF('search') || getCSS('body[id="nv_search"][onkeydown*="27"]')) { curSite = DBSite.discuz_search; } } // 如果上面没有匹配的则继续 if (curSite.SiteTypeID === 0) { - if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾) - if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 > + if (indexOF('.html')) { // 判断是不是静态网页(.html 结尾) + if (indexOF('/forum-')) { // < 各版块帖子列表 > discuzForum(); - } else if (location.pathname.indexOf('/thread-') > -1) { // < 帖子内 > + } else if (indexOF('/thread-')) { // < 帖子内 > if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread; } } } // 如果上面没有匹配的则继续 if (curSite.SiteTypeID === 0) { - if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 > + if (indexOF('mod=forumdisplay', 's') || indexOF('forumdisplay.php')) { // < 各版块帖子列表 > discuzForum(); - } else if (location.search.indexOf('mod=viewthread') > -1 || location.pathname.indexOf('viewthread.php') > -1) { // < 帖子内 > + } else if (indexOF('mod=viewthread', 's') || indexOF('viewthread.php')) { // < 帖子内 > if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread; - } else if (location.search.indexOf('mod=guide') > -1) { // < 导读帖子列表 > + } else if (indexOF('mod=guide', 's')) { // < 导读帖子列表 > curSite = DBSite.discuz_guide; - } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('do=thread') > -1) { // 别人的主题/回复 + } else if(indexOF('mod=space', 's') && indexOF('do=thread', 's')) { // 别人的主题/回复 curSite = DBSite.discuz_youspace; - } else if (location.search.indexOf('mod=collection') > -1) { // < 淘贴列表 > + } else if (indexOF('mod=collection', 's')) { // < 淘贴列表 > curSite = DBSite.discuz_collection; } else if (getCSS('#threadlist')) { // < 部分论坛的各板块 URL 是自定义的 > discuzForum(); @@ -4951,7 +4965,7 @@ // [谷歌搜索] 的插入前函数(加载视频图片) function google_bF(pageElems) { - if (location.search.indexOf('tbm=nws') === -1){ + if (!indexOF('tbm=nws', 's')){ pageElems.forEach(function (one) { getAllCSS('a[aria-label][href*="https://www.youtube.com/watch?v="]').forEach(function (one1) { let img = getCSS('img', one1) @@ -5084,7 +5098,7 @@ function nexusmods_nextL() { if (getCSS('.nexus-ui-blocker')) return let modList; - if (location.pathname.indexOf('/news') > -1) {modList = RH_NewsTabContent;} else {modList = RH_ModList;} + if (indexOF('/news')) {modList = RH_NewsTabContent;} else {modList = RH_ModList;} let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''), nextNum = getXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'), categories = modList.out_items.categories, categoriesUrl = ''; @@ -5757,24 +5771,24 @@ autopbn.click(); pageNum.now = pageNum._now + 1; } } else { - // 如果没有指定按钮文字就直接点击 - autopbn.click(); pageNum.now = pageNum._now + 1; // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms) if (!curSite.pager.interval) curSite.pager.interval = 300; intervalPause(); + // 如果没有指定按钮文字就直接点击 + autopbn.click(); pageNum.now = pageNum._now + 1; } } } // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>> } else if (curSite.pager.type === 4) { // 为百度贴吧的发帖考虑,预留底部一小部分... - if (!(document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200 && curSite.SiteTypeID === SiteType.BAIDU_TIEBA)) { + if (!(curSite.SiteTypeID === SiteType.BAIDU_TIEBA && document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200)) { + intervalPause(); if (typeof curSite.pager.nextL == 'function') { curSite.pager.nextL(); } else if (getE_nextL(curSite.pager.nextL)) { getPageElems(curSite.pageUrl); } - intervalPause(); } // <<<<< 翻页类型 5(插入 iframe 方式来加载下一页)>>>>> @@ -5784,6 +5798,14 @@ } else if (getE_nextL(curSite.pager.nextL)) { insIframe(curSite.pageUrl); } + + // <<<<< 翻页类型 6(通过 iframe 获取下一页动态加载内容)>>>>> + } else if (curSite.pager.type === 6) { + if (typeof curSite.pager.nextL == 'function') { + curSite.pager.nextL(); + } else if (getE_nextL(curSite.pager.nextL)) { + insIframe_(curSite.pageUrl); + } } } } @@ -5798,7 +5820,7 @@ } } } - // 插入 iframe 方式加载下一页 + // 翻页类型 5(插入 iframe 方式加载下一页) function insIframe(src) { // 停用当前页面翻页 curSite.SiteTypeID = 0; @@ -5841,6 +5863,40 @@ // 插入 iframe document.lastElementChild.appendChild(iframe); } + // 翻页类型 6(通过 iframe 获取下一页动态加载内容) + function insIframe_(src) { + // 暂停翻页 + if (!pausePage) return + pausePage = false + + // 如果不存在,则创建一个 iframe + let iframe = document.getElementById('xiu2_iframe'); + if (!iframe) { + iframe = document.createElement('iframe'); + iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;display: none;'; + iframe.id = 'xiu2_iframe'; + iframe.src = src; + } + + // 加载完成后才继续 + iframe.onload = function() { + iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件 + //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'}); + if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms + setTimeout(function() { + //console.log(iframe.contentWindow.document.body) + processResult(iframe.contentWindow.document); // 插入/替换元素等 + pausePage = true; // 恢复翻页 + }, curSite.pager.loadTime) // 预留加载时间,确保网页加载完成 + } + + // 插入 iframe(如果已存在则直接改 src) + if (document.getElementById('xiu2_iframe')) { + iframe.src = src; + } else { + document.lastElementChild.appendChild(iframe); + } + } // 判断是支持 function doesItSupport() { setDBSite(); // 配置 DBSite 变量对象 @@ -5908,50 +5964,8 @@ } return 0; } - // 翻页类型 4 专用 - function getPageElems(url, type = '', method = 'GET', data = '', type2) { - let mimeType; - switch (type) { - case 'json': - mimeType = 'application/json; charset=' + document.charset; break; - case 'text': - mimeType = 'text/plain; charset=' + document.charset; break; - default: - mimeType = 'text/html; charset=' + document.charset; - } - - GM_xmlhttpRequest({ - url: url, - method: method, - data: data, - responseType: type, - overrideMimeType: mimeType, - headers: { - 'Referer': location.href, - 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'' - }, - timeout: 10000, - onload: function (response) { - try { - //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText) - switch (type) { - case 'json': - curSite.pager.insertE(response.response, type2); - break; - case 'text': - curSite.pager.insertE(response.responseText, type2) - break; - default: - curSite.pager.insertE(ShowPager.createDocumentByString(response.responseText), type2) - } - } catch (e) { - console.log(e); - } - } - }); - } - // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader + // 翻页类型 1/3 // 修改自 https://greasyfork.org/scripts/14178 、 https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; @@ -6012,7 +6026,7 @@ } }, }; - // XHR 后处理结果 + // 翻页类型 1/3/6(XHR 后处理结果) function processResult(response) { var newBody = response; let pageElems = getAll(curSite.pager.pageE, newBody, newBody), @@ -6087,6 +6101,48 @@ if (curSite.SiteTypeID === SiteType.BILIBILI_SEARCH) {curSite.pageUrl = '';} } } + // 翻页类型 4 + function getPageElems(url, type = '', method = 'GET', data = '', type2) { + let mimeType; + switch (type) { + case 'json': + mimeType = 'application/json; charset=' + document.charset; break; + case 'text': + mimeType = 'text/plain; charset=' + document.charset; break; + default: + mimeType = 'text/html; charset=' + document.charset; + } + + GM_xmlhttpRequest({ + url: url, + method: method, + data: data, + responseType: type, + overrideMimeType: mimeType, + headers: { + 'Referer': location.href, + 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'' + }, + timeout: 10000, + onload: function (response) { + try { + //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText) + switch (type) { + case 'json': + curSite.pager.insertE(response.response, type2); + break; + case 'text': + curSite.pager.insertE(response.responseText, type2) + break; + default: + curSite.pager.insertE(ShowPager.createDocumentByString(response.responseText), type2) + } + } catch (e) { + console.log(e); + } + } + }); + } // 插入 Script function insScriptAll(selector = '//script', toElement = document.body, contextNode = document) { @@ -6125,7 +6181,7 @@ var url = ''; if (nextNum && nextNum.textContent) { if (location.search) { - if (location.search.indexOf(pf) > -1) { + if (indexOF(pf, 's') > -1) { url = location.search.replace(reg, pf + nextNum.textContent); } else { url = location.search + '&' + pf + nextNum.textContent; @@ -6163,10 +6219,10 @@ // 添加历史记录 function addHistory(pageElems, title, url) { if (!curSite.pageUrl) return - title = title || pageElems.querySelector('title').textContent || document.title; + title = title || pageElems.querySelector('title').textContent || window.top.document.title; url = url || curSite.pageUrl; - window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, url); - document.title = title; + window.top.history.pushState({}, title, url); + window.top.document.title = title; } // 获取元素(CSS/Xpath) function getCSS(css, contextNode = document) { @@ -6219,6 +6275,33 @@ } } + // 强制新标签页打开链接(翻页模式 5/6) + function forceTarget() { + document.body.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + forceTarget_(e.target, e); + } else { + let path = e.path || e.composedPath(); + for (let i = 1; i < path.length - 3; i++) { + //console.log(path[i]) + if (path[i].tagName === 'A') { + forceTarget_(path[i], e); + break; + } + } + } + }); + + function forceTarget_(target, e){ + if (target.href && target.target != '_blank' && !(target.getAttribute('onclick')) && target.href.slice(0,4) == 'http' && target.getAttribute('href').slice(0,1) != '#') { + e.preventDefault(); // 阻止默认打开链接事件 + //console.log(target.href); + //window.top.location.href = target.href; + window.GM_openInTab(target.href, {active: true,insert: true,setParent: true}); + } + } + //document.head.appendChild(document.createElement('base')).target = '_top'; + } // 启用/禁用 (当前网站) function menu_disable(type) { switch(type) { @@ -6398,6 +6481,21 @@ function isHidden(el){ return (el.offsetParent === null); } + // 判断 URL 是否存在指定文本 + function indexOF(e, l = 'p', low = false){ + switch (l) { + case 'h': + l = location.href; break; + case 'p': + l = location.pathname; break; + case 's': + l = location.search; break; + } + //console.log(l,e,l.indexOf(e)) + if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写 + if (l.indexOf(e) > -1) return true + return false + } /* // 监听 XMLHttpRequest URL @@ -6415,30 +6513,5 @@ } window.XMLHttpRequest.prototype.open = openReplacement; - - document.body.addEventListener('click', function(e) { - if (e.target.tagName === 'A'){ - if(e.target.href && e.target.target != '_blank' && !(e.target.onclick) && e.target.href.slice(0,4) == 'http' && e.target.getAttribute('href').slice(0,1) != '#') { - e.preventDefault(); // 阻止默认打开链接事件 - window.top.location.href = e.target.href - } - } else { - let path = e.path || e.composedPath(); - for (let i = 1; i < path.length - 3; i++) { - console.log(path[i]) - if (path[i].tagName === 'A'){ - window.top.location.href = path[i].href - if(path[i].href && path[i].target != '_blank' && !(path[i].onclick) && path[i].href.slice(0,4) == 'http' && path[i].getAttribute('href').slice(0,1) != '#') { - e.preventDefault(); // 阻止默认打开链接事件 - console.log(path[i].href) - window.top.location.href = path[i].href - } - break; - } - } - } - }); - - //document.head.appendChild(document.createElement('base')).target = '_top'; -*/ + */ })(); \ No newline at end of file From a693f622d44282c8f3116b0dd83090e485c5d891 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:57:00 +0800 Subject: [PATCH 0002/1647] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 107de1877..d8989fe44 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -2,7 +2,7 @@ // @name 自动无缝翻页 // @version 3.5.7 // @author X.I.U -// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... +// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* // @connect www.xuexiniu.com // @connect bbs.xuexiniu.com @@ -1345,7 +1345,7 @@ loadTime: 1000, scrollD: 1000 } - }, // Pixiv - 分类页 + }, // Pixiv - 分类页 pixiv_user: { forceTarget: true, hiddenPN: true, @@ -1357,7 +1357,7 @@ replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', scrollD: 2000 } - }, // Pixiv - 用户作品页 + }, // Pixiv - 用户作品页 _58pic: { host: 'www.58pic.com', functionStart: function() {insStyle('.qt-model-t.login-model {display: none !important;}'); From a71e3a38939c911d6734b190f9295f5e54075569 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 19:07:28 +0800 Subject: [PATCH 0003/1647] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index d8989fe44..98e1a81be 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -3776,28 +3776,8 @@ if (indexOF('type=repositories', 's', true) || !indexOF('type=', 's')) { curSite = DBSite.github_search; } else { - console.log(DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')]) curSite = DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')]; } - /*} else if (indexOF('type=code', 's')) { - curSite = DBSite.github_search_code; - } else if (indexOF('type=commits', 's')) { - curSite = DBSite.github_search_commits; - } else if (indexOF('type=issues', 's')) { - curSite = DBSite.github_search_issues; - } else if (indexOF('type=discussions', 's')) { - curSite = DBSite.github_search_discussions; - } else if (indexOF('type=registrypackages', 's')) { - curSite = DBSite.github_search_registrypackages; - } else if (indexOF('type=marketplace', 's')) { - curSite = DBSite.github_search_marketplace; - } else if (indexOF('type=topics', 's')) { - curSite = DBSite.github_search_topics; - } else if (indexOF('type=wikis', 's')) { - curSite = DBSite.github_search_wikis; - } else if (indexOF('type=users', 's')) { - curSite = DBSite.github_search_users; - }*/ if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) { curSite.pager.type = 1; curSite.pager.nextL = 'css;a.next_page'; From 2b293bc1154a622b6e4f05a11ebbd1c8877d1fc8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 21:35:07 +0800 Subject: [PATCH 0004/1647] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[Pixiv]=20?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 49 ++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 98e1a81be..f18570e38 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.5.7 +// @version 3.5.8 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -1324,8 +1324,10 @@ }, // IT 之家 pixiv: { host: 'www.pixiv.net', - functionStart: function() { - if (indexOF('/tags/') && self == top) { + functionStart: function() {locationChange = true; + if (location.pathname == '/') { + forceTarget(); + } else if (indexOF('/tags/') && self == top) { curSite = DBSite.pixiv; } else if (indexOF('/users/') && /\/(artworks|illustrations|manga)/.test(location.pathname)) { curSite = DBSite.pixiv_user; @@ -5945,6 +5947,7 @@ return 0; } + // 翻页类型 1/3 // 修改自 https://greasyfork.org/scripts/14178 、 https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { @@ -6124,6 +6127,7 @@ }); } + // 插入 Script function insScriptAll(selector = '//script', toElement = document.body, contextNode = document) { let scriptElems = getAll(selector, contextNode, contextNode), scriptText = ''; @@ -6255,6 +6259,7 @@ } } + // 强制新标签页打开链接(翻页模式 5/6) function forceTarget() { document.body.addEventListener('click', function(e) { @@ -6282,6 +6287,25 @@ } //document.head.appendChild(document.createElement('base')).target = '_top'; } + // 判断元素是否隐藏(隐藏返回 true) + function isHidden(el){ + return (el.offsetParent === null); + } + // 判断 URL 是否存在指定文本 + function indexOF(e, l = 'p', low = false){ + switch (l) { + case 'h': + l = location.href; break; + case 'p': + l = location.pathname; break; + case 's': + l = location.search; break; + } + //console.log(l,e,l.indexOf(e)) + if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写 + if (l.indexOf(e) > -1) return true + return false + } // 启用/禁用 (当前网站) function menu_disable(type) { switch(type) { @@ -6457,25 +6481,6 @@ window.dispatchEvent(new Event('locationChange')) }); } - // 判断元素是否隐藏(隐藏返回 true) - function isHidden(el){ - return (el.offsetParent === null); - } - // 判断 URL 是否存在指定文本 - function indexOF(e, l = 'p', low = false){ - switch (l) { - case 'h': - l = location.href; break; - case 'p': - l = location.pathname; break; - case 's': - l = location.search; break; - } - //console.log(l,e,l.indexOf(e)) - if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写 - if (l.indexOf(e) > -1) return true - return false - } /* // 监听 XMLHttpRequest URL From 077f6b70449c95106594bf4f7e6921b0a364a2c6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 23:23:06 +0800 Subject: [PATCH 0005/1647] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[Pixiv]=20?= =?UTF-8?q?=E8=A7=84=E5=88=99;=20=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index f18570e38..28c16cfe2 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.5.8 +// @version 3.5.9 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -1344,6 +1344,7 @@ pageE: '//ul[contains(@class, "-1 ")]/li', insertP: ['//ul[contains(@class, "-1 ")]', 3], replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, loadTime: 1000, scrollD: 1000 } @@ -1357,6 +1358,7 @@ pageE: '//ul[contains(@class, "-1 ")]/li', insertP: ['//ul[contains(@class, "-1 ")]', 3], replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, scrollD: 2000 } }, // Pixiv - 用户作品页 @@ -5855,7 +5857,7 @@ let iframe = document.getElementById('xiu2_iframe'); if (!iframe) { iframe = document.createElement('iframe'); - iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;display: none;'; + iframe.style = 'position: absolute; width: 100%; height: 100%; border: none; display: none;'; iframe.id = 'xiu2_iframe'; iframe.src = src; } @@ -5866,7 +5868,7 @@ //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'}); if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms setTimeout(function() { - //console.log(iframe.contentWindow.document.body) + //console.log(getOne(curSite.pager.insertP[0], iframe.contentWindow.document)) processResult(iframe.contentWindow.document); // 插入/替换元素等 pausePage = true; // 恢复翻页 }, curSite.pager.loadTime) // 预留加载时间,确保网页加载完成 @@ -6013,7 +6015,7 @@ function processResult(response) { var newBody = response; let pageElems = getAll(curSite.pager.pageE, newBody, newBody), - toElement = getAll(curSite.pager.insertP[0])[0]; + toElement = getOne(curSite.pager.insertP[0]); //console.log(curSite.pager.pageE, pageElems, curSite.pager.insertP, toElement) if (pageElems.length > 0) { @@ -6030,15 +6032,12 @@ let addTo = getAddTo(curSite.pager.insertP[1]); // 插入新页面元素 - if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4) { // 插入到元素内头部、目标本身后面,需要合并后一起插入,否则会顺序相反 - let afterend = ''; - pageElems.forEach(function (one) {afterend += one.outerHTML;}); - toElement.insertAdjacentHTML(addTo, afterend); - } else if (curSite.pager.insertP[1] === 5) { // 插入到目标内部末尾(针对文本) + if (curSite.pager.insertP[1] === 5) { // 插入到目标内部末尾(针对文本,比如小说网页) let afterend = ''; pageElems.forEach(function (one) {afterend += one.innerHTML;}); toElement.insertAdjacentHTML(addTo, afterend); } else { + if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4) pageElems.reverse(); // 插入到 [元素内头部]、[目标本身后面] 时,需要反转顺序 pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo, one);}); } From 03446bb13d053db6913f8bf7cf7bbbe92e3718ff Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Nov 2021 23:55:02 +0800 Subject: [PATCH 0006/1647] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[Pixiv]=E3=80=81?= =?UTF-8?q?[W3school]=20=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 28c16cfe2..577e9c3d1 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.5.9 +// @version 3.6.0 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -1329,6 +1329,7 @@ forceTarget(); } else if (indexOF('/tags/') && self == top) { curSite = DBSite.pixiv; + if (indexOF('/novels')) {insStyle('ul[class*="-1 "] > li {display: inline !important;}')} else {insStyle('a[href^="/premium/lead/lp"], div[class*="-0 "] > div[class*="-4 "] > section:first-of-type {display: none}');} } else if (indexOF('/users/') && /\/(artworks|illustrations|manga)/.test(location.pathname)) { curSite = DBSite.pixiv_user; } else if (indexOF('/artworks/')) { @@ -1337,7 +1338,6 @@ }, forceTarget: true, iframe: true, - insStyle: 'div[class*="-0 "] > div[class*="-4 "] > section:first-of-type {display: none}', pager: { type: 6, nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', @@ -4006,13 +4006,13 @@ if (next && next.href.indexOf('/index.') === -1) return next.href; curSite = {SiteTypeID: 0}; return '' }, - pageE: 'css;#maincontent > *:not(.prenextnav):not(#bpn):not(#tpn)', - insertP: ['id("bpn") | //div[@class="prenextnav"][last()]', 1], + pageE: 'css;#maincontent > *:not([class*="prenextnav"]):not(#bpn):not(#tpn)', + insertP: ['id("bpn") | //div[contains(@class, "prenextnav")][last()]', 1], replaceE: 'css;ul.prenext, #navsecond, title', - scrollE: 'id("bpn") | //div[@class="prenextnav"][last()]', + scrollE: 'id("bpn") | //div[contains(@class, "prenextnav")][last()]', history: true, forceHTTPS: true, - scrollD: 500 + scrollD: 600 } }, // W3school runoob: { From 56998018fcd9cb002b6096fce3e548bf463392ad Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 12:46:58 +0800 Subject: [PATCH 0007/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=8F=92?= =?UTF-8?q?=E7=94=BB=E4=B8=96=E7=95=8C=20(vilipix)]=20=E6=94=AF=E6=8C=81;?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=20[Pixiv]=20=E8=A7=84=E5=88=99=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E6=A8=A1=E5=BC=8F;=20=E4=BC=98=E5=8C=96=20=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E6=A8=A1=E5=BC=8F=205=20(=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E6=95=88=E6=9E=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 128 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 95 insertions(+), 33 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 577e9c3d1..d9d8712aa 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.0 +// @version 3.6.1 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -1327,9 +1327,9 @@ functionStart: function() {locationChange = true; if (location.pathname == '/') { forceTarget(); - } else if (indexOF('/tags/') && self == top) { + } else if (indexOF('/tags/')/* && self == top*/) { curSite = DBSite.pixiv; - if (indexOF('/novels')) {insStyle('ul[class*="-1 "] > li {display: inline !important;}')} else {insStyle('a[href^="/premium/lead/lp"], div[class*="-0 "] > div[class*="-4 "] > section:first-of-type {display: none}');} + if (!indexOF('/novels'))insStyle('a[href^="/premium/lead/lp"], div[class*="-0 "] > div[class*="-4 "] > section:first-of-type {display: none}'); } else if (indexOF('/users/') && /\/(artworks|illustrations|manga)/.test(location.pathname)) { curSite = DBSite.pixiv_user; } else if (indexOF('/artworks/')) { @@ -1337,21 +1337,23 @@ } }, forceTarget: true, + hiddenPN: true, iframe: true, + insStyle: 'ul[class*="-1 "] > li {display: inline !important;} #root{margin-bottom: -175px;}', pager: { - type: 6, + type: 5, nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', pageE: '//ul[contains(@class, "-1 ")]/li', insertP: ['//ul[contains(@class, "-1 ")]', 3], replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, - loadTime: 1000, - scrollD: 1000 + scrollD: 2000 } }, // Pixiv - 分类页 pixiv_user: { forceTarget: true, hiddenPN: true, + insStyle: 'ul[class*="-1 "] > li {display: inline !important;} #root{margin-bottom: -125px;}', pager: { type: 5, nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', @@ -1362,6 +1364,27 @@ scrollD: 2000 } }, // Pixiv - 用户作品页 + vilipix: { + host: 'www.vilipix.com', + functionStart: function() {locationChange = true; + if (location.pathname == '/') { + forceTarget(); + } else if (indexOF('/tags/') || indexOF('/user/') || indexOF('/new') || indexOF('/ranking')) { + curSite = DBSite.vilipix; + } + }, + forceTarget: true, + pager: { + type: 6, + nextL: function() {let next = getCSS('li.number.active+li.number'); if (next) {return (location.origin + location.pathname + '?p=' + next.textContent)} else {return '';}}, + pageE: 'css;ul.illust-content > li', + insertP: ['css;ul.illust-content', 3], + replaceE: 'css;ul.el-pager', + history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, + loadTime: 800, + scrollD: 2000 + } + }, // vilipix _58pic: { host: 'www.58pic.com', functionStart: function() {insStyle('.qt-model-t.login-model {display: none !important;}'); @@ -4875,6 +4898,24 @@ } if (curSite.insStyle) insStyle(curSite.insStyle) + // 对翻页模式 5 的子 iframe 添加一个跟随滚动的事件 + if (curSite.pager.type === 5 && self != top) { + var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop + window.addEventListener('scroll', function (e) { + let scrollTop = window.parent.document.documentElement.scrollTop || window.parent.document.body.scrollTop, + clientHeight = window.parent.document.documentElement.clientHeight || window.parent.document.body.clientHeight, + scrollHeight = window.parent.document.documentElement.scrollHeight || window.parent.document.body.scrollHeight, + afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop, + delta = afterScrollTop - beforeScrollTop; + if (delta == 0) return false; + beforeScrollTop = afterScrollTop; + //console.log(delta, scrollHeight - (scrollTop + clientHeight), '2222') + if (delta > 0 && scrollTop + clientHeight < scrollHeight) { + window.parent.scrollBy(0, delta*2); + } + }, false); + } + curSite.pageUrl = ''; // 下一页URL //console.log(curSite); pageLoading(); // 自动无缝翻页 @@ -5778,7 +5819,10 @@ // <<<<< 翻页类型 5(插入 iframe 方式来加载下一页)>>>>> } else if (curSite.pager.type === 5) { if (typeof curSite.pager.nextL == 'function') { - curSite.pager.nextL(); + let tempUrl = curSite.pager.nextL(); + if (tempUrl === '' || curSite.pageUrl === tempUrl) return; + curSite.pageUrl = tempUrl; + insIframe(curSite.pageUrl); } else if (getE_nextL(curSite.pager.nextL)) { insIframe(curSite.pageUrl); } @@ -5786,7 +5830,10 @@ // <<<<< 翻页类型 6(通过 iframe 获取下一页动态加载内容)>>>>> } else if (curSite.pager.type === 6) { if (typeof curSite.pager.nextL == 'function') { - curSite.pager.nextL(); + let tempUrl = curSite.pager.nextL(); + if (tempUrl === '' || curSite.pageUrl === tempUrl) return; + curSite.pageUrl = tempUrl; + insIframe_(curSite.pageUrl); } else if (getE_nextL(curSite.pager.nextL)) { insIframe_(curSite.pageUrl); } @@ -5807,25 +5854,30 @@ // 翻页类型 5(插入 iframe 方式加载下一页) function insIframe(src) { // 停用当前页面翻页 + if (!pausePage) return curSite.SiteTypeID = 0; + pausePage = false + + var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop // 当滚动条到底部时(即完全显示 iframe 框架),隐藏当前页面的滚动条 - window.addEventListener('scroll', function (e) { + window.addEventListener('scroll', function () { let scrollTop = document.documentElement.scrollTop || document.body.scrollTop, + clientHeight = document.documentElement.clientHeight || document.body.clientHeight, scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight, - clientHeight = document.documentElement.clientHeight || document.body.clientHeight - if (scrollTop + clientHeight + 10 >= scrollHeight) { - if (!getCSS('#xiu-scroll')) { - let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll'; - newStyle.textContent = 'html::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html {scrollbar-width: none !important;}'; - if (curSite.pager.insStyle) newStyle.textContent += curSite.pager.insStyle; - document.lastElementChild.appendChild(newStyle); - } - } else { - if (getCSS('#xiu-scroll')) { - getCSS('#xiu-scroll').remove(); - } + afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop, + delta = afterScrollTop - beforeScrollTop; + if (delta == 0) return false; + beforeScrollTop = afterScrollTop; + + //console.log(delta, scrollHeight - (scrollTop + clientHeight + 10), '1111') + if (delta > 0 && scrollTop + clientHeight + 10 >= scrollHeight && !getCSS('#xiu-scroll')) { + let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll'; + newStyle.textContent = 'html::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html {scrollbar-width: none !important;}'; + if (curSite.pager.insStyle) newStyle.textContent += curSite.pager.insStyle; + document.lastElementChild.appendChild(newStyle); + } else if (delta < 0 && getCSS('#xiu-scroll')) { + getCSS('#xiu-scroll').remove(); } - //console.log(`${scrollTop} + ${clientHeight} >= ${scrollTop + clientHeight} / ${scrollHeight}`) }, false); // 创建 iframe @@ -5854,28 +5906,38 @@ pausePage = false // 如果不存在,则创建一个 iframe - let iframe = document.getElementById('xiu2_iframe'); + let iframe = document.getElementById('xiu_iframe'); if (!iframe) { iframe = document.createElement('iframe'); - iframe.style = 'position: absolute; width: 100%; height: 100%; border: none; display: none;'; - iframe.id = 'xiu2_iframe'; + iframe.style = 'position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border: none; z-index: -999; /*visibility: hidden;*/'; + iframe.id = 'xiu_iframe'; iframe.src = src; } // 加载完成后才继续 iframe.onload = function() { - iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件 + //iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件 //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'}); if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms - setTimeout(function() { - //console.log(getOne(curSite.pager.insertP[0], iframe.contentWindow.document)) - processResult(iframe.contentWindow.document); // 插入/替换元素等 - pausePage = true; // 恢复翻页 - }, curSite.pager.loadTime) // 预留加载时间,确保网页加载完成 + //console.log(curSite.pager.loadTime, curSite.pager.loadTime/30) + console.time('sort'); + let time1 = 0 ,time2 = setInterval(function(){ + let scrollHeight = (iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)/10 + iframe.contentWindow.scrollTo(0, 999999); + iframe.contentWindow.scrollTo(0, scrollHeight*time1); + //console.log(time1, iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight) + if (++time1 == 10) { + console.timeEnd('sort'); + clearInterval(time2); + processResult(iframe.contentWindow.document); // 插入/替换元素等 + //console.log(iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight) + pausePage = true; // 恢复翻页 + } + }, curSite.pager.loadTime/10) } // 插入 iframe(如果已存在则直接改 src) - if (document.getElementById('xiu2_iframe')) { + if (document.getElementById('xiu_iframe')) { iframe.src = src; } else { document.lastElementChild.appendChild(iframe); @@ -5950,7 +6012,7 @@ } - // 翻页类型 1/3 // 修改自 https://greasyfork.org/scripts/14178 、 https://github.com/machsix/Super-preloader + // 翻页类型 1/3 (修改自 https://greasyfork.org/scripts/14178 、 https://github.com/machsix/Super-preloader) var ShowPager = { getFullHref: function (e) { if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; From 46f4ec2f6477a5a73804563db585a38832a840c9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 13:18:31 +0800 Subject: [PATCH 0008/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Pixivision]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index d9d8712aa..191fbb7de 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.1 +// @version 3.6.2 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -1384,7 +1384,19 @@ loadTime: 800, scrollD: 2000 } - }, // vilipix + }, // Vilipix + pixivision: { + host: 'www.pixivision.net', + functionStart: function() {if (indexOF('/c/') || indexOF('/s/')) curSite = DBSite.pixivision;}, + pager: { + type: 1, + nextL: 'css;a.next', + pageE: 'css;li.article-card-container', + insertP: ['css;li.article-card-container:last-of-type', 4], + replaceE: 'css;._pager', + scrollD: 2000 + } + }, // Pixivision _58pic: { host: 'www.58pic.com', functionStart: function() {insStyle('.qt-model-t.login-model {display: none !important;}'); From 2d79bbc594dec4472f52702ac2671cf3891b7b25 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 14:50:52 +0800 Subject: [PATCH 0009/1647] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 2da272aeb..7d9a9073d 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.7.9 +// @version 1.8.0 // @author X.I.U // @description 移除登录弹窗、屏蔽首页视频、默认收起回答、快捷收起当前回答/评论(左键两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽用户 (发布的内容)、屏蔽关键词(标题/评论)、屏蔽盐选内容、净化标题消息、展开问题描述、置顶显示时间、完整问题时间、区分问题文章、直达问题按钮、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -604,7 +604,8 @@ function blockUsers(type) { for (const mutation of mutationsList) { for (const target of mutation.addedNodes) { if (target.nodeType != 1) return - if (target.className.indexOf('Popover-content Popover-content--top HoverCard-popoverTarget') > -1 || target.className.indexOf('Popover-content Popover-content--bottom HoverCard-popoverTarget') > -1 || target.querySelector('.Popover-content.Popover-content--top.HoverCard-popoverTarget') || target.querySelector('.Popover-content.Popover-content--bottom.HoverCard-popoverTarget')) { + console.log(target, target.className) + if (target.className && (target.className.indexOf('Popover-content Popover-content--top HoverCard-popoverTarget') > -1 || target.className.indexOf('Popover-content Popover-content--bottom HoverCard-popoverTarget') > -1) || target.querySelector('.Popover-content.Popover-content--top.HoverCard-popoverTarget') || target.querySelector('.Popover-content.Popover-content--bottom.HoverCard-popoverTarget')) { let item = target.querySelector('.MemberButtonGroup.ProfileButtonGroup.HoverCard-buttons'), item1 = target.querySelector('a.UserLink-link'), name = item1.textContent, From 4db7cab08633ee35c1384232358f9ccbb9bdf1f1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:09:00 +0800 Subject: [PATCH 0010/1647] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 7d9a9073d..1fcb15112 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -604,7 +604,7 @@ function blockUsers(type) { for (const mutation of mutationsList) { for (const target of mutation.addedNodes) { if (target.nodeType != 1) return - console.log(target, target.className) + //console.log(target, target.className) if (target.className && (target.className.indexOf('Popover-content Popover-content--top HoverCard-popoverTarget') > -1 || target.className.indexOf('Popover-content Popover-content--bottom HoverCard-popoverTarget') > -1) || target.querySelector('.Popover-content.Popover-content--top.HoverCard-popoverTarget') || target.querySelector('.Popover-content.Popover-content--bottom.HoverCard-popoverTarget')) { let item = target.querySelector('.MemberButtonGroup.ProfileButtonGroup.HoverCard-buttons'), item1 = target.querySelector('a.UserLink-link'), From e2f4e285ba5bea183bec6b67d181d5a644b5f05e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:39:24 +0800 Subject: [PATCH 0011/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E4=BA=8C?= =?UTF-8?q?=E6=89=8B=E8=BD=A6=E4=B9=8B=E5=AE=B6]=E3=80=81[=E7=9F=A5?= =?UTF-8?q?=E4=B9=8E]=E3=80=81[MM131=20-=20=E6=89=8B=E6=9C=BA=E7=89=88]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E3=80=81=E8=A1=A5=E5=85=85=20[MM131]=20?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 104 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 13 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 191fbb7de..c180aeeec 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.2 +// @version 3.6.3 // @author X.I.U -// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... +// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* // @connect www.xuexiniu.com // @connect bbs.xuexiniu.com @@ -702,6 +702,34 @@ scrollD: 1000 } }, // 豆瓣 - 小组帖子内 + zhihu: { + host: 'www.zhihu.com', + functionStart: function() {locationChange = true; if ((indexOF('/people/') && location.pathname.split('/').length == 4) || indexOF('/collection/')) curSite = DBSite.zhihu;}, + forceTarget: true, + hiddenPN: true, + iframe: true, + pager: { + type: 5, + nextL: function() { + let next = getCSS('.Pagination .PaginationButton--current+button:not(.PaginationButton-next)'); + if (next) return (location.origin + location.pathname + '?page=' + next.textContent) + }, + history: function() {if (/page=\d+/.test(location.search)) {return false;} else {return true;}}, + scrollD: 2000 + } + }, // 知乎 - 用户主页、收藏夹 + /*sciencedirect: { + host: 'www.sciencedirect.com', + functionStart: function() {if (location.pathname == '/search') curSite = DBSite.sciencedirect;}, + hiddenPN: true, + //iframe: true, + pager: { + type: 5, + nextL: 'css;a[data-aa-name="srp-next-page"]', + history: true, + scrollD: 2000 + } + },*/ // 知乎 - 用户主页、收藏夹 weibo_comment: { host: 'weibo.com', pager: { @@ -1343,9 +1371,9 @@ pager: { type: 5, nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', - pageE: '//ul[contains(@class, "-1 ")]/li', + /*pageE: '//ul[contains(@class, "-1 ")]/li', insertP: ['//ul[contains(@class, "-1 ")]', 3], - replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/ history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, scrollD: 2000 } @@ -1357,9 +1385,9 @@ pager: { type: 5, nextL: 'css;a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child', - pageE: '//ul[contains(@class, "-1 ")]/li', + /*pageE: '//ul[contains(@class, "-1 ")]/li', insertP: ['//ul[contains(@class, "-1 ")]', 3], - replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]', + replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/ history: function() {if (/p=\d+/.test(location.search)) {return false;} else {return true;}}, scrollD: 2000 } @@ -1376,7 +1404,7 @@ forceTarget: true, pager: { type: 6, - nextL: function() {let next = getCSS('li.number.active+li.number'); if (next) {return (location.origin + location.pathname + '?p=' + next.textContent)} else {return '';}}, + nextL: function() {let next = getCSS('li.number.active+li.number'); if (next) return (location.origin + location.pathname + '?p=' + next.textContent)}, pageE: 'css;ul.illust-content > li', insertP: ['css;ul.illust-content', 3], replaceE: 'css;ul.el-pager', @@ -4509,6 +4537,21 @@ scrollD: 1000 } }, // 如意了教育 - 试卷 + che168: { + host: 'www.che168.com', + functionStart: function() { + if (location.pathname != '/' && !indexOF('/dealer/')) { + curSite = DBSite.che168; + }}, + pager: { + type: 1, + nextL: 'css;a.page-item-next', + pageE: 'css;ul.viewlist_ul > li', + insertP: ['css;ul.viewlist_ul', 3], + replaceE: 'css;.page', + scrollD: 2000 + } + }, // 二手车之家 jiligamefun: { host: 'www.jiligamefun.com', functionStart: function() {if (indexOF('/category/')) {curSite = DBSite.jiligamefun;}}, @@ -4720,7 +4763,7 @@ } }, // 秀人集 - 搜索页 mm131: { - host: 'www.mm131.net', + host: ['www.mm131.net', 'www.mmm131.com'], functionStart: function() {if (indexOF('.html')) {curSite = DBSite.mm131;} else {curSite = DBSite.mm131_list;}}, pager: { type: 1, @@ -4741,6 +4784,41 @@ scrollD: 1000 } }, // MM131 - 分类页 + mm131_m: { + host: 'm.mmm131.com', + functionStart: function() {insStyle('.bannert, .bannerb, bannert_ios, .bannerb_ios {display: none !important;}'); if (location.pathname == '/') {curSite = DBSite.mm131_m_;} else if (indexOF('.html')) {curSite = DBSite.mm131_m;} else {curSite = DBSite.mm131_m_list;}}, + pager: { + type: 1, + nextL: '//div[@class="paging"]/a[text()="下一张" or text()="下一页"]', + pageE: 'css;.post-content img', + insertP: ['css;.post-content', 3], + replaceE: 'css;.paging', + scrollD: 2000 + } + }, // MM131 - 手机版 - 图片页 + mm131_m_list: { + pager: { + type: 1, + nextL: 'css;#xbtn', + pageE: 'css;#content > article', + insertP: ['css;#webpage', 1], + replaceE: 'css;#webpage', + scrollD: 2000 + }, + function: { + bF: src_bF, + pF: [0, 'img[data-img]', 'data-img'] + } + }, // MM131 - 手机版 - 分类页 + mm131_m_: { + pager: { + type: 2, + nextL: 'css;#webpage>span[onclick]', + isHidden: true, + interval: 500, + scrollD: 2000 + } + }, // MM131 - 手机版 - 首页 fnvshen: { host: 'www.fnvshen.com', functionStart: function() { @@ -5832,7 +5910,7 @@ } else if (curSite.pager.type === 5) { if (typeof curSite.pager.nextL == 'function') { let tempUrl = curSite.pager.nextL(); - if (tempUrl === '' || curSite.pageUrl === tempUrl) return; + if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl) return; curSite.pageUrl = tempUrl; insIframe(curSite.pageUrl); } else if (getE_nextL(curSite.pager.nextL)) { @@ -5843,7 +5921,7 @@ } else if (curSite.pager.type === 6) { if (typeof curSite.pager.nextL == 'function') { let tempUrl = curSite.pager.nextL(); - if (tempUrl === '' || curSite.pageUrl === tempUrl) return; + if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl ) return; curSite.pageUrl = tempUrl; insIframe_(curSite.pageUrl); } else if (getE_nextL(curSite.pager.nextL)) { @@ -5884,7 +5962,7 @@ //console.log(delta, scrollHeight - (scrollTop + clientHeight + 10), '1111') if (delta > 0 && scrollTop + clientHeight + 10 >= scrollHeight && !getCSS('#xiu-scroll')) { let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll'; - newStyle.textContent = 'html::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html {scrollbar-width: none !important;}'; + newStyle.textContent = 'html::-webkit-scrollbar, body::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html, body {scrollbar-width: none !important;}'; if (curSite.pager.insStyle) newStyle.textContent += curSite.pager.insStyle; document.lastElementChild.appendChild(newStyle); } else if (delta < 0 && getCSS('#xiu-scroll')) { @@ -5932,14 +6010,14 @@ //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'}); if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms //console.log(curSite.pager.loadTime, curSite.pager.loadTime/30) - console.time('sort'); + //console.time('sort'); let time1 = 0 ,time2 = setInterval(function(){ let scrollHeight = (iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)/10 iframe.contentWindow.scrollTo(0, 999999); iframe.contentWindow.scrollTo(0, scrollHeight*time1); //console.log(time1, iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight) if (++time1 == 10) { - console.timeEnd('sort'); + //console.timeEnd('sort'); clearInterval(time2); processResult(iframe.contentWindow.document); // 插入/替换元素等 //console.log(iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight) From c46f0247a0c2e73728b004e0dbb6f27908abf553 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 19:23:59 +0800 Subject: [PATCH 0012/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=BE=8E?= =?UTF-8?q?=E5=A5=B3=E5=9B=BE=E7=89=87]=E3=80=81[King=20=E7=88=B1=E6=A8=A1?= =?UTF-8?q?]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 77 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index c180aeeec..9e96667bf 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.3 +// @version 3.6.4 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -718,18 +718,6 @@ scrollD: 2000 } }, // 知乎 - 用户主页、收藏夹 - /*sciencedirect: { - host: 'www.sciencedirect.com', - functionStart: function() {if (location.pathname == '/search') curSite = DBSite.sciencedirect;}, - hiddenPN: true, - //iframe: true, - pager: { - type: 5, - nextL: 'css;a[data-aa-name="srp-next-page"]', - history: true, - scrollD: 2000 - } - },*/ // 知乎 - 用户主页、收藏夹 weibo_comment: { host: 'weibo.com', pager: { @@ -4244,6 +4232,18 @@ scrollD: 2000 } }, // 学术 + /*sciencedirect: { + host: 'www.sciencedirect.com', + functionStart: function() {if (location.pathname == '/search') curSite = DBSite.sciencedirect;}, + hiddenPN: true, + iframe: true, + pager: { + type: 5, + nextL: 'css;a[data-aa-name="srp-next-page"]', + history: true, + scrollD: 2000 + } + },*/ // 学术 google_scholar: { pager: { type: 1, @@ -4892,7 +4892,7 @@ replaceE: 'css;.page', scrollD: 3000 } - }, // 秀人美女网 - 图片页 + }, // 秀人美女 - 图片页 xrmn5_list: { pager: { type: 1, @@ -4902,7 +4902,7 @@ replaceE: 'css;.page', scrollD: 2000 } - }, // 秀人美女网 - 分类页 + }, // 秀人美女 - 分类页 xrmn5_search: { pager: { type: 1, @@ -4912,7 +4912,52 @@ replaceE: 'css;.page', scrollD: 2000 } - } // 秀人美女网 - 搜索页 + }, // 秀人美女 - 搜索页 + ku66: { + host: 'www.ku66.net', + functionStart: function() {if (/\/\d+\.html/.test(location.pathname)) {curSite = DBSite.ku66;} else {curSite = DBSite.ku66_list;}}, + insStyle: '.content img {min-height: 300px;}', + pager: { + type: 1, + nextL: '//div[@class="NewPages"]//a[text()="下一页"]', + pageE: 'css;.content > img', + insertP: ['css;.content', 3], + replaceE: 'css;.NewPages', + scrollD: 4000 + } + }, // 美女图片 - 图片页 + ku66_list: { + pager: { + type: 1, + nextL: '//div[@class="NewPages"]//a[text()="下一页"]', + pageE: 'css;.TypeList > ul > li', + insertP: ['css;.TypeList > ul', 3], + replaceE: 'css;.NewPages', + scrollD: 1000 + } + }, // 美女图片 - 分类页 + kingdom: { + host: ['kingdom-en.com', 'www.kingdom-en.com'], + functionStart: function() {if (indexOF('/meinvtupian/')) {curSite = DBSite.kingdom;} else {curSite = DBSite.kingdom_list;}}, + pager: { + type: 1, + nextL: 'css;a.page_next', + pageE: 'css;.pic_center img', + insertP: ['css;.pic_center', 3], + replaceE: 'css;.pages2', + scrollD: 4000 + } + }, // King爱模 - 图片页 + kingdom_list: { + pager: { + type: 1, + nextL: function() {return(getCSS('a.page_next').href.replace(/(www.)?ermo.net/, location.host).replace(/http(s)?:/, location.protocol))}, + pageE: 'css;.channel_list3 > ul > li', + insertP: ['css;.channel_list3 > ul', 3], + replaceE: 'css;.pages', + scrollD: 1000 + } + } // King爱模 - 分类页 }; // 生成 SiteTypeID setSiteTypeID(); From 2a240b9dde85cd7e4f4eece94b5a485848244fbd Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Nov 2021 21:41:18 +0800 Subject: [PATCH 0013/1647] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[MM131]=E3=80=81?= =?UTF-8?q?[King=E7=88=B1=E6=A8=A1]=20=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 9e96667bf..2094862f7 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.4 +// @version 3.6.5 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -83,6 +83,7 @@ functionStart: 匹配该网站域名时要执行的函数(一般用于根据 URL 分配相应翻页规则) insStyle: 要插入网页的 CSS Style 样式 hiddenPN: 不显示脚本左下角的页码 + retry: 允许获取失败后重试 type: 1 = 由脚本实现自动无缝翻页 @@ -1884,6 +1885,7 @@ bilibili_search: { host: 'search.bilibili.com', functionStart: function() {locationChange = true; curSite = DBSite.bilibili_search;}, + retry: 100, pager: { type: 1, nextL: bilibili_search_nextL, @@ -4765,12 +4767,14 @@ mm131: { host: ['www.mm131.net', 'www.mmm131.com'], functionStart: function() {if (indexOF('.html')) {curSite = DBSite.mm131;} else {curSite = DBSite.mm131_list;}}, + retry: 300, pager: { type: 1, nextL: '//div[@class="content-page"]/a[contains(text(), "下一页")]', pageE: 'css;.content-pic img', insertP: ['css;.content-pic', 3], replaceE: 'css;.content-page', + history: true, scrollD: 2000 } }, // MM131 - 图片页 @@ -4787,12 +4791,14 @@ mm131_m: { host: 'm.mmm131.com', functionStart: function() {insStyle('.bannert, .bannerb, bannert_ios, .bannerb_ios {display: none !important;}'); if (location.pathname == '/') {curSite = DBSite.mm131_m_;} else if (indexOF('.html')) {curSite = DBSite.mm131_m;} else {curSite = DBSite.mm131_m_list;}}, + retry: true, pager: { type: 1, nextL: '//div[@class="paging"]/a[text()="下一张" or text()="下一页"]', pageE: 'css;.post-content img', insertP: ['css;.post-content', 3], replaceE: 'css;.paging', + history: true, scrollD: 2000 } }, // MM131 - 手机版 - 图片页 @@ -4937,14 +4943,15 @@ } }, // 美女图片 - 分类页 kingdom: { - host: ['kingdom-en.com', 'www.kingdom-en.com'], - functionStart: function() {if (indexOF('/meinvtupian/')) {curSite = DBSite.kingdom;} else {curSite = DBSite.kingdom_list;}}, + host: ['kingdom-en.com', 'www.kingdom-en.com', 'm.kingdom-en.com'], + functionStart: function() {if (/\/\d+\.html/.test(location.pathname)) {curSite = DBSite.kingdom;} else {curSite = DBSite.kingdom_list;}}, + insStyle: '.pic_center img {min-height: 300px;} .arcmain > .title, .footer, .index-list-title, .listmain_st {display: none !important;}', pager: { type: 1, - nextL: 'css;a.page_next', + nextL: '//a[@class="page_next"] | //div[@class="article_page"]//a[text()="下一页"]', pageE: 'css;.pic_center img', insertP: ['css;.pic_center', 3], - replaceE: 'css;.pages2', + replaceE: '//div[@class="pages2" or @class="article_page"]', scrollD: 4000 } }, // King爱模 - 图片页 @@ -4952,9 +4959,9 @@ pager: { type: 1, nextL: function() {return(getCSS('a.page_next').href.replace(/(www.)?ermo.net/, location.host).replace(/http(s)?:/, location.protocol))}, - pageE: 'css;.channel_list3 > ul > li', - insertP: ['css;.channel_list3 > ul', 3], - replaceE: 'css;.pages', + pageE: 'css;.channel_list3 > ul > li, ul#container > li', + insertP: ['css;.channel_list3 > ul, ul#container', 3], + replaceE: 'css;.pages, .list_page', scrollD: 1000 } } // King爱模 - 分类页 @@ -4963,8 +4970,7 @@ setSiteTypeID(); // 用于脚本判断(针对部分特殊的网站) SiteType = { - BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID, - BILIBILI_SEARCH: DBSite.bilibili_search.SiteTypeID + BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID }; } @@ -6277,7 +6283,7 @@ } } } else { // 获取主体元素失败后,尝试重新获取 - if (curSite.SiteTypeID === SiteType.BILIBILI_SEARCH) {curSite.pageUrl = '';} + setTimeout(function(){if (curSite.retry) {curSite.pageUrl = '';}}, curSite.retry) } } // 翻页类型 4 From 23ce67ffddcab6927b3eee0edd696577c18be384 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 24 Nov 2021 12:02:37 +0800 Subject: [PATCH 0014/1647] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[iconfont]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81;=20=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20(=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E7=9B=B8=E5=85=B3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 592 +++++++++++++++++++++++++---------------------- 1 file changed, 312 insertions(+), 280 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 2094862f7..6a5166e71 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 3.6.5 +// @version 3.6.6 // @author X.I.U // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、Pixiv、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、片库、茶杯狐、NO视频、低端影视、奈菲影视、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画 DB、动漫之家、拷贝漫画、包子漫画、古风漫画网、Mangabz、PubMed、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了... // @match *://*/* @@ -78,57 +78,66 @@ function setDBSite() { /* 自动翻页规则 - locationChange: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(只能放在 functionStart 中) + locationChange: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(需要放在 functionS 中) - functionStart: 匹配该网站域名时要执行的函数(一般用于根据 URL 分配相应翻页规则) - insStyle: 要插入网页的 CSS Style 样式 - hiddenPN: 不显示脚本左下角的页码 - retry: 允许获取失败后重试 + functionS: 匹配该网站域名时要执行的函数(一般用于根据 URL 分配相应翻页规则) + insStyle: 要插入网页的 CSS Style 样式 + hiddenPN: 不显示脚本左下角的页码 + history: 添加历史记录 并 修改当前 URL + retry: 允许获取失败后重试 type: - 1 = 由脚本实现自动无缝翻页 - 2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可 - nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页) - nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页) - nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页) - interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms) - isHidden: 只有下一页按钮可见时(没有隐藏),才会点击 - 3 = 依靠元素距离可视区域底部的距离来触发翻页 - scrollE: 作为基准的元素(一般为底部页码元素) - scrollD: = 基准元素 - 可视区域底部 - 4 = 动态加载类网站(只能实现简单的) - insertE: 插入元素的函数 - 5 = 插入 iframe 方式来加载下一页 - insStyle: 加载 iframe 前要插入的 CSS Style 样式 - iframe: 这个必须加到 page{} 外面 - forceTarget:强制新标签页打开链接 - 6 = 通过 iframe 获取下一页动态加载内容 - loadTime: 预留的网页加载时间,确保网页加载完成 - forceTarget:强制新标签页打开链接 - nextL: 下一页链接所在元素 - pageE: 要获取的主体内容 - insertP: 主体内容插入的位置 - 1 = 插入该元素本身的前面; - 2 = 插入该元素当中,第一个子元素前面; - 3 = 插入该元素当中,最后一个子元素后面; - 4 = 插入该元素本身的后面; - 5 = 插入该元素末尾(针对小说网站等文本类的) + 1 = 由脚本实现自动无缝翻页(适用于:静态加载内容网站,常规模式) + + 2 = 只需要点击下一页按钮(适用于:网站自带了 自动无缝翻页 功能) + nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同) + nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页 + nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页 + interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms,默认 300,当指定上面三个时,会忽略 interval) + isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击 + + 3 = 依靠 [指定元素] 与 [可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时) + scrollE: 作为基准线的元素(一般为底部页码元素) + scrollD: 基准元素 - 可视区域底部 + + 4 = 动态加载类网站(适用于:简单的动态加载内容网站) + insertE: 用来插入元素的函数 + + 5 = 插入 iframe 方式来加载下一页,无限套娃(适用于:部分动态加载内容的网站,需要允许 iframe 且支持通过 GET/POST 直接打开下一页) + insStyle: 加载 iframe 前要插入的 CSS Style 样式 + iframe: 这个必须加到 page{} 外面 + forceTarget: 强制新标签页打开链接 + + 6 = 通过 iframe 获取下一页动态加载内容插入本页,只有一个娃(适用于:部分动态加载内容的网站,与上面不同的是,该模式适合简单的网页) + loadTime: 预留的网页加载时间,确保网页内容加载完成 + forceTarget: 强制新标签页打开链接 + + nextL: 下一页链接所在元素 + pageE: 要获取的主体内容 + insertP: 主体内容插入的位置 + 1 = 插入该元素本身的前面; + 2 = 插入该元素当中,第一个子元素前面; + 3 = 插入该元素当中,最后一个子元素后面; + 4 = 插入该元素本身的后面; + 5 = 插入该元素末尾(针对小说网站等文本类的) + replaceE: 要替换为下一页内容的元素(比如页码) - scriptT: 单独插入