Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 68 additions & 13 deletions Autopage.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 自动无缝翻页
// @version 2.3.3
// @version 2.3.8
// @author X.I.U
// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了...
// @match *://*/*
Expand All @@ -14,7 +14,6 @@
// @grant GM_setValue
// @grant GM_notification
// @grant unsafeWindow
// @noframes
// @license GPL-3.0 License
// @run-at document-end
// @namespace https://github.com/XIU2/UserScript
Expand Down Expand Up @@ -53,7 +52,9 @@
webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
if (webType === 0) {
GM_registerMenuCommand('❌ 当前网站暂不支持 [点击申请支持]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
console.info('[自动无缝翻页] - 不支持当前网站,欢迎申请支持:https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/96880/feedback');
console.info('[自动无缝翻页] - 不支持当前网站 [ ' + location.href + ' ],欢迎申请支持: https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/96880/feedback');
return
} else if (webType === -1) {
return
}
menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
Expand Down Expand Up @@ -483,8 +484,10 @@
}, // 微博评论
nga_thread: {
SiteTypeID: 0,
host: 'bbs.nga.cn',
functionStart: function() {if (location.pathname === '/thread.php') { // 帖子列表
host: ['bbs.nga.cn', 'ngabbs.com', 'nga.178.com', 'g.nga.cn'],
iframe: true,
functionStart: function() {locationchange = true;
if (location.pathname === '/thread.php') { // 帖子列表
curSite = DBSite.nga_thread;
} else if (location.pathname === '/read.php') { // 帖子内
curSite = DBSite.nga_read;
Expand All @@ -506,7 +509,7 @@
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;#pagebbtm a[title="下一页"][href]',
nextLink: 'css;#pagebbtm a[title*="下一页"][href]',
pageElement: 'id("m_posts_c")/table | id("m_posts_c")/script | //script[contains(text(), "commonui.userInfo.setAll")]',
insertPosition: ['css;#m_posts_c', 3],
replaceE: 'css;div[name="pageball"]',
Expand Down Expand Up @@ -1289,7 +1292,7 @@
}, // SkrBT
rarbgprx: {
SiteTypeID: 0,
host: 'rarbgprx.org',
host: /rarbg/,
functionStart: function() {if (location.pathname === '/torrents.php') {curSite = DBSite.rarbgprx;}},
pager: {
type: 1,
Expand Down Expand Up @@ -1408,7 +1411,7 @@
mimeType: 'text/html; charset=gb2312',
scrollDelta: 900
}
}, // 宝书网(小说)
}, // 宝书网(小说)
baoshuu_m: {
SiteTypeID: 0,
host: 'm.baoshuu.com',
Expand All @@ -1422,7 +1425,7 @@
mimeType: 'text/html; charset=gb2312',
scrollDelta: 900
}
}, // 宝书网(小说)- 手机版
}, // 宝书网(小说)- 手机版
qidian: {
SiteTypeID: 0,
host: 'www.qidian.com',
Expand All @@ -1435,7 +1438,7 @@
replaceE: 'css;#page-container',
scrollDelta: 900
}
}, // 起点小说
}, // 起点小说
qidian_read: {
SiteTypeID: 0,
host: 'read.qidian.com',
Expand All @@ -1449,7 +1452,55 @@
history: true,
scrollDelta: 900
}
}, // 起点小说 - 阅读页
}, // 起点小说 - 阅读页
linovelib: {
SiteTypeID: 0,
host: 'www.linovelib.com',
functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) {
curSite = DBSite.linovelib;
} else if (location.pathname.indexOf('/wenku/') > -1) {
curSite = DBSite.linovelib_wenku;
} else if (location.pathname.indexOf('/top/') > -1 || location.pathname.indexOf('/topfull/') > -1 || location.pathname.indexOf('toplist.php') > -1) {
curSite = DBSite.linovelib_top;
}},
pager: {
type: 1,
nextLink: '//p[@class="mlfy_page"]/a[@href][contains(text(), "下一页") or contains(text(), "下一章")]',
pageElement: 'css;#mlfy_main_text > *',
insertPosition: ['css;#mlfy_main_text', 3],
replaceE: 'css;p.mlfy_page, head > title',
history: true,
scrollDelta: 1000
}
}, // 哔哩轻小说
linovelib_wenku: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;#pagelink > a.next[href]',
pageElement: 'css;.store_collist > div.bookbox',
insertPosition: ['css;.store_collist', 3],
replaceE: 'css;#pagelink',
scrollDelta: 1000
},
function: {
before: src_original_functionBefore
}
}, // 哔哩轻小说 - 文库
linovelib_top: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;#pagelink > a.next[href]',
pageElement: 'css;.rankpage_box > div.rank_d_list',
insertPosition: ['css;div.pages', 1],
replaceE: 'css;#pagelink',
scrollDelta: 1000
},
function: {
before: src_original_functionBefore
}
}, // 哔哩轻小说 - 全本
_423down: {
SiteTypeID: 0,
host: 'www.423down.com',
Expand Down Expand Up @@ -2052,10 +2103,10 @@
pager: {
type: 1,
nextLink: '//div[@class="paginate-container"]//a[@href][contains(text(), "Next")]',
pageElement: 'css;#js-pjax-container .position-relative .col-lg-12 > div:not(.position-relative):not(.paginate-container)',
pageElement: 'css;#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
insertPosition: ['css;.paginate-container', 1],
replaceE: 'css;.paginate-container',
scrollDelta: 2000
scrollDelta: 2500
}
}, // Github - 用户 Star 列表
github_issues: {
Expand Down Expand Up @@ -3580,6 +3631,7 @@
}
} else if (DBSite[now].host instanceof RegExp) {
if (DBSite[now].host.test(location.host)) {
if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
if (DBSite[now].functionStart) {
DBSite[now].functionStart();
} else {
Expand All @@ -3588,6 +3640,7 @@
support = true; break; // 如果找到了就退出循环
}
} else if (DBSite[now].host === location.host) {
if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
if (DBSite[now].functionStart) {
DBSite[now].functionStart();
} else {
Expand All @@ -3605,6 +3658,8 @@
console.info('[自动无缝翻页] - Flarum 论坛'); return 3;
} else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4;
} else if (self != top) {
return -1;
}
return 0;
}
Expand Down