forked from XIU2/UserScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutopage.user.js
5116 lines (4962 loc) · 245 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 自动无缝翻页
// @version 2.6.7
// @author X.I.U
// @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、龙的天空、起点小说、煎蛋网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、FitGirl、片库、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了...
// @match *://*/*
// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @grant GM_openInTab
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_notification
// @grant unsafeWindow
// @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
// ==/UserScript==
(function() {
'use strict';
var menuAll = [
['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []],
['menu_discuz_thread_page', '帖子内自动翻页 (仅论坛)', '帖子内自动翻页 (仅论坛)', true],
['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true],
['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false]
], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, SiteType, pausePage = true, pageNum = {now: 1, _now: 1}, locationchange = false, nowLocation = '', forumWebsite = ['cs.rin.ru', 'www.flyert.com', 'bbs.pediy.com', 'www.libaclub.com'];
for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值
if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])};
}
registerMenuCommand();
if (menuId.length < 2) {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) {
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('[自动无缝翻页] - 不支持当前网站 [ ' + 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')});
}
} else if (menuAll[i][0] === 'menu_discuz_thread_page') { // 帖子内自动翻页 (仅论坛)
if (webType === 2 || forumWebsite.indexOf(location.host) > -1) {
menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
}
} 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 () {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});});
}
// 网站规则
function setDBSite() {
/*
自动翻页规则
locationchange: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
type:
1 = 由脚本实现自动无缝翻页
2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可
nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
intervals: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间,单位:ms
3 = 依靠元素距离可视区域底部的距离来触发翻页
4 = 部分简单的动态加载类网站(暂时)
insertPosition:
1 = 插入该元素本身的前面;
2 = 插入该元素当中,第一个子元素前面;
3 = 插入该元素当中,最后一个子元素后面;
4 = 插入该元素本身的后面;
5 = 插入该元素末尾(针对文本)
mimeType: 网站编码
scriptType: 单独插入 <script> 标签
1 = 下一页的所有 <script> 标签
2 = 下一页主体元素同级 <script> 标签
3 = 下一页主体元素同级 <script> 标签(远程文件)
4 = 下一页主体元素子元素 <script> 标签
history: 添加历史记录 并 修改当前 URL
forceHTTPS: 下一页链接强制 HTTPS
scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大(如果 Type = 3,则相反)
function:
before = 插入前执行函数;
after = 插入后执行函数;
parameter = 参数
*/
DBSite = {
discuz_forum: {
SiteTypeID: 0,
pager: {
type: 2,
nextLink: '#autopbn',
nextTextOf: '下一页',
scrollDelta: 1500
}
}, // Discuz! - 各版块帖子列表(自带无缝加载下一页按钮的)
discuz_guide: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]',
insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
}
}, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的)
discuz_waterfall: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#waterfall > li',
insertPosition: ['css;#waterfall', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
}
}, // Discuz! - 图片模式的各版块帖子列表(不带无缝加载下一页按钮的)
discuz_thread: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#postlist > div[id^="post_"]',
insertPosition: ['css;#postlist', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
},
function: {
before: discuz_thread_functionBefore
}
}, // Discuz! - 帖子内
discuz_search: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#threadlist > ul',
insertPosition: ['css;#threadlist', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
}
}, // Discuz! - 搜索页
discuz_youspace: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;tbody > tr:not(.th)',
insertPosition: ['css;tbody', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
}
}, // Discuz! - 回复页、主题页(别人的)
discuz_collection: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#ct .bm_c table > tbody',
insertPosition: ['css;#ct .bm_c table', 3],
replaceE: 'css;.pg, .pages',
scrollDelta: 1000
}
}, // Discuz! - 淘帖页
flarum: {
SiteTypeID: 0,
functionStart: function() {locationchange = true;if (location.pathname.indexOf('/d/') === -1) {curSite = DBSite.flarum;}},
pager: {
type: 2,
nextLink: '.DiscussionList-loadMore > button[title]',
intervals: 500,
scrollDelta: 1000
}
}, // Flarum
dux: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//li[@class="next-page"]/a[@href]',
pageElement: 'css;.content > article',
insertPosition: ['css;.content > .pagination', 1],
replaceE: 'css;.content > .pagination',
scrollDelta: 1500
},
function: {
before: dux_functionBefore
}
}, // WordPress 主题
baidu: {
SiteTypeID: 0,
host: 'www.baidu.com',
functionStart: function() {curSite = DBSite.baidu; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.new-pmd .c-img-border {position: initial !important;} .op-bk-polysemy-video__wrap.c-gap-bottom {display: none !important;}';},
pager: {
type: 1,
nextLink: 'id("page")//a[contains(text(),"下一页")][@href]',
pageElement: 'css;#content_left > *',
insertPosition: ['css;#content_left', 3],
replaceE: 'css;#page',
scrollDelta: 1200
}
}, // 百度 搜素
google: {
SiteTypeID: 0,
host: /.google./,
functionStart: function() {if (location.pathname === '/search') {
curSite = DBSite.google;
} else if (location.pathname === '/scholar') {
curSite = DBSite.google_scholar;
}},
pager: {
type: 1,
nextLink: 'id("pnnext")[@href]',
pageElement: 'css;#res > *',
insertPosition: ['css;#res', 3],
replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
scriptType: 1,
scrollDelta: 3000
}
}, // 谷歌 搜索
bing: {
SiteTypeID: 0,
host: ['www.bing.com','cn.bing.com'],
functionStart: function() {if (location.pathname === '/search') {
curSite = DBSite.bing; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.b_imagePair.square_mp > .inner {display: none;}';
} else if (location.pathname === '/academic/search') {
curSite = DBSite.bing_academic; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.aca_algo_count {display: none !important;}';
}},
pager: {
type: 1,
nextLink: '//a[contains(@class,"sb_pagN")][@href]',
pageElement: 'css;#b_results > li:not(.b_msg):not(.b_pag):not(#mfa_root)',
insertPosition: ['css;#b_results > .b_pag', 1],
replaceE: 'css;#b_results > .b_pag',
scrollDelta: 1500
}
}, // 必应 搜索
sogou: {
SiteTypeID: 0,
host: 'www.sogou.com',
functionStart: function() {if (location.pathname != '/') {curSite = DBSite.sogou;}},
pager: {
type: 1,
nextLink: 'css;#sogou_next',
pageElement: 'css;.results > *',
insertPosition: ['css;.results', 3],
replaceE: 'css;#pagebar_container',
scriptType: 4,
scrollDelta: 1200
}
}, // 搜狗 搜索
sogou_weixin: {
SiteTypeID: 0,
host: 'weixin.sogou.com',
functionStart: function() {if (location.pathname === '/') {
curSite = DBSite.sogou_weixin;
} else if (location.pathname === '/weixin') {
curSite = DBSite.sogou_weixin_search;
}},
pager: {
type: 2,
nextLink: '#look-more',
intervals: 1000,
scrollDelta: 1000
}
}, // 搜狗微信 - 首页
sogou_weixin_search: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;#sogou_next',
pageElement: 'css;.news-box > ul[class*="news-list"] > li',
insertPosition: ['css;.news-box > ul[class*="news-list"]', 3],
replaceE: 'css;#pagebar_container',
scrollDelta: 1000
}
}, // 搜狗微信 - 搜索
toutiao: {
SiteTypeID: 0,
host: ['www.toutiao.com', 'so.toutiao.com'],
functionStart: function() {if (location.hostname != 'www.toutiao.com') {if (location.pathname === '/search') {curSite = DBSite.toutiao;}}},
pager: {
type: 1,
nextLink: '//div[contains(@class, "-pagination")]/a[contains(string(), "下一页")]',
pageElement: 'css;div[class*="-result-list"] > .result-content[data-i]',
insertPosition: ['css;div[class*="-result-list"] > .result-content:not([data-i]):last-child', 1],
replaceE: 'css;div[class*="-pagination"]',
scrollDelta: 1200
},
function: {
before: toutiao_functionBefore
}
}, // 头条 搜索
so: {
SiteTypeID: 0,
host: 'www.so.com',
functionStart: function() {if (location.pathname != '/') {curSite = DBSite.so;}},
pager: {
type: 1,
nextLink: 'css;#snext[href]',
pageElement: 'css;ul.result > li, style:not(src)',
insertPosition: ['css;ul.result', 3],
replaceE: 'css;#page',
scrollDelta: 1200
},
function: {
before: so_functionBefore
}
}, // 360 搜索
duckduckgo: {
SiteTypeID: 0,
host: 'duckduckgo.com',
functionStart: function() {
if (getCookie('av') != '1') {
document.cookie='av=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 强制开启自带的无缝翻页功能
location.reload(); // 刷新网页
}
},
}, // DuckDuckGo 搜索
startpage: {
SiteTypeID: 0,
host: 'www.startpage.com',
functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.startpage;}},
pager: {
type: 1,
nextLink: startpage_functionNext,
pageElement: 'css;section.w-gl--desktop > div',
insertPosition: ['css;section.w-gl--desktop', 3],
replaceE: 'css;.pagination',
scrollDelta: 1500
}
}, // Startpage 搜索
yandex: {
SiteTypeID: 0,
host: 'yandex.com',
functionStart: function() {if (location.pathname === '/search/') {curSite = DBSite.yandex;}},
pager: {
type: 1,
nextLink: 'css;a.pager__item_kind_next',
pageElement: 'css;#search-result > *, style',
insertPosition: ['css;#search-result', 3],
replaceE: 'css;.pager',
scrollDelta: 1500
}
}, // Yandex 搜索
yahoo: {
SiteTypeID: 0,
host: 'search.yahoo.com',
functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo;}},
pager: {
type: 1,
nextLink: 'css;.pagination a.next[href]',
pageElement: 'css;#web ol > li',
insertPosition: ['css;#web ol', 3],
replaceE: 'css;.pagination',
scrollDelta: 1500
}
}, // Yahoo 搜索
yahoo_jp: {
SiteTypeID: 0,
host: 'search.yahoo.co.jp',
functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo_jp;}},
pager: {
type: 1,
nextLink: 'css;.Pagenation__next > a[href]',
pageElement: 'css;.Contents__innerGroupBody > div',
insertPosition: ['css;.Contents__innerGroupBody', 3],
replaceE: 'css;.Pagenation',
scrollDelta: 1500
}
}, // Yahoo 搜索 (JP)
qwant: {
SiteTypeID: 0,
host: 'www.qwant.com',
functionStart: function() {locationchange = true; if (location.search.indexOf('q=') > -1 && location.search.indexOf('t=web') > -1) {curSite = DBSite.qwant;}},
pager: {
type: 2,
nextLink: 'button[data-testid="buttonShowMore"]',
intervals: 500,
scrollDelta: 1500
}
}, // Qwant 搜索
ecosia: {
SiteTypeID: 0,
host: 'www.ecosia.org',
functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.ecosia;}},
pager: {
type: 1,
nextLink: 'css;nav.pagination a[href][aria-label="Next page"]',
pageElement: 'css;section.mainline > div:not(.related-queries)',
insertPosition: ['css;nav.pagination', 1],
replaceE: 'css;nav.pagination',
scrollDelta: 1500
}
}, // Ecosia 搜索
magi: {
SiteTypeID: 0,
host: 'magi.com',
functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.magi;}},
pager: {
type: 2,
nextLink: '.card[data-type="next"]',
nextText: '加载更多',
scrollDelta: 1500
}
}, // Magi 搜索
baidu_tieba: {
SiteTypeID: 0,
host: 'tieba.baidu.com',
functionStart: function() {if (location.pathname === '/f') {
baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
curSite = DBSite.baidu_tieba; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}'; // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
//} else if (location.pathname.indexOf('/p/') > -1) {
//curSite = DBSite.baidu_tieba_post;
} else if (location.pathname === '/f/search/res') {
curSite = DBSite.baidu_tieba_search;
}},
pager: {
type: 4,
nextLink: baidu_tieba_functionNext,
pageElement: 'css;#thread_list > li',
insertPosition: ['css;#thread_list', 3],
insertElement: baidu_tieba_insertElement,
replaceE: 'css;#frs_list_pager',
intervals: 3000,
scrollDelta: 2000
},
function: {
before: baidu_tieba_functionBefore
}
}, // 百度贴吧 - 帖子列表
baidu_tieba_post: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//li[contains(@class,"pb_list_pager")]/a[contains(text(),"下一页")][@href]',
pageElement: 'css;#j_p_postlist > div',
insertPosition: ['css;#j_p_postlist', 3],
replaceE: 'css;li.pb_list_pager',
scrollDelta: 1000
}
}, // 百度贴吧 - 帖子内
baidu_tieba_search: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="next"][@href]',
pageElement: 'css;#j_p_postlist > *',
insertPosition: ['css;#j_p_postlist', 3],
replaceE: 'css;.pager.pager-search',
scriptType: 1,
scrollDelta: 1000
}
}, // 百度贴吧 - 搜索页
douban_subject_comments: {
SiteTypeID: 0,
host: 'movie.douban.com',
functionStart: function() {if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { // 短评列表
curSite = DBSite.douban_subject_comments;
} else if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/reviews') > -1) { // 影评列表
curSite = DBSite.douban_subject_reviews;
} else if(location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/episode') > -1) { // 电视剧每集评论
curSite = DBSite.douban_subject_episode;
}},
pager: {
type: 1,
nextLink: '//a[@class="next"][@href]',
pageElement: 'css;#comments > .comment-item',
insertPosition: ['css;#paginator', 1],
replaceE: 'css;#paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 短评
douban_subject_reviews: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//link[@rel="next"][@href]',
pageElement: 'css;.review-list > div',
insertPosition: ['css;.review-list', 3],
replaceE: 'css;.paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 影评
douban_subject_episode: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//link[@rel="next"][@href]',
pageElement: 'css;#comments > div',
insertPosition: ['css;#comments', 3],
replaceE: 'css;.paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 剧评
douban_group: {
SiteTypeID: 0,
host: 'www.douban.com',
functionStart: function() {if (location.pathname.indexOf('/group/topic/') > -1) {
curSite = DBSite.douban_group_topic;
} else if (location.pathname.indexOf('/group/explore') > -1) {
curSite = DBSite.douban_group_explore;
} else if (location.pathname.indexOf('/group/') > -1 && location.pathname.indexOf('/discussion') > -1) {
curSite = DBSite.douban_group;
}},
pager: {
type: 1,
nextLink: 'css;span.next > a',
pageElement: 'css;table.olt > tbody > tr:not(.th)',
insertPosition: ['css;table.olt > tbody', 3],
replaceE: 'css;.paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 小组
douban_group_explore: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;span.next > a',
pageElement: 'css;#content .article > div > .channel-item',
insertPosition: ['css;#content .article > div', 3],
replaceE: 'css;.paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 小组讨论精选
douban_group_topic: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;span.next > a',
pageElement: 'css;#comments > li',
insertPosition: ['css;#comments', 3],
replaceE: 'css;.paginator',
scrollDelta: 1000
}
}, // 豆瓣 - 小组帖子内
weibo_comment: {
SiteTypeID: 0,
host: 'weibo.com',
pager: {
type: 2,
nextLink: 'a[action-type="click_more_comment"]',
nextText: '查看更多c',
scrollDelta: 1000
}
}, // 微博评论
tianya: {
SiteTypeID: 0,
host: 'bbs.tianya.cn',
functionStart: function() {if (location.pathname.indexOf('/list') > -1) {
curSite = DBSite.tianya;
} else if (location.pathname.indexOf('/post') > -1) {
curSite = DBSite.tianya_post;
}},
pager: {
type: 1,
nextLink: '//div[contains(@class, "pages")]/div[@class="links"]/a[contains(text(), "下一页")]',
pageElement: 'css;.tab-bbs-list > tbody:not(:first-of-type)',
insertPosition: ['css;table.tab-bbs-list', 3],
replaceE: '//div[contains(@class, "pages")]',
scrollDelta: 1500
}
}, // 天涯社区
tianya_post: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'a.js-keyboard-next[href]',
pageElement: 'css;.atl-main > div[class="atl-item"]',
insertPosition: ['css;.atl-main', 3],
replaceE: 'css;.atl-pages > form',
scrollDelta: 1500
}
}, // 天涯社区 - 帖子内
nga_thread: {
SiteTypeID: 0,
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;
}},
pager: {
type: 1,
nextLink: 'css;#pagebbtm a[title="下一页"][href]',
pageElement: 'css;#topicrows > tbody, #topicrows > script',
insertPosition: ['css;#topicrows', 3],
replaceE: 'css;div[name="pageball"]',
scriptType: 2,
scrollDelta: 1000
},
function: {
after: nga_thread_functionAfter
}
}, // NGA - 各版块帖子列表
nga_read: {
SiteTypeID: 0,
pager: {
type: 1,
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"]',
scriptType: 2,
scrollDelta: 1000
}
}, // NGA - 帖子内
v2ex_recent: {
SiteTypeID: 0,
host: ['v2ex.com', 'www.v2ex.com'],
functionStart: function() {if (location.pathname === '/') { // 首页
v2ex_functionAfter('#Main a.topic-link:not([target])');
} else if (location.pathname === '/recent') { // 最近主题页
curSite = DBSite.v2ex_recent;
v2ex_functionAfter('#Main a.topic-link:not([target])');
} else if (location.pathname === '/notifications') { // 提醒消息页
curSite = DBSite.v2ex_notifications;
v2ex_functionAfter('#Main a[href^="/t/"]:not([target])');
} else if (location.pathname === '/balance') { // 账户余额页
curSite = DBSite.v2ex_balance;
} else if (location.pathname.indexOf('/go/') > -1) { // 分类主题页
curSite = DBSite.v2ex_go;
v2ex_functionAfter('#Main a.topic-link:not([target])');
} else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页
curSite = DBSite.v2ex_replies;
v2ex_functionAfter('#Main a[href^="/t/"]:not([target])');
}},
pager: {
type: 1,
nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
pageElement: 'css;.cell.item',
insertPosition: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table',
scrollDelta: 1500
},
function: {
after: v2ex_functionAfter,
parameter: '#Main a.topic-link:not([target])'
}
}, // V2EX - 最近主题页
v2ex_notifications: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
pageElement: 'css;#notifications > div',
insertPosition: ['css;#notifications', 3],
replaceE: 'css;#Main > .box > .cell[style] > table',
scrollDelta: 1500
},
function: {
after: v2ex_functionAfter,
parameter: '#Main a[href^="/t/"]:not([target])'
}
}, // V2EX - 提醒消息页
v2ex_replies: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
pageElement: '//div[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]',
insertPosition: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
replaceE: 'css;#Main > .box > .cell[style] > table',
scrollDelta: 1500
},
function: {
after: v2ex_functionAfter,
parameter: '#Main a[href^="/t/"]:not([target])'
}
}, // V2EX - 用户回复页
v2ex_go: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
pageElement: 'css;#TopicsNode > div',
insertPosition: ['css;#TopicsNode', 3],
replaceE: 'css;#Main > .box > .cell[style] > table',
scrollDelta: 1500
},
function: {
after: v2ex_functionAfter,
parameter: '#Main a.topic-link:not([target])'
}
}, // V2EX - 分类主题页
v2ex_balance: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
pageElement: 'css;#Main .box > div:not(.cell) > table > tbody > tr:not(:first-child)',
insertPosition: ['css;#Main .box > div:not(.cell) > table > tbody', 3],
replaceE: 'css;#Main > .box > .cell[style] > table',
scrollDelta: 1000
}
}, // V2EX - 账户余额页
lkong: {
SiteTypeID: 0,
host: 'www.lkong.com',
functionStart: function() {if (location.pathname.indexOf('/forum/') > -1) {
curSite = DBSite.lkong;
} else if (location.pathname.indexOf('/thread/') > -1) {
curSite = DBSite.lkong_thread;
}},
pager: {
type: 1,
nextLink: lkong_functionNext,
pageElement: '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]',
insertPosition: ['//div[@class="main-title"][1]/parent::div/parent::div/parent::div', 3],
replaceE: 'css;ul.ant-pagination',
intervals: 500,
scrollDelta: 1200
}
}, // 龙的天空 - 各版块帖子列表
lkong_thread: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: lkong_functionNext,
pageElement: '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]',
insertPosition: ['//div[@class="main-content"][1]/parent::div/parent::div', 3],
replaceE: 'css;ul.ant-pagination',
intervals: 500,
scrollDelta: 1200
}
}, // 龙的天空 - 帖子内
pediy_forum: {
SiteTypeID: 0,
host: 'bbs.pediy.com',
functionStart: function() {if (location.pathname.indexOf('/forum-') > -1) {
curSite = DBSite.pediy_forum;
} else if (location.pathname.indexOf('/thread-') > -1) {
if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.pediy_thread;}
}},
pager: {
type: 1,
nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
pageElement: 'css;table.threadlist > tbody > tr',
insertPosition: ['css;table.threadlist > tbody', 3],
replaceE: 'css;ul.pagination',
scrollDelta: 1500
}
}, // 看雪论坛 - 各版块帖子列表
pediy_thread: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
pageElement: 'css;table.postlist > tbody > tr[data-pid]',
insertPosition: ['css;table.postlist > tbody > tr:not([data-pid])', 1],
replaceE: 'css;ul.pagination',
scrollDelta: 1500
}
}, // 看雪论坛 - 帖子内
kdslife: {
SiteTypeID: 0,
host: 'club.kdslife.com',
functionStart: function() {
if (location.pathname.indexOf('/f_') > -1) {
curSite = DBSite.kdslife;
} else if (location.pathname.indexOf('/t_') > -1) {
curSite = DBSite.kdslife_t;
}},
pager: {
type: 1,
nextLink: '//div[@class="fr i3_r"]/a[@href][contains(text(), "后一页")]',
pageElement: 'css;ul.main_List > li.i2:not(.h_bg)',
insertPosition: ['css;ul.main_List > li.i3', 1],
replaceE: 'css;ul.main_List > li.i3',
scrollDelta: 1000
}
}, // 宽带山论坛
kdslife_t: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//div[@class="pages"]/a[contains(text(), ">>")]',
pageElement: 'css;#reply_list_panel > *, script[src*="ui/js/kds.js"]',
insertPosition: ['css;#reply_list_panel', 3],
replaceE: 'css;.pages',
scriptType: 3,
scrollDelta: 1000
}
}, // 宽带山论坛 - 帖子内
libaclub: {
SiteTypeID: 0,
host: 'www.libaclub.com',
functionStart: function() {
if (location.pathname === '/' || location.pathname.indexOf('/date_') > -1) {
curSite = DBSite.libaclub;
} else if (location.pathname.indexOf('/f_') > -1) {
curSite = DBSite.libaclub_f;
} else if (location.pathname.indexOf('/t_') > -1 || location.pathname.indexOf('/reply_') > -1) {
curSite = DBSite.libaclub_t;
} else if (location.pathname.indexOf('/prt_') > -1) {
curSite = DBSite.libaclub_prt;
} else if (location.pathname === '/facade.php') {
curSite = DBSite.libaclub_search;
}
document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}';},
pager: {
type: 1,
nextLink: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
insertPosition: ['css;ul.ui-list', 3],
replaceE: 'css;div.ui-crumbs-more',
scrollDelta: 1200
}
}, // 篱笆网论坛
libaclub_f: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//div[@class="ui-paging"]/a[@class="ui-paging-next"]',
pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
insertPosition: ['css;ul.ui-list', 3],
replaceE: 'css;div.ui-paging',
scrollDelta: 1200
}
}, // 篱笆网论坛 - 各版块帖子列表
libaclub_t: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;a.ui-paging-next',
pageElement: 'css;.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
insertPosition: ['css;.ui-box-content', 3],
replaceE: 'css;div.ui-paging',
scrollDelta: 1500
}
}, // 篱笆网论坛 - 帖子内
libaclub_prt: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: 'css;a.ui-paging-next',
pageElement: 'css;ul.ui-list > li',
insertPosition: ['css;ul.ui-list', 3],
replaceE: 'css;div.ui-paging',
scrollDelta: 2000
}
}, // 篱笆网论坛 - 帖子内 - 打印版
libaclub_search: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
pageElement: 'css;.ui-box-main > ul.ui-list > li',
insertPosition: ['css;.ui-box-main > ul.ui-list', 3],
replaceE: 'css;div.ui-page',
scrollDelta: 1200
}
}, // 篱笆网论坛 - 搜索页
lieyou: {
SiteTypeID: 0,
host: 'bbs.lieyou888.com',
functionStart: function() {if (location.pathname.indexOf('/forum') > -1) {curSite = DBSite.lieyou888;}},
pager: {
type: 1,
nextLink: '//div[contains(@class, "_pageNav")]/a[@href][contains(text(), "下一页")]',
pageElement: 'css;ul.gb-bbs-list > li',
insertPosition: ['css;ul.gb-bbs-list', 3],
replaceE: 'css;._pageNav',
scrollDelta: 1000
},
function: {
before: src_original_2_functionBefore
}
}, // 芥子空间论坛
xcar_forumdisplay: {
SiteTypeID: 0,
host: 'www.xcar.com.cn',
functionStart: function() {if (location.pathname === '/bbs/forumdisplay.php') {curSite = DBSite.xcar_forumdisplay}},
pager: {
type: 1,
nextLink: 'css;a.page_down',
pageElement: 'css;.table-section > dl:not(.table_head)',
insertPosition: ['css;.table-section', 3],
replaceE: 'css;.forumList_page',
scrollDelta: 2000
}
}, // 爱卡汽车网论坛 - 各版块帖子列表
flyert_forumdisplay: {
SiteTypeID: 0,
host: 'www.flyert.com',
functionStart: function() {if (location.search.indexOf('mod=forumdisplay') > -1) {
curSite = DBSite.flyert_forumdisplay;
} else if (location.search.indexOf('mod=viewthread') > -1) {
if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;}
}},
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]',
insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
replaceE: 'css;.pg',
scrollDelta: 2500
}
}, // 飞客网论坛 - 各版块帖子列表
flyert_viewthread: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
pageElement: 'css;#postlist > .comiis_viewbox',
insertPosition: ['css;#postlist', 3],
replaceE: 'css;.comiis_pgs > .pg',
scrollDelta: 3000
}
}, // 飞客网论坛 - 帖子内
adnmb3: {
SiteTypeID: 0,
host: 'adnmb3.com',
functionStart: function() {
if (location.pathname.indexOf('/m/f/') > -1) {
curSite = DBSite.adnmb3_mf;
} else if (location.pathname.indexOf('/m/t/') > -1) {
curSite = DBSite.adnmb3_mt;
} else if (location.pathname.indexOf('/f/') > -1 || location.pathname.indexOf('/Forum/') > -1) {
curSite = DBSite.adnmb3;
} else if (location.pathname.indexOf('/t/') > -1) {
curSite = DBSite.adnmb3_t;
}},
pager: {
type: 1,
nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "下一页")]',
pageElement: 'css;.h-threads-list > *, script[src$="/h.desktop.js"]',
insertPosition: ['css;.h-threads-list', 3],
replaceE: '//ul[contains(@class, "pagination")]',
scriptType: 3,
scrollDelta: 1500
}
}, // A 岛
adnmb3_t: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "下一页")]',
pageElement: 'css;.h-threads-list > .h-threads-item > .h-threads-item-replys, script[src$="/h.desktop.js"]',
insertPosition: ['css;.h-threads-list > .h-threads-item', 3],
replaceE: '//ul[contains(@class, "pagination")]',
scriptType: 3,
scrollDelta: 1500
}
}, // A 岛 - 帖子内
adnmb3_mf: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//li[contains(@class, "pagination-next")]//a[contains(text(), "下一页")]',
pageElement: 'css;.h-middle > div[id^="threads_"], .h-middle > hr.h-middle > div[id^="threads_"], .h-middle > hr:nth-of-type(n+2), script[src$="/h.mobile.js"]',
insertPosition: ['css;#h-threads-pagination', 1],
replaceE: 'css;#h-threads-pagination',
scriptType: 3,
scrollDelta: 1500
}
}, // A 岛 - 帖子列表(手机版)
adnmb3_mt: {
SiteTypeID: 0,
pager: {
type: 1,
nextLink: '//li[contains(@class, "pagination-next")]//a[contains(text(), "下一页")]',
pageElement: 'css;.h-threads-replylist > div, script[src$="/h.mobile.js"]',
insertPosition: ['css;.h-threads-replylist', 3],
replaceE: 'css;#h-threads-pagination',
scriptType: 3,
scrollDelta: 1500
}
}, // A 岛 - 帖子内(手机版)
jandan: {
SiteTypeID: 0,
host: 'jandan.net',
functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/page/') > -1) {
curSite = DBSite.jandan;
} else if (location.pathname === '/dzh') {
curSite = DBSite.jandan_dzh;