Skip to content

Commit 78aa735

Browse files
committed
回调 [动漫屋] 规则(网站TM回调了,浪费我时间)
1 parent ad2d019 commit 78aa735

2 files changed

Lines changed: 63 additions & 29 deletions

File tree

Autopage.user.js

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 自动无缝翻页
44
// @name:zh-TW 自動無縫翻頁
55
// @name:en AutoPager
6-
// @version 6.5.0
6+
// @version 6.5.1
77
// @author X.I.U
88
// @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、B 站(bilibili)、NGA、V2EX、煎蛋网、龙的天空、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、动漫屋、漫画猫、漫画屋、漫画 DB、动漫之家、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
99
// @description:zh-TW ⭐無縫加載 下一頁內容 至網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
@@ -456,7 +456,7 @@
456456
blank: 强制新标签页打开链接
457457
1 = 网页 <head> 添加 <base target="_blank"> 来让所有链接默认新标签页打开(对已单独指定 target 或已监听点击事件的元素无效)
458458
2 = 对 <body> 委托点击事件
459-
3 = 对 pageE 的父元素 委托点击事件
459+
3 = 对 pageE 的父元素 委托点击事件(也会阻止冒泡,但因为距离 <a> 标签较远,因此只有在委托点击事件的元素是 pageE 的父元素的父元素时,才有意义)
460460
4 = 对 pageE 的子元素 <a> 标签 添加 target="_blank"
461461
5 = 对 pageE 的子元素 <a> 标签 清理事件后 再添加 target="_blank"
462462
6 = 对 pageE 的子元素 <a> 标签 清理事件后 再添加 target="_blank" 并阻止冒泡(避免父元素事件委托捕获该元素的点击事件)
@@ -1054,6 +1054,26 @@ function: {
10541054
scrollD: 800
10551055
}
10561056
}, // Mangabz 漫画 - 分类/搜索页
1057+
dm5: {
1058+
host: 'www.dm5.com',
1059+
url: ()=> {if (indexOF(/\/m\d+/)) {
1060+
setTimeout(mangabz_init, 1500);
1061+
curSite = DBSite.dm5;
1062+
} else if (indexOF('/manga-list') || lp == '/search' || getCSS('.box-body > ul.mh-list > li')) {
1063+
curSite = DBSite.mangabz_list;
1064+
} else if (getCSS('.detail-more')) {
1065+
getCSS('.detail-more').click();
1066+
}},
1067+
style: '.view-paging > .container, .view-comment {display: none !important;} .rightToolBar {opacity: 0.3 !important;} #cp_img > img, #barChapter > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;} body {overflow: auto !important;}',
1068+
pager: {
1069+
type: 4,
1070+
nextL: dm5_nextL,
1071+
insertP: ['#barChapter,#cp_img', 3],
1072+
insertE: dm5_insertE,
1073+
replaceE: '.view-paging > .container, .rightToolBar',
1074+
interval: 500
1075+
}
1076+
}, // 动漫屋
10571077
xmanhua: {
10581078
host: ['xmanhua.com', 'www.xmanhua.com'],
10591079
url: ()=> {if (indexOF(/\/m\d+/)) {
@@ -1707,6 +1727,45 @@ function: {
17071727
}
17081728

17091729

1730+
// [动漫屋] 获取下一页地址
1731+
function dm5_nextL() {
1732+
var url = '';
1733+
if (DM5_PAGE === DM5_IMAGE_COUNT) { // 下一话
1734+
if (getNextE('//div[@class="view-paging"]//a[text()="下一章"]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
1735+
} else { // 下一页
1736+
if (!mkey) var mkey = '';
1737+
url = location.origin + location.pathname + 'chapterfun.ashx' + `?cid=${DM5_CID}&page=${DM5_PAGE + 1}&key=${(mkey)}&language=1&gtk=6&_cid=${DM5_CID}&_mid=${DM5_MID}&_dt=${DM5_VIEWSIGN_DT}&_sign=${DM5_VIEWSIGN}`
1738+
if (url === curSite.pageUrl) return
1739+
curSite.pageUrl = url
1740+
//console.log(curSite.pageUrl)
1741+
getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
1742+
}
1743+
}
1744+
// [动漫屋] 插入数据
1745+
function dm5_insertE(pageE, type) {
1746+
if (pageE) {
1747+
if (type === 'Next') { // 下一页
1748+
let imgArr = eval(pageE),
1749+
_img = '';
1750+
for (let now of imgArr) {_img += `<img src="${now}">`;}
1751+
if (_img) {
1752+
getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
1753+
DM5_PAGE += imgArr.length;
1754+
addHistory(pageE, document.title, location.origin + DM5_CURL.substring(0, DM5_CURL.length - 1) + '-p' + DM5_PAGE + '/');
1755+
}
1756+
} else { // 下一话
1757+
// 插入 <script> 标签
1758+
insScript('html:not([dir])>head>script:not([src])', pageE);
1759+
addHistory(pageE);
1760+
pageNum.now = pageNum._now + 1
1761+
replaceElems(pageE)
1762+
DM5_PAGE = 0;
1763+
dm5_nextL();
1764+
}
1765+
}
1766+
}
1767+
1768+
17101769
// [Xmanhua 漫画] 获取下一页地址
17111770
function xmanhua_nextL() {
17121771
var url = '';
@@ -2535,7 +2594,7 @@ function: {
25352594
if (!pageE) pageE = getAll(curSite.pager.pageE)
25362595
pageE.forEach(function (dd) {
25372596
getAllCSS('a[href]:not([target="_blank"]):not([onclick]):not([href^="#"]):not([href^="javascript:"])',dd).forEach(function (a) {
2538-
if (a.href.slice(0,4) == 'http' && a.getAttribute('href').slice(0,1) != '#') {
2597+
if (a.href.slice(0,4) == 'http') {
25392598
const clonedLink = a.cloneNode(true); // 克隆原 a 元素
25402599
clonedLink.target = '_blank'; // 通过添加 target="_blank" 属性来新标签页打开,可以解决大部分情况
25412600
if (curSite.blank === 6) clonedLink.addEventListener('click', function(e) {e.stopPropagation();}); // 如果添加 target="_blank" 属性无效(依然在当前网页跳转打开),那么说明其父元素的事件委托中阻止了默认打开链接事件,因此对该 <a> 元素添加点击事件并阻止冒泡(避免父元素事件委托捕获该元素的点击事件)
@@ -2548,7 +2607,7 @@ function: {
25482607

25492608
} else if (curSite.blank === 4) {
25502609
if (!pageE) pageE = getAll(curSite.pager.pageE)
2551-
pageE.forEach(function (dd) {getAllCSS('a[href]:not([target="_blank"]):not([onclick]):not([href^="#"]):not([href^="javascript:"])',dd).forEach(function (a) {if (a.href.slice(0,4) == 'http' && a.getAttribute('href').slice(0,1) != '#') {a.target = '_blank';}});});
2610+
pageE.forEach(function (dd) {getAllCSS('a[href]:not([target="_blank"]):not([onclick]):not([href^="#"]):not([href^="javascript:"])',dd).forEach(function (a) {if (a.href.slice(0,4) == 'http') {a.target = '_blank';}});});
25522611
return pageE
25532612

25542613
} else {

other/Autopage/rules.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2977,31 +2977,6 @@
29772977
"bF": "return fun.src_bF(pageE, [0,'img[data-srcset]','data-srcset'])"
29782978
}
29792979
},
2980-
"动漫屋": {
2981-
"host": "www.dm5.com",
2982-
"url": "/^\\/m\\d+\\//",
2983-
"history": true,
2984-
"style": ".view-comment {display: none !important;} .rightToolBar {opacity: 0.3 !important;} #barChapter>img {display: block !important;}",
2985-
"pager": {
2986-
"nextL": "//div[@class='view-paging']//a[text()='下一章']",
2987-
"pageE": "#barChapter>img",
2988-
"replaceE": ".view-paging, .rightToolBar",
2989-
"interval": 4000
2990-
},
2991-
"function": {
2992-
"bF": "return fun.src_bF(pageE)"
2993-
}
2994-
},
2995-
"动漫屋 - 分类页": {
2996-
"host": "www.dm5.com",
2997-
"url": "if(fun.indexOF('/manga-list') || fun.lp() == '/search' || fun.getCSS('.box-body>ul.mh-list>li')){return true}else if(fun.getCSS('.detail-more')){fun.getCSS('.detail-more').click()}",
2998-
"blank": 3,
2999-
"pager": {
3000-
"nextL": "//div[contains(@class,'page-pagination')]//a[contains(text(), '>')]",
3001-
"pageE": "ul.mh-list>li",
3002-
"replaceE": ".page-pagination"
3003-
}
3004-
},
30052980
"动漫啦 - 分类页": {
30062981
"host": "www.dongman.la",
30072982
"url": "if (fun.indexOF('/detail/')) {setTimeout(()=>{fun.getCSS('a#zhankai').click();},500)} else if (fun.indexOF('/manhua/')) {return true}",

0 commit comments

Comments
 (0)