-
Notifications
You must be signed in to change notification settings - Fork 620
/
Autopage.user.js
2897 lines (2731 loc) · 176 KB
/
Autopage.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name 自动无缝翻页
// @name:zh-CN 自动无缝翻页
// @name:zh-TW 自動無縫翻頁
// @name:en AutoPager
// @version 6.6.42
// @author X.I.U
// @description ⭐无缝加载 下一页内容 至网页底部(类似瀑布流,无限滚动,无需手动点击下一页)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、MyBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、NGA、V2EX、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、动漫屋、漫画猫、漫画屋、漫画 DB、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分常见网站,更多的写不下了...
// @description:zh-TW ⭐無縫加載 下一頁內容 至網頁底部(類似瀑布流,无限滚动,無需手働點擊下一頁)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
// @description:en Append the next page content to the bottom seamlessly (like a waterfall, Unlimited scrolling, no need to manually click on the next page)~
// @match *://*/*
// @connect userscript.xiu2.xyz
// @connect userscript.xiu2.us.kg
// @connect userscript.h233.eu.org
// @connect bitbucket.org
// @connect js.cdn.haah.net
// @connect raw.ixnic.net
// @connect raw.nuaa.cf
// @connect raw.yzuu.cf
// @connect raw.kkgithub.com
// @connect raw.incept.pw
// @connect gitdl.cn
// @connect ghproxy.cc
// @connect ghproxy.net
// @connect ghp.ci
// @connect github.moeyy.xyz
// @connect jsd.onmicrosoft.cn
// @connect gcore.jsdelivr.net
// @connect fastly.jsdelivr.net
// @connect cdn.jsdmirror.com
// @connect jsd.proxy.aks.moe
// @connect jsdelivr.pai233.top
// @connect www.xuexiniu.com
// @connect bbs.xuexiniu.com
// @connect weili.ooopic.com
// @connect www.ykmh.com
// @icon data:image/png;base64,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
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @grant GM_openInTab
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_notification
// @grant GM_info
// @grant GM.info
// @grant window.onurlchange
// @grant unsafeWindow
// @sandbox JavaScript
// @license GPL-3.0 License
// @run-at document-end
// @namespace https://github.com/XIU2/UserScript
// @supportURL https://github.com/XIU2/UserScript
// @homepageURL https://github.com/XIU2/UserScript
// @exclude https://*.taobao.com/*
// @exclude https://*.tmall.com/*
// @exclude https://*.1688.com/*
// @exclude https://*.jd.com/*
// @exclude https://*.vip.com/*
// @exclude https://*.suning.com/*
// @exclude https://*.aliexpress.com/*
// @exclude https://*.paypal.com/*
// @exclude https://*.iqiyi.com/*
// @exclude https://*.youku.com/*
// @exclude https://m.v.qq.com/*
// @exclude https://v.qq.com/*
// @exclude https://*.acfun.cn/*
// @exclude https://t.bilibili.com/*
// @exclude https://www.bilibili.com/*
// @exclude https://live.bilibili.com/*
// @exclude https://space.bilibili.com/*
// @exclude https://manga.bilibili.com/*
// @exclude https://member.bilibili.com/*
// @exclude https://message.bilibili.com/*
// @exclude https://*.youtube.com/*
// @exclude https://*.youtube-nocookie.com/*
// @exclude https://*.cnki.net/*
// @exclude https://mail.qq.com/*
// @exclude https://weread.qq.com/*
// @exclude https://*.weread.qq.com/*
// @exclude https://www.qidian.com/chapter/*
// @exclude https://bz.zzzmh.cn/*
// @exclude https://wallhaven.cc/*
// @exclude https://chrome.zzzmh.cn/*
// @exclude https://*.guazi.com/*
// @exclude https://*.liepin.com/*
// @exclude https://*.58.com/*
// ==/UserScript==
(function() {
'use strict';
const urlArr = [ // 外置翻页规则更新地址分流,以确保更新成功率(记得 connect)
'https://userscript.h233.eu.org/other/Autopage/rules.json',
'https://userscript.xiu2.us.kg/other/Autopage/rules.json',
'https://bitbucket.org/xiu2/userscript/raw/master/other/Autopage/rules.json',
'https://raw.kkgithub.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://gitdl.cn/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://raw.incept.pw/XIU2/UserScript/master/other/Autopage/rules.json',
'https://raw.ixnic.net/XIU2/UserScript/master/other/Autopage/rules.json',
//'https://raw.nuaa.cf/XIU2/UserScript/master/other/Autopage/rules.json',
//'https://raw.yzuu.cf/XIU2/UserScript/master/other/Autopage/rules.json',
'https://ghproxy.cc/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://ghproxy.net/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://ghp.ci/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://github.moeyy.xyz/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://jsd.onmicrosoft.cn/gh/XIU2/UserScript/other/Autopage/rules.json',
//'https://gcore.jsdelivr.net/gh/XIU2/UserScript/other/Autopage/rules.json',
'https://fastly.jsdelivr.net/gh/XIU2/UserScript/other/Autopage/rules.json',
'https://cdn.jsdmirror.com/gh/XIU2/UserScript/other/Autopage/rules.json',
'https://jsd.proxy.aks.moe/gh/XIU2/UserScript/other/Autopage/rules.json',
'https://jsdelivr.pai233.top/gh/XIU2/UserScript/other/Autopage/rules.json',
'https://js.cdn.haah.net/gh/XIU2/UserScript/other/Autopage/rules.json',
], urlArr2 = [
'https://userscript.h233.eu.org/other/Autopage/rules.json',
'https://userscript.xiu2.us.kg/other/Autopage/rules.json',
'https://userscript.xiu2.xyz/other/Autopage/rules.json',
'https://bitbucket.org/xiu2/userscript/raw/master/other/Autopage/rules.json',
'https://raw.kkgithub.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://gitdl.cn/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://raw.ixnic.net/XIU2/UserScript/master/other/Autopage/rules.json',
//'https://raw.nuaa.cf/XIU2/UserScript/master/other/Autopage/rules.json',
//'https://raw.yzuu.cf/XIU2/UserScript/master/other/Autopage/rules.json',
'https://ghproxy.net/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://ghp.ci/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
'https://github.moeyy.xyz/https://raw.githubusercontent.com/XIU2/UserScript/master/other/Autopage/rules.json',
],
loadMoreExclude1 = ['.smzdm.com','stackoverflow.com'],
loadMoreExclude2 = ['.steampowered.com','.zcool.com.cn'];
var menuAll = [
['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []],
['menu_thread', '帖子内自动翻页 (社区类网站)', '帖子内自动翻页 (社区类网站)', true],
['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true],
['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false],
['menu_history', '添加历史记录+修改地址/标题', '添加历史记录+修改地址/标题', true],
['menu_rules', '更新外置翻页规则 (每天自动)', '更新外置翻页规则 (每天自动)', {}],
['menu_customRules', '自定义翻页规则', '自定义翻页规则', {}]
], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, DBSite2, DBSiteNow, pausePage = true, pageNum = {now: 1, _now: 1}, urlC = false, nowLocation = '', lp = location.pathname, scriptHandler;
window.autoPage = {lp: ()=>location.pathname, indexOF: indexOF, isMobile: isMobile, isUrlC: isUrlC, isPager: isPager, isTitle: isTitle, blank: forceTarget, getAll: getAll, getOne: getOne, getAllXpath: getAllXpath, getXpath: getXpath, getAllCSS: getAllCSS, getCSS: getCSS, getNextE: getNextE, getNextEP: getNextEP, getNextSP: getNextSP, getNextEPN: getNextEPN, getNextUPN: getNextUPN, getNextUP: getNextUP, getNextF: getNextF, getSearch: getSearch, getCookie: getCookie, insStyle: insStyle, insScript: insScript, cleanuEvent: cleanuEvent, src_bF: src_bF, xs_bF: xs_bF, pageNumIncrement: pageNumIncrement}
if (typeof GM_info != 'undefined') {scriptHandler = GM_info.scriptHandler;} else if (typeof GM != 'undefined' && typeof GM.info != 'undefined') {scriptHandler = GM.info.scriptHandler;} else {scriptHandler = '';}
for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值
if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])};
}
// 兼容不支持 GM_openInTab 的油猴脚本管理器
if (typeof GM_openInTab !== 'function') {GM_openInTab = openInTab}
// 如果浏览器不支持 structuredClone(Chromium 98 才完全支持),则使用 JSON 方法代替
if (typeof window.structuredClone !== 'function') {window.structuredClone = function(value) {return JSON.parse(JSON.stringify(value));}}
getRulesUrl();
registerMenuCommand();
if (menuId.length < 4) {return}
// 注册脚本菜单
function registerMenuCommand() {
if (menuId.length != []){
for (let i=0;i<menuId.length;i++){
GM_unregisterMenuCommand(menuId[i]);
}
}
for (let i=0;i<menuAll.length;i++) { // 循环注册脚本菜单
menuAll[i][3] = GM_getValue(menuAll[i][0]);
if (menuAll[i][0] === 'menu_disable') { // 启用/禁用
if (menu_disable('check')) { // 当前网站在禁用列表中
menuId[i] = GM_registerMenuCommand(`${menuAll[i][2]}`, function(){menu_disable('del')});
return
} else { // 不在禁用列表中
webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
if (webType === 0) {
menuId[0] = GM_registerMenuCommand('❌ 当前网页暂不支持 [点击申请]', function(){GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
menuId[1] = GM_registerMenuCommand('🔄 更新外置翻页规则 (每天自动)', function(){getRulesUrl(true)});
menuId[2] = GM_registerMenuCommand('#️⃣ 自定义翻页规则', function(){customRules()});
//console.info('[自动无缝翻页] - 暂不支持当前网页 [ ' + location.href + ' ],申请支持: https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/419215/feedback');
return
} else if (webType === -1) {
return
}
menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
}
} else if (menuAll[i][0] === 'menu_rules') {
menuId[i] = GM_registerMenuCommand(`🔄 ${menuAll[i][1]}`, function(){getRulesUrl(true)});
} else if (menuAll[i][0] === 'menu_customRules') {
menuId[i] = GM_registerMenuCommand(`#️⃣ ${menuAll[i][1]}`, function(){customRules()});
} else {
menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
}
}
menuId[menuId.length] = GM_registerMenuCommand('💬 反馈失效 / 申请支持', function () {GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
}
// --------------------------------------------------------
// 判断是支持
function doesItSupport() {
setDBSite(); // 配置 DBSite 变量对象
// 遍历判断是否是某个已支持的网站,顺便直接赋值
let support = false;
end:
for (let now in DBSite) { // 遍历 对象
if (DBSite[now].ignore) continue; // 如果是特殊的内置规则(如通用规则)则跳过直接继续下一个循环
DBSiteNow = DBSite[now] // 供其他函数在 域名/URL 判断阶段使用
// 如果是 数组
if (Array.isArray(DBSite[now].host)) {
for (let i of DBSite[now].host) { // 遍历 数组
// 针对自定义翻页规则中的正则
if (typeof i === 'string' && i.slice(0,1) === '/') i = new RegExp(i.slice(1,i.length-1))
if ((i instanceof RegExp && i.test(location.hostname)) || (typeof i === 'string' && i === location.hostname)) {
if (self != top) {if (!DBSite[now].iframe) continue end;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
if (DBSite[now].url) {
if (typeof DBSite[now].url == 'function') {
DBSite[now].url();
} else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要跳出当前数组循环,继续规则循环
try {
if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
if (new RegExp(DBSite[now].url.slice(1,DBSite[now].url.length-1), 'i').test(location.pathname + location.search) === true) {curSite = DBSite[now];} else {if (urlC === true) {support = true;}; break;}
} else { // 如果是函数,那就执行代码
if (new Function('fun', DBSite[now].url)(window.autoPage)) {curSite = DBSite[now];} else {if (urlC === true) {support = true;}; break;}
}
} catch (e) {
console.error('[自动无缝翻页] - 当前网页规则 "url" 有误,请检查!', e, DBSite[now].url);
}
}
} else {
curSite = DBSite[now];
}
support = true; break end; // 如果找到了就退出所有循环
}
}
// 如果是 正则/字符串
} else {
// 针对自定义翻页规则中的正则
if (typeof DBSite[now].host === 'string' && DBSite[now].host.slice(0,1) === '/') DBSite[now].host = new RegExp(DBSite[now].host.slice(1,DBSite[now].host.length-1))
if ((DBSite[now].host === undefined) || (DBSite[now].host instanceof RegExp && DBSite[now].host.test(location.hostname)) || (typeof DBSite[now].host === 'string' && DBSite[now].host === location.hostname)) {
// 如果没有指定 host 规则,那么默认匹配所有域名(会对所有域名匹配 url 规则判断),可以当成一个简单的外置(自定义)通用规则方案
if (self != top) {if (!DBSite[now].iframe) continue;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
if (DBSite[now].url) {
if (typeof DBSite[now].url == 'function') {
DBSite[now].url();
} else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要继续规则循环
try {
if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
if (new RegExp(DBSite[now].url.slice(1,DBSite[now].url.length-1), 'i').test(location.pathname + location.search) === true) {curSite = DBSite[now];} else {if (urlC === true) {support = true;}; continue;}
} else { // 如果是函数,那就执行代码
if (new Function('fun', DBSite[now].url)(window.autoPage)) {curSite = DBSite[now];} else {if (urlC === true) {support = true;}; continue;}
}
} catch (e) {
console.error('[自动无缝翻页] - 当前网页规则 "url" 有误,请检查!', e, DBSite[now].url);
}
}
} else {
curSite = DBSite[now];
}
support = true; break; // 如果找到了就退出循环
}
}
}
DBSiteNow = undefined // 仅限判断阶段使用,判断完成就需要置空
if (support) {
console.info('[自动无缝翻页] - 独立规则 网站'); return 1;
} else if (self != top) {
return -1;
} else if (typeof discuz_uid != 'undefined' || getCSS('meta[name="author" i][content*="Discuz!" i], meta[name="generator" i][content*="Discuz!" i], body[id="nv_forum" i][class^="pg_" i][onkeydown*="27"], body[id="nv_search" i][onkeydown*="27"]') || getXpath('id("ft")[contains(string(),"Discuz!")]')) {
console.info(`[自动无缝翻页] - <Discuz!> 论坛`); return 2;
} else if (typeof flarum != 'undefined' || getCSS('#flarum-loading')) {
console.info(`[自动无缝翻页] - <Flarum> 论坛`); return 3;
} else if (typeof phpbb != 'undefined' || getCSS('body#phpbb')) {
console.info(`[自动无缝翻页] - <phpBB> 论坛`); return 4;
} else if (typeof xn != 'undefined' && getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) {
console.info(`[自动无缝翻页] - <Xiuno> 论坛`); return 5;
} else if (typeof XF != 'undefined') {
console.info(`[自动无缝翻页] - <XenForo> 论坛`); return 6;
} else if (typeof MyBB != 'undefined') {
console.info(`[自动无缝翻页] - <MyBB> 论坛`); return 14;
} else if (getCSS('head meta[name="generator" i][content="nexusphp" i]') || getXpath('id("footer")[contains(string(), "NexusPHP")]')) {
console.info(`[自动无缝翻页] - <NexusPHP> 论坛`); return 7;
} else if (unsafeWindow.config && ((unsafeWindow.config.assetVersionEncoded && unsafeWindow.config.assetVersionEncoded.indexOf('gitea') !== -1) || (unsafeWindow.config.customEmojis && unsafeWindow.config.customEmojis.gitea))) {
console.info(`[自动无缝翻页] - <Forgejo/Gitea> git 托管系统`); return 15;
} else if (loadMoreExclude(loadMoreExclude1) && getAllCSS('.load-more, .load_more, .loadmore, #load-more, #load_more, #loadmore, [id^="loadmore"], .show-more, .show_more, .ajax-more').length === 1) {
console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 1`); return 8;
} else if (loadMoreExclude(loadMoreExclude2) && getAllXpath('//*[self::a or self::span or self::button or self::div][text()="加载更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]').length === 1) {
console.info(`[自动无缝翻页] - 部分自带 自动无缝翻页 的网站 2`); return 9;
} else if (getCSS('link[href*="/wp-content/" i], script[src*="/wp-content/" i], link[href*="/wp-includes/" i], script[src*="/wp-includes/" i], head>meta[name=generator][content*="WordPress" i]')) {
//if (getAllCSS('article[class], div[id^="post-"], ul[class*="post"]>li.item, .post').length < 4 || getCSS('#nav-below, nav.navigation, nav.paging-navigation, .pagination, .wp-pagenavi, .pagenavi')) return 0;
if (getXpath('(//*[contains(@class, "post-page-numbers") and contains(@class, "current")])[last()]/following-sibling::a[1]')) {
DBSite.wp_article_post.pager.nextL = '(//*[contains(@class, "post-page-numbers") and contains(@class, "current")])[last()]/following-sibling::a[1]'; DBSite.wp_article_post.pager.replaceE = '//a[contains(@class,"post-page-numbers")]/..';
} else if (getXpath('(//div[contains(@class,"fenye")])[last()]//a[string()="下一页"]')) {
DBSite.wp_article_post.pager.nextL = '(//div[contains(@class,"fenye")])[last()]//a[string()="下一页"]'; DBSite.wp_article_post.pager.replaceE = '.fenye';
}
if (DBSite.wp_article_post.pager.nextL != undefined) {
if (getAllCSS('#entry-content>#content-innerText, .entry-content>#content-innerText').length == 1) {
DBSite.wp_article_post.pager.pageE = '#entry-content>#content-innerText, .entry-content>#content-innerText'
} else if (getAllCSS('.entry-content .single-content img').length > 3) {
DBSite.wp_article_post.pager.pageE = '.entry-content .single-content'
} else if (getAllCSS('.entry-content').length == 1) {
DBSite.wp_article_post.pager.pageE = '.entry-content>*:not(.wbp-cbm):not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)'
} else if (getAllCSS('.article-content').length == 1) {
DBSite.wp_article_post.pager.pageE = '.article-content>*:not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)'
} else if (getAllCSS('article').length == 1) {
DBSite.wp_article_post.pager.pageE = 'article>*:not(.page-links):not(.post-links):not(.article-paging):not(.entry-pagination):not(.pagination):not(.fenye):not(.open-message):not(#social):not(.article-social):not(.single-cat-tag):not(.single-meta):not(#fontsize):not(.clear):not(.tg-m):not(.tg-site):not(footer)'
}
if (DBSite.wp_article_post.pager.pageE != undefined) console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站 - 文章内`); return 11;
}
if (getCSS('a.next, a.next-page')) {
DBSite.wp_article.pager.nextL = 'a.next, a.next-page'
} else if (getCSS('a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]')) {
DBSite.wp_article.pager.nextL = 'a[rel="next" i], a[aria-label="next" i], a[aria-label="下一个"].page-link, a[aria-label="Next Page" i], a[aria-label="下一页"], a[rel="下一页"], a[title="下一页"], a[aria-label="下一頁"], a[rel="下一頁"], a[title="下一頁"]'
} else if (getCSS('li.next-page > a, li.next > a, li.pagination-next>a')) {
DBSite.wp_article.pager.nextL = 'li.next-page > a, li.next > a, li.pagination-next>a'
} else if (getCSS('span.current+a')) {
DBSite.wp_article.pager.nextL = 'span.current+a'
} else if (getCSS('.nav-previous a, a.nav-previous')) {
DBSite.wp_article.pager.nextL = '.nav-previous a, a.nav-previous'
} else if (getCSS('.pagination>.page-item.active+li.page-item>a')) {
DBSite.wp_article.pager.nextL = '.pagination>.page-item.active+li.page-item>a'
} else {
const temp_page = getCSS('#nav-below, nav.navigation, nav.paging-navigation, #pagination:not([class*="entry"]), .pagination:not([class*="entry"]), .wp-pagenavi, .pagenavi, nav[role="navigation"]')
if (temp_page && getXpath('//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), ">") or contains(text(), "next") or contains(text(), "Next") or contains(text(), "NEXT")]', temp_page)) {
DBSite.wp_article.pager.nextL = '//*[self::ul or self::nav or self::div][@id="nav-below" or @id="pagination" or contains(@class, "navigation") or contains(@class, "pagination") or contains(@class, "pagenavi") or @role="navigation"]//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), ">") or contains(text(), "next") or contains(text(), "Next") or contains(text(), "NEXT")]'
}
}
if (DBSite.wp_article.pager.nextL != undefined) {
if (DBSite.wp_article.pager.nextL.indexOf('//') !== 0) DBSite.wp_article.pager.replaceE += ',' + DBSite.wp_article.pager.nextL
if (getAllCSS('main').length == 1) {
if (getAllCSS('main .posts-wrapper.row>div>article').length > 3) {
DBSite.wp_article.pager.pageE = 'main .posts-wrapper.row>div'
} else if (getAllXpath('//main//div[contains(@class,"row")]/div/article').length > 3) {
DBSite.wp_article.pager.pageE = '//main//div[contains(@class,"row")]/div/article/parent::div'
} else if (getAllCSS('main article[id^="post-"]').length > 3) {
DBSite.wp_article.pager.pageE = 'main article[id^="post-"]'
} else if (getAllCSS('main article[class]').length > 3) {
DBSite.wp_article.pager.pageE = 'main article[class]'
} else if (getAllCSS('main div[id^="post-"]').length > 3) {
DBSite.wp_article.pager.pageE = 'main div[id^="post-"]'
} else if (getAllCSS('main .post').length > 3) {
DBSite.wp_article.pager.pageE = 'main .post'
}
if (DBSite.wp_article.pager.pageE != undefined) {console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站`); return 10;}
}
if (getAllCSS('.posts-wrapper.row>div>article').length > 3) {
DBSite.wp_article.pager.pageE = '.posts-wrapper.row>div'
} else if (getAllXpath('//div[contains(@class,"row")]/div/article').length > 3) {
DBSite.wp_article.pager.pageE = '//div[contains(@class,"row")]/div/article/parent::div'
} else if (getAllCSS('article[id^="post-"]').length > 3) {
DBSite.wp_article.pager.pageE = 'article[id^="post-"]'
} else if (getAllCSS('article[class]').length > 3) {
DBSite.wp_article.pager.pageE = 'article[class]'
} else if (getAllCSS('div[id^="post-"]').length > 3) {
DBSite.wp_article.pager.pageE = 'div[id^="post-"]'
} else if (getAllCSS('ul[class*="post"]>li.item').length > 3) {
DBSite.wp_article.pager.pageE = 'ul[class*="post"]>li.item'
} else if (getAllCSS('.post').length > 3) {
DBSite.wp_article.pager.pageE = '.post'
} else if (getAllCSS('.posts-row>posts[class*="post"]').length > 3) {
DBSite.wp_article.pager.pageE = '.posts-row>posts[class*="post"]'
} else if (getAllCSS('#posts, .posts').length == 1) {
DBSite.wp_article.pager.pageE = '#posts, .posts'
} else if (getAllCSS('#content .container>.row').length == 1 && getAllCSS('#content .container>.row+.nav-pagination').length == 1) {
DBSite.wp_article.pager.pageE = '#content .container>.row'
}
if (DBSite.wp_article.pager.pageE != undefined) {console.info(`[自动无缝翻页] - 部分使用 WordPress 的网站`); return 10;}
}
} else if (getCSS('meta[name="template" i][content="handsome" i]') && getCSS('.page-navigator')) {
console.info(`[自动无缝翻页] - 部分使用 Typecho 的网站 (handsome)`); return 12;
} else if (getCSS('meta[name="template" i][content="Mirages" i]') && getCSS('.page-navigator')) {
console.info(`[自动无缝翻页] - 部分使用 Typecho 的网站 (Mirages)`); return 13;
} else if (getCSS('.stui-page, .stui-page__item, #long-page, .myui-page, .myui-page__item')) {
console.info(`[自动无缝翻页] - 部分影视网站`); return 300;
} else if (getCSS('#page') && getCSS('.module-items,a.module-poster-item')) {
console.info(`[自动无缝翻页] - 部分影视网站 2`); return 301;
} else if (getCSS('.ArticleImageBox, .PictureList') && getCSS('.article_page') && getXpath('//div[contains(@class,"article_page")]//a[text()="下一页"]')) {
console.info(`[自动无缝翻页] - 部分美女图站 - 手机版`); return 302;
} else if (getCSS('meta[content^=SearXNG i], link[href*=SearXNG i], script[src*=SearXNG i]')) {
console.info(`[自动无缝翻页] - <SearXNG> 元搜索引擎`); return 303;
} else if (getCSS('.content > #content') && getXpath('//div[contains(@class,"page_chapter")]//a[text()="下一章"]')) {
console.info(`[自动无缝翻页] - <笔趣阁 1> 模板的小说网站`); return 200;
} else if (getCSS('#nr1, #chaptercontent, .Readarea, .ReadAjax_content') && getCSS('#pb_next, #linkNext')) {
console.info(`[自动无缝翻页] - <笔趣阁 1 - 手机版> 模板的小说网站`); return 201;
} else if (getCSS('#txt, .txt') && getCSS('#pb_next, .url_next') && getCSS('.chapter-control, .chapter-page-btn')) {
console.info(`[自动无缝翻页] - <笔趣阁 2> 模板的小说网站`); return 202;
} else if ((getCSS('meta[name="description" i][content*="小说"], meta[name="description" i][content*="章节"], meta[name="description" i][content*="阅读"], meta[name="keywords" i][content*="笔趣"]') || location.hostname.indexOf('biqu')!=-1 || document.title.match(/笔趣阁|小说|章/)!=null) && getXpath('//a[contains(text(), "下一章") or contains(text(), "下一页") or contains(text(), "下一节")]')) {
let biquge3_pageE= ['[id="chapter_content" i]','[class~="chapter_content" i]','[id="chaptercontent" i]','[class~="chaptercontent" i]','[id="booktext" i]','[class~="booktext" i]','[id="txtcontent" i]','[class~="txtcontent" i]','[id="textcontent" i]','[class~="textcontent" i]','[id="read-content" i]','[class~="read-content" i]','[id="txtnav" i]','[class~="txtnav" i]','[id="txt" i][class~="txt" i]','[id="contents" i]','[class~="contents" i]','[id="content" i]','[class~="content" i]']
for(let biquge3_pageE_ of biquge3_pageE) {if (getAllCSS(biquge3_pageE_).length === 1) {DBSite.biquge3.pager.pageE = biquge3_pageE_;DBSite.biquge3.pager.insertP = [biquge3_pageE_,6];DBSite.biquge3.style = biquge3_pageE_+'>.readinline, ' + DBSite.biquge3.style;break;}}
if (DBSite.biquge3.pager.pageE != undefined) {console.info(`[自动无缝翻页] - <笔趣阁 3> 模板的小说网站`); return 203;}
}
return 0;
}
// 判断网站类型
function webTypeIf() {
if (webType != 1) {
switch (webType) {
case 2: // < 所有 Discuz!论坛 >
discuz_(); break;
case 3: // < 所有 Flarum 论坛 >
DBSite.flarum.url(); break;
case 4: // < 所有 phpBB 论坛 >
DBSite.phpbb.url(); break;
case 5: // < 所有 Xiuno 论坛 >
DBSite.xiuno.url(); break;
case 6: // < 所有 XenForo 论坛 >
DBSite.xenforo.url(); break;
case 14: // < 所有 MyBB 论坛 >
DBSite.mybb.url(); break;
case 7: // < 所有 NexusPHP 论坛 >
DBSite.nexusphp.url(); break;
case 15: // < 所有 Forgejo/Gitea> git 托管系统 >
DBSite.forgejoGitea.url(); break;
case 8: // < 部分自带 自动无缝翻页 的网站 1 >
DBSite.loadmore.url('.load-more, .load_more, .loadmore, #load-more, #load_more, #loadmore, [id^="loadmore"], .show-more, .show_more, .ajax-more'); break;
case 9: // < 部分自带 自动无缝翻页 的网站 2 >
DBSite.loadmore.url('//*[self::a or self::span or self::button or self::div][text()="加载更多"][not(@href) or @href="#" or starts-with(@href, "javascript")]'); break;
case 10: // < 部分使用 WordPress 的网站 >
DBSite.wp_article.url(); break;
case 11: // < 部分使用 WordPress 的网站 - 文章内 >
curSite = DBSite.wp_article_post; break;
case 12: // < 部分使用 Typecho 的网站 (handsome) >
DBSite.typecho_handsome.url(); break;
case 13: // < 部分使用 Typecho 的网站 (Mirages) >
DBSite.typecho_mirages.url(); break;
case 200: // < 所有使用 笔趣阁 1 模板的小说网站 >
DBSite.biquge1.url(); break;
case 201: // < 所有使用 笔趣阁 1 - 手机版 模板的小说网站 >
curSite = DBSite.biquge1_m; break;
case 202: // < 所有使用 笔趣阁 2 模板的小说网站 >
DBSite.biquge2.url(); break;
case 203: // < 所有使用 笔趣阁 3 模板的小说网站 >
curSite = DBSite.biquge3; break;
case 300: // < 部分影视网站 >
curSite = DBSite.yingshi; break;
case 301: // < 部分影视网站 2 >
curSite = DBSite.yingshi2; break;
case 302: // < 部分美女图站 - 手机版 >
curSite = DBSite.meinvtu_m; break;
case 303: // < SearXNG 元搜索引擎 >
document.cookie='infinite_scroll=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/';
document.cookie='results_on_new_tab=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/';
break;
}
}
}
// 内置翻页规则
function setDBSite() {
/*
inherits: 继承标识,仅用于自定义规则,用于增删改某个外置规则的部分规则时,可使用该标识来省略不需要修改的规则,只写有变化的规则
url: 匹配到该域名后要执行的函数/正则(一般用于根据 URL 分配相应翻页规则)
urlC: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(需要放在 url: 中,自定义规则的话需要使用 fun.isUrlC())
noReferer: 获取下一页内容时,不携带 Referer(部分网站携带与不携带可能不一样)
hiddenPN: 不显示脚本左下角的页码
history: 添加历史记录 并 修改当前 URL(默认开启,对于不支持的网站要设置为 false)
thread: 对于社区类网站,要在 帖子内 的规则中加入这个,用于脚本的 [帖子内自动翻页] 功能(即用户可以选择开启/关闭所有社区类网站帖子内的自动翻页)
style: 要插入网页的 CSS Style 样式,当只需要单纯屏蔽部分网页元素时,可以只写 CSS 选择器省略掉 {display: none !important;}
retry: 允许获取失败后重试
blank: 强制新标签页打开链接
1 = 网页 <head> 添加 <base target="_blank"> 来让所有链接默认新标签页打开(对已单独指定 target 或已监听点击事件的元素无效)
2 = 对 <body> 委托点击事件
3 = 对 pageE 的父元素 委托点击事件(也会阻止冒泡,但因为距离 <a> 标签较远,因此只有在委托点击事件的元素是 pageE 的父元素的父元素时,才有意义)
4 = 对 pageE 的子元素 <a> 标签 添加 target="_blank"
5 = 对 pageE 的子元素 <a> 标签 清理事件后 再添加 target="_blank"
6 = 对 pageE 的子元素 <a> 标签 清理事件后 再添加 target="_blank" 并阻止冒泡(避免父元素事件委托捕获该元素的点击事件)
pager: {
type: 翻页模式
1 = 由脚本实现自动无缝翻页,可省略(适用于:静态加载内容网站,常规模式)
2 = 只需要点击下一页按钮(适用于:网站自带了 自动无缝翻页 功能)
nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同)
nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(省略后默认 500ms,当指定上面三个时,会忽略 interval)
isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击
3 = 依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时)
scrollE: 作为基准线的元素(一般为底部页码元素),和 replaceE 一样的话可以省略
scrollD: 当 [基准元素] 与 [可视区域底部] 之间的距离 等于或小于该值时,将触发翻页,省略后默认 2000
4 = 动态加载类网站(适用于:简单的动态加载内容网站)
insertE: 用来插入元素的函数
5 = 插入 iframe 方式来加载下一页,无限套娃(适用于:部分动态加载内容的网站,需要允许 iframe 且支持通过 GET/POST 直接打开下一页)
style: 加载 iframe 前要插入的 CSS Style 样式(比如为了悬浮的样式与下一页的重叠,隐藏网页底部间距提高阅读连续性)
iframe: 这个必须加到 pager{} 外面(这样才会在该域名的 iframe 框架下运行脚本)
6 = 通过 iframe 获取下一页动态加载内容插入本页,只有一个娃(适用于:部分动态加载内容的网站,与上面不同的是,该模式适合简单的网页,没有复杂事件什么的)
loadTime: 预留的网页加载时间,确保网页内容加载完成(省略后默认为 300ms)
nextL: 下一页链接所在元素
pageE: 要从下一页获取的元素
insertP: 下一页元素插入本页的位置(数组第一个是基准元素,第二个是基准元素的前后具体位置)
1 = 插入基准元素自身的前面
2 = 插入基准元素内,第一个子元素前面
3 = 插入基准元素内,最后一个子元素后面
4 = 插入基准元素自身的后面
5 = 插入 pageE 列表最后一个元素的后面(该 insertP 可以直接省略不写,等同于 ['pageE', 5] )
6 = 插入该元素自身内部末尾(针对小说网站等文本类的),附带参数 insertP6Br: true, 用来中间插入换行
// 小技巧:当基准元素是下一页主体元素的父元素时(或者说要将下一页元素插入到本页同元素最后一个后面时)是可以省略不写 insertP
例如:当 pageE: 'ul>li' 且 insertP: ['ul', 3] 时,实际等同于 ['ul>li', 5]
当 pageE: '.item' 且 insertP: ['.item', 4] 时,实际等同于 ['.item', 5]
当 pageE: '.item' 且 insertP: ['.page', 1] 时,实际等同于 ['.item', 5]
注意:如 pageE 中选择了多类元素,则不能省略 insertP(比如包含 `,` 与 `|` 符号),除非另外的选择器是 <script> <style> <link> 标签
replaceE: 要替换为下一页内容的元素(比如页码),省略后将会自动判断是替换 nextL 元素还是 nextL 的父元素(当 nextL 元素后面或前面有 <a> 的相邻兄弟元素时替换其父元素,反之替换其自身,仅限模式1/3/6,且 js 代码除外),值为空 "" 时则完全不替换
scrollD: 当 [滚动条] 与 [网页底部] 之间的距离 等于或小于该值时,将触发翻页,因此值越大就越早触发翻页,访问速度慢的网站需要调大,可省略(记得移除上一行末尾逗号),省略后默认 2000
scriptT: 单独插入 <script> 标签
0 = 下一页的所有 <script> 标签
1 = 下一页的所有 <script> 标签(不包括 src 链接)
2 = 下一页主体元素 (pageE) 的同级 <script> 标签
3 = 下一页主体元素 (pageE) 的子元素 <script> 标签
interval: 翻页后间隔时间(省略后默认 500ms)
forceHTTPS: 下一页链接强制 HTTPS
},
function: {
bF = 插入前执行函数
bFp = 参数
aF = 插入后执行函数
aFp = 参数
}
*/ //<<< 规则简单说明 >>>
DBSite = {
loadmore: {
ignore: true,
url: function(nextL) {curSite = DBSite.loadmore; curSite.pager.nextL = nextL;},
pager: {
type: 2,
isHidden: true,
interval: 1000
}
}, // 部分自带 自动无缝翻页 的网站
wp_article: {
ignore: true,
url: ()=> {
if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) {
curSite = DBSite.wp_article;
// 自适应瀑布流样式
setTimeout(()=>{if (getOne(curSite.pager.pageE).style.cssText.indexOf('position: absolute') != -1){insStyle(curSite.pager.pageE + '{position: static !important; float: left !important; height: '+ parseInt(getCSS(curSite.pager.pageE).offsetHeight * 1.1) + 'px !important;}');}}, 1500);
}
},
style: 'img[data-src], img[data-original] {opacity: 1 !important;}',
blank: 3,
pager: {
replaceE: '#nav-below, nav.navigation, nav.paging-navigation, #pagination:not([class*="entry"]), .pagination:not([class*="entry"]), .wp-pagenavi, .pagenavi, nav[role="navigation"], ul[class*="-pagination"]',
forceHTTPS: true,
scrollD: 3000
},
function: {
bF: src_bF
}
}, // 部分使用 WordPress 的网站
wp_article_post: {
ignore: true,
pager: {
type: 3,
scrollD: 3000
},
function: {
bF: src_bF
}
}, // 部分使用 WordPress 的网站 - 文章内
typecho_handsome: {
ignore: true,
url: ()=> {if (getCSS('nav:not([id=comment-navigation]) .page-navigator')) {curSite = DBSite.typecho_handsome;}},
blank: 3,
pager: {
nextL: '.page-navigator li.next>a',
pageE: '.blog-post, .post-list',
replaceE: '.page-navigator'
}
}, // 部分使用 Typecho 的网站 (handsome)
typecho_mirages: {
ignore: true,
url: ()=> {if (getAllCSS('#index>article, #archive>article').length > 3 && getCSS('li.next')) {curSite = DBSite.typecho_mirages;}},
blank: 3,
pager: {
nextL: 'li.next>a',
pageE: '#index>article, #archive>article',
scriptT: 3,
replaceE: '.page-navigator'
}
}, // 部分使用 Typecho 的网站 (Mirages)
biquge1: {
ignore: true,
url: ()=> {curSite = DBSite.biquge1;xs_bF(getAllCSS('.content > #content'),[/<br>.{0,10}秒记住.+$/, '']);},
style: 'img, .posterror, a[href*="posterror()"], [style*="background"][style*="url("]:not(html):not(body), #content > *:not(br):not(p), #content>.readinline {display: none !important;}',
history: true,
retry: 3000,
pager: {
nextL: '//div[@class="page_chapter"]//a[text()="下一章"]',
pageE: '.content > #content',
insertP: ['.content > #content', 6],
replaceE: '.page_chapter'
},
function: {
bF: xs_bF,
bFp: [/<br>.{0,10}秒记住.+$/, '']
}
}, // 笔趣阁 1 模板的小说网站
biquge1_m: {
ignore: true,
style: 'img, .posterror, .show-app2, a[href*="posterror()"], [onclick*="location.href"], [style*="background"][style*="url("]:not(html):not(body), #nr1>*:not(br):not(p), #chaptercontent>*:not(br):not(p), .Readarea>*:not(br):not(p), .ReadAjax_content>*:not(br):not(p), #nr1>.readinline, #chaptercontent>.readinline, .Readarea>.readinline, .ReadAjax_content>.readinline {display: none !important;}',
history: true,
retry: 3000,
pager: {
nextL: '#pb_next, #linkNext',
pageE: '#nr1, #chaptercontent, .Readarea, .ReadAjax_content',
insertP: ['#nr1, #chaptercontent, .Readarea, .ReadAjax_content', 6],
replaceE: '//a[@id="pb_next" or @id="linkNext"]/parent::*'
}
}, // 笔趣阁 1 - 手机版 模板的小说网站
biquge2: {
ignore: true,
url: ()=> {if (isMobile() || getCSS('.chapter-page-btn') != null) {curSite = DBSite.biquge2_m;} else {curSite = DBSite.biquge2;}},
style: 'img, .posterror, a[href*="posterror()"], [style*="background"][style*="url("]:not(html):not(body), #txt > *:not(br):not(p), #txt>.readinline, .txt>.readinline {display: none !important;}',
history: true,
retry: 3000,
pager: {
type: 6,
nextL: '#pb_next, .url_next',
pageE: '#txt, .txt',
insertP: ['#txt, .txt', 6],
replaceE: '.chapter-control, .chapter-page-btn',
loadTime: 1500,
scrollD: 3500
}
}, // 笔趣阁 2 模板的小说网站
biquge2_m: {
ignore: true,
style: 'img, .posterror, a[href*="posterror()"], [style*="background"][style*="url("]:not(html):not(body), #txt > *:not(br):not(p), #txt>.readinline, .txt>.readinline {display: none !important;}',
history: true,
retry: 3000,
pager: {
nextL: '#pb_next, .url_next',
pageE: '#txt, .txt',
insertP: ['#txt, .txt', 6],
replaceE: '.chapter-control, .chapter-page-btn'
}
}, // 笔趣阁 2 - 手机版 模板的小说网站
biquge3: {
ignore: true,
style: 'img, .posterror, a[href*="posterror()"], [style*="background"][style*="url("]:not(html):not(body), script+div[style="padding:15px;"], p[style*="font-weight:"] {display: none !important;}',
history: true,
retry: 3000,
pager: {
nextL: 'js; const a=[fun.getNextE(\'//a[contains(text(), "下一页")]\'),fun.getNextE(\'//a[contains(text(), "下一章")]\'),fun.getNextE(\'//a[contains(text(), "下一节")]\')];if (a[0]){return a[0];}else if(a[1]){return a[1];}else if(a[2]){return a[2];}',
insertP6Br: false,
replaceE: '//a[contains(text(), "下一章") or contains(text(), "下一页") or contains(text(), "下一节")]/parent::*'
},
function: {
bF: xs_bF,
bFp: [/<br>.{0,10}秒记住.+$/, '']
}
}, // 笔趣阁 3 模板的小说网站
yingshi: {
ignore: true,
style: 'div.stui-page__all, div.myui-page__all {display: none !important;}',
blank: 3,
pager: {
nextL: '.stui-page li.active+li>a, .stui-page__item li.active+li>a, #long-page .active+li>a, .myui-page .visible-xs+li>a',
pageE: '.stui-vodlist, .myui-vodlist>li, #content, #searchList',
replaceE: '.stui-page, .stui-page__item, #long-page, .myui-page, .myui-page__item'
},
function: {
bF: src_bF,
bFp: [1, '[data-original]', 'data-original']
}
}, // 部分影视网站
yingshi2: {
ignore: true,
blank: 3,
style: '.module-poster-item, .module-items>* {display: inline-block !important;}',
pager: {
nextL: '#page a[title="下一页"], a.page-next',
pageE: '.module-items>*, a.module-poster-item',
replaceE: '#page'
},
function: {
bF: src_bF
}
}, // 部分影视网站 2
meinvtu_m: {
ignore: true,
history: true,
blank: 3,
pager: {
type: 3,
nextL: '//div[contains(@class,"article_page")]//a[text()="下一页"]',
pageE: '.ArticleImageBox, .PictureList',
replaceE: '.article_page',
scrollD: 500
}
}, // 部分美女图站 - 手机版
discuz_forum: {
ignore: true,
pager: {
type: 2,
nextL: '#autopbn',
nextTextOf: '下一'
}
}, // Discuz! 论坛 - 帖子列表(自带无缝加载下一页按钮的)
discuz_guide: {
ignore: true,
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: 'tbody[id^="normalthread_"]',
replaceE: '.pg, .pages',
forceHTTPS: true
}
}, // Discuz! 论坛 - 导读页 及 帖子列表(不带无缝加载下一页按钮的)
discuz_waterfall: {
ignore: true,
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: '#waterfall > li',
replaceE: '.pg, .pages',
forceHTTPS: true
}
}, // Discuz! 论坛 - 图片模式的帖子列表(不带无缝加载下一页按钮的)
discuz_thread: {
ignore: true,
thread: true,
style: '.pgbtn, .viewthread:not(:first-of-type)>h1, .viewthread:not(:first-of-type)>ins, .viewthread:not(:first-of-type)>.headactions {display: none;}',
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: '#postlist > div[id^="post_"], form>.viewthread',
replaceE: '//div[contains(@class,"pg") or contains(@class,"pages")][./a[contains(@class,"nxt") or contains(@class,"next") or contains(@class,"prev")][not(contains(@href,"javascript") or contains(@href,"commentmore"))]]',
forceHTTPS: true
},
function: {
bF: src_bF,
bFp: [0, 'img[file]', 'file']
}
}, // Discuz! 论坛 - 帖子内
discuz_search: {
ignore: true,
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: '#threadlist > ul',
replaceE: '.pg, .pages',
forceHTTPS: true
}
}, // Discuz! 论坛 - 搜索页
discuz_youspace: {
ignore: true,
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: 'form:not([action^="search.php?"]) tbody > tr:not(.th)',
replaceE: '.pg, .pages',
forceHTTPS: true
}
}, // Discuz! 论坛 - 回复页、主题页(别人的)
discuz_collection: {
ignore: true,
pager: {
nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
pageE: '#ct .bm_c table > tbody',
replaceE: '.pg, .pages',
forceHTTPS: true
}
}, // Discuz! 论坛 - 淘帖页
discuz_archiver: {
ignore: true,
pager: {
nextL: '//div[@id="content"][last()]//div[@class="page"]/strong/following-sibling::a[1]',
pageE: '#content'
}
}, // Discuz! 论坛 - 归档页
discuz_m: {
ignore: true,
thread: true,
pager: {
nextL: '//a[@class="nxt" or @class="next"] | //div[@class="page"]/a[text()="下一页" or contains(text(), ">")]',
replaceE: '.pg, .page',
forceHTTPS: true,
scrollD: 1000
}
}, // Discuz! 论坛 - 触屏手机版 - 帖子内
discuz_m_forum: {
ignore: true,
pager: {
type: 2,
nextL: 'a.loadmore',
interval: 500,
scrollD: 1000
}
}, // Discuz! 论坛 - 触屏手机版 - 帖子列表(自带无缝加载下一页按钮的)
flarum: {
ignore: true,
url: ()=> {urlC = true;if (!indexOF('/d/')) {if(getCSS('.DiscussionList-loadMore')){curSite = DBSite.flarum;}else if(getCSS('a.Button--primary')){curSite = DBSite.flarum2;}}},
pager: {
type: 2,
nextL: '.DiscussionList-loadMore > button',
isHidden: true
}
}, // Flarum 论坛
flarum2: {
ignore: true,
blank: 4,
pager: {
type: 6,
nextL: 'a.Button--primary+a:not(.disabled)',
pageE: '.DiscussionList-discussions>li',
replaceE: '.Orion-DiscussionListPagination'
}
}, // Flarum 论坛 - 带页码的
phpbb: {
ignore: true,
url: ()=> {if (indexOF('/viewforum.php')) {
curSite = DBSite.phpbb;
} else if (indexOF('/viewtopic.php')) {
curSite = DBSite.phpbb_post;
} else if (indexOF('/search.php')) {
curSite = DBSite.phpbb_search;
}},
pager: {
nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
pageE: '.forumbg:not(.announcement) ul.topiclist.topics > li',
replaceE: '.action-bar .pagination, .topic-actions .pagination'
}
}, // phpBB 论坛 - 帖子列表
phpbb_post: {
ignore: true,
thread: true,
pager: {
nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
pageE: 'div.post[id], div.post[id]+hr',
replaceE: '.action-bar .pagination, .topic-actions .pagination'
}
}, // phpBB 论坛 - 帖子内
phpbb_search: {
ignore: true,
pager: {
nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
pageE: 'div.search.post',
replaceE: '.action-bar .pagination, .pagination'
}
}, // phpBB 论坛 - 搜索页
xenforo: {
ignore: true,
url: ()=> {if (indexOF(/\/(forums|f)\//) || (getCSS(DBSite.xenforo.pager.nextL) && getCSS(DBSite.xenforo.pager.pageE))) {
curSite = DBSite.xenforo;
} else if (indexOF(/\/(threads|t)\//) || (getCSS(DBSite.xenforo.pager.nextL) && getCSS(DBSite.xenforo_post.pager.pageE))) {
curSite = DBSite.xenforo_post;
} else if (indexOF('/search/') || (getCSS(DBSite.xenforo.pager.nextL) && getCSS(DBSite.xenforo_search.pager.pageE))) {
curSite = DBSite.xenforo_search;
}},
pager: {
nextL: 'a.pageNav-jump--next',
pageE: '.structItemContainer-group.js-threadList > div',
replaceE: 'nav.pageNavWrapper',
scrollD: 2500
}
}, // XenForo 论坛 - 帖子列表
xenforo_post: {
ignore: true,
thread: true,
pager: {
nextL: 'a.pageNav-jump--next',
pageE: '.block-body.js-replyNewMessageContainer > article',
replaceE: 'nav.pageNavWrapper',
scrollD: 2500
}
}, // XenForo 论坛 - 帖子内
xenforo_search: {
ignore: true,
pager: {
nextL: 'a.pageNav-jump--next',
pageE: 'ol.block-body > li',
replaceE: 'nav.pageNavWrapper',
scrollD: 2500
}
}, // XenForo 论坛 - 搜索页
mybb: {
ignore: true,
url: ()=> {if (location.pathname.toLowerCase().indexOf('/forum') == 0 || location.pathname.toLowerCase().indexOf('/search') == 0 || (getCSS(DBSite.mybb.pager.nextL)&&getCSS(DBSite.mybb.pager.pageE))) {
curSite = DBSite.mybb;
} else if (location.pathname.toLowerCase().indexOf('thread') !== -1 || (getCSS(DBSite.mybb.pager.nextL)&&getCSS(DBSite.mybb_post.pager.pageE))) {
curSite = DBSite.mybb_post; curSite.pager = Object.assign({}, DBSite.mybb.pager,DBSite.mybb_post.pager);
}},
blank: 3,
pager: {
nextL: 'div:not([id=breadcrumb_multipage_popup])>a.pagination_next, div:not([id=breadcrumb_multipage_popup])>.pagination_current+a.pagination_page',
pageE: 'tr.inline_row',
replaceE: '.pagination',
scrollD: 2500
}
}, // MyBB 论坛 - 帖子列表
mybb_post: {
ignore: true,
thread: true,
pager: {
pageE: '#posts>*',
scrollD: 2500
}
}, // MyBB 论坛 - 帖子内
xiuno: {
ignore: true,
url: ()=> {if (lp == '/' || indexOF(/\/(index|forum)/)) {curSite = DBSite.xiuno;} else if (indexOF('/thread')) {curSite = DBSite.xiuno_post;}},
pager: {
nextL: '//li[@class="page-item"]/a[text()="▶" or text()="»" or contains(text(),">") or contains(text(),"下一页")]',
pageE: 'ul.threadlist > li',
replaceE: 'ul.pagination'
}
}, // Xiuno 论坛 - 帖子列表
xiuno_post: {
ignore: true,
thread: true,
pager: {
nextL: '//li[@class="page-item"]/a[text()="▶" or text()="»" or contains(text(),">") or contains(text(),"下一页")]',
pageE: 'li.post[data-pid]:not(.newpost)',
replaceE: 'ul.pagination'
}
}, // Xiuno 论坛 - 帖子内
forgejoGitea: {
ignore: true,
url: ()=> {if (indexOF(/^\/explore\/.+/) || indexOF(/\/(issues|pulls|releases|tags)$/) || indexOF(/\/commits\/branch\/.+/) || (getCSS('.pagination>.active+.item') && getCSS('.flex-list>.flex-item'))) {curSite = DBSite.forgejoGitea;}},
pager: {
nextL: '.pagination>.active+.item',
pageE: '.flex-list>.flex-item, #issue-list>div, #release-list>li, tbody.tag-list>tr, tbody.commit-list>tr',
replaceE: '.pagination'
}
}, // Forgejo/Gitea git 托管系统 - explore/issues/releases/tag/commit
nexusphp: {
ignore: true,
url: ()=> {
if (lp == '/torrents.php' || getCSS('table.torrents')) {
curSite = DBSite.nexusphp;
} else if (lp == '/subtitles.php') {
curSite = DBSite.nexusphp;
curSite.pager.pageE = '#outer > table.main~table > tbody > tr:not(:first-of-type)'
} else if (lp == '/forums.php' && indexOF('action=viewforum', 's')) {
curSite = DBSite.nexusphp;
curSite.pager.pageE = '#outer > table.main+table > tbody > tr:not(:first-of-type):not(:last-of-type)'
} else if (lp == '/forums.php' && indexOF('action=viewtopic', 's')) {
curSite = DBSite.nexusphp;
curSite.thread = true;
curSite.pager.pageE = 'td.text > div, td.text > div+table.main';
}},
pager: {
nextL: '//a[./b[contains(text(), "下一页") or contains(text(), ">>")]]',
pageE: 'table.torrents > tbody > tr:not(:first-of-type)',
replaceE: '//p[@align][./font[@class="gray"]]'
}
}, // NexusPHP 论坛
nexusmods: {
host: 'www.nexusmods.com',
url: ()=> {urlC = true; if (indexOF(/\/(mods|users)\/\d+/)) {if (indexOF('tab=posts','s')){curSite = DBSite.nexusmods_posts;} else if (indexOF('tab=user+files','s')){curSite = DBSite.nexusmods;}} else if (lp !== '/' && getCSS('.pagination a.page-selected')) {curSite = DBSite.nexusmods;}},
blank: 1,
history: false,
xRequestedWith: true,
pager: {
nextL: nexusmods_nextL,
pageE: 'ul.tiles>li',
replaceE: '.pagination',
scrollD: 3500
},
function: {
bF: nexusmods_bF
}
}, // NexusMods
nexusmods_posts: {
ignore: true,
history: false,
xRequestedWith: true,