-
Notifications
You must be signed in to change notification settings - Fork 219
/
Copy pathAdblock4limbo.function.js
2558 lines (2220 loc) · 122 KB
/
Adblock4limbo.function.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 Adblock4limbo——导航及各类功能函数合集.[github]
// @namespace https://limbopro.com/Adguard/Adblock4limbo.function.js
// @version 0.2025.02.05
// @license CC BY-NC-SA 4.0
// @description 实用网站导航 —— 免费在线影视/前端学习/开发者社区/新闻/建站/下载工具/格式转换工具/电子书/新闻/写作/免费漫画等;
// @author limbopro
// @match https://*/*
// @match https://twitter.com/*
// @match https://www.xvideos.com/*
// @match https://www.youtube.com/*
// @match https://developer.mozilla.org/*
// @match https://venus-av.com/*
// @exclude https://limbopro.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=limbopro.com
// @run-at document-end
// @grant none
// ==/UserScript==
/**
* ---------------------------
* 毒奶去网页广告计划
* Author: limbopro
* 使用教程:https://limbopro.com/archives/12904.html
* 联系博主:https://t.me/limboprobot
* 电报群组:https://t.me/Adblock4limbo
* FAQ:https://t.me/Adblock4limbo/21 常见问题与回答
* Github:https://github.com/limbopro/Adblock4limbo
* ---------------------------
*/
// 各种 function 的集合
// 获取M3U8文件资源链接
var repeat_regex = ["https:?\/\/.*?hls.*?\.m3u8", "https:?\/\/.*?phncdn.*?hls.*?\.m3u8", "https:?\/\/.*?mushroomtrack.*?\.m3u8"]
function m3u8_tempt(x) {
var i, url_result; var url_regex = new RegExp(x, "gi")
var ele = ["script", "a"];
var ele_catch = document.querySelectorAll(ele);
for (i = 0; i < ele_catch.length; i++) {
if ((url_result = url_regex.exec(ele_catch[i].innerHTML)) != null) {
document.getElementById("copy").value = url_result;
console.log("Catch it")
}
}
}
/* 循环播放 */
function video_loopPlay() {
setInterval(function () {
var ele = ["video[preload='none', 'common'],video#player"];
var ele_catch = document.querySelector(ele);
if (ele_catch) {
ele_catch.play()
//console.log("视频已开启循环播放;")
}
}, 1000)
}
/* 延后播放 */
function video_delayPlay(time) {
setTimeout(function () {
var ele = ["video[preload='none', 'common'],video#player"];
var ele_catch = document.querySelector(ele);
if (ele_catch) {
ele_catch.play()
//console.log("视频已延后播放;")
}
}, time)
EF5E
}
function selector_one_by_one(x) { // 按选择器一个一个移除
if (document.querySelector(x)) {
document.querySelectorAll(x).forEach((x) => { x.remove() })
}
}
/* 删除所有cookies */
function cookiesRemove() {
let qi = confirm('导航设置已重置;🔔是否需要清空当前网站所有cookie以确保完全重置成功?(可选择不清理;清理🧹后需重新登录...)');
if (qi == true) {
var exp = new Date();
var domain = "." + document.domain;
exp.setTime(exp.getTime() + 0 * 24 * 60 * 60 * 1000);
document.cookie.split(';').forEach(x => {
if (x.search('=')) {
document.cookie = x.split("=")[0] + "=''; " + "expires=" + exp.toGMTString() + ';' + "path=/;" + "domain=" + domain + ";";
document.cookie = x.split("=")[0] + "=''; " + "expires=" + exp.toGMTString() + ';' + "path=/;";
console.log(x.split("=")[0] + " ♻️🗑️...")
}
})
console.log(exp)
}
location.reload()
}
/* 连续点击3次空白处起导航🧭页面 */
function tripleClick() {
var startTime = '';
var number = 0;
const htmlbody = document.querySelectorAll('body')[0]
htmlbody.addEventListener('touchstart', function () {
startTime = +new Date()
number += 1;
console.log(number)
tripleClick_check(number)
})
function tripleClick_check(x) {
setTimeout(() => {
if (x >= 4) {
console.log('连续点击超过' + x + "次")
body_build('true') // 如果按钮出现,且其他如搜索不存在则可唤出导航页面
} else {
number = 0;
console.log("number被重设为0")
}
}, 850)
}
}
tripleClick();
/* 计算用户累计在本网站停留时间 */
(function () {
function timerCount() {
if (localStorage.getItem('timing') !== '' && localStorage.getItem('timing') !== 0) { // 如果 timing 不为空
localStorage.setItem('timing', Number(localStorage.getItem('timing')) + 1)
} else {
localStorage.setItem('timing', 1) // 初始化1秒
}
}
function itimer() {
var time = localStorage.getItem('timing')
parseInt(time / 60 / 60) + "小时" + parseInt(localStorage.getItem('timing') / 60) + "分" + time % 60 + "秒⌛️";
var currentTime_innerHTML = "你已在当前网站累计停留" + parseInt(localStorage.getItem('timing') / 60) + "分" + time % 60 + "秒⌛️";
if (document.getElementById('itimer') !== null) {
var xr = document.getElementById('itimer');
xr.innerHTML = currentTime_innerHTML;
}
}
var timerCount_interval = setInterval(function () {
timerCount()
itimer()
}, 1000)
})()
// 重设导航/成人保护模式设置
var weblist_regex = new RegExp(/\b(xiaobaotv|iyf|gimy|ddrk|ddys|olevod|hitomi|hltv|javlibrary|thisav|njav|missav|javlib|javbus|attackers|18comic|javday|hamnime|takara|tameikegoro|deeps|moodyz|s1s1s1|nagae|ideapocket|dasdas|oppai|kawaii|satsu|mgstage|manji-group|rocket|muku|dmm|beauty|gloryquest|javbus|supjav|jable|xvideos|pornhub|porn|wnacg|av)\b/i);
if (window.location.href.match('limbopro.com')) {
setCookie('daohangMode_global', 'true', '400');
setCookie('adultMode', 'false', '400');
} else if (weblist_regex.test(window.location.href.toLowerCase()) && getCookie('daohangMode_global') == '') {
setCookie('daohangMode_global', 'false', '400');
} else if (weblist_regex.test(window.location.href.toLowerCase())) {
console.log('该网址被匹配,将按全局设置执行相关操作...!')
}
function wtf() {
setInterval(() => {
// dh_buttonMain
if (document.getElementById('dh_buttonMain') !== null && document.getElementById('dh_buttonMain').style !== null && document.getElementById('dh_buttonMain').style.height !== null) {
localStorage.setItem('dh_buttonMain', document.getElementById('dh_buttonMain').style.height)
// console.log("当前导航按钮高度[dh_buttonMain]" + localStorage.getItem('dh_buttonMain'))
}
// _button
if (localStorage.getItem('navigator_mobile') == 'mobile' && localStorage.getItem('navigator_pc') == '') { // 移动端top
//if (localStorage.getItem('dh_button') !== 'px') {
localStorage.setItem('dh_button', document.getElementById('dh_button').style.top)
//}
} else if (localStorage.getItem('navigator_mobile') == 'mobile') {
localStorage.setItem('navigator_pc', '')
localStorage.setItem('dh_button', 'px')
wtf()
}
}, 2500)
}
wtf()
function touchandmove(selector) { // 移动端导航按钮可托拽
// https://blog.csdn.net/weixin_46513544/article/details/105674150
var dh_buttonMain_touch = document.querySelectorAll(selector)[0]
var startX = 0;
var startY = 0;
var x = 0;
var y = 0;
dh_buttonMain_touch.addEventListener('touchstart', function (e) {
startX = e.targetTouches[0].pageX
startY = e.targetTouches[0].pageY
x = this.offsetLeft
y = this.offsetTop
})
dh_buttonMain_touch.addEventListener('touchmove', function (e) {
var moveX = e.targetTouches[0].pageX - startX
var moveY = e.targetTouches[0].pageY - startY
//this.style.left = moveX + x + 'px'
this.style.top = moveY + y + 'px'
e.preventDefault();
})
}
function height() {
var height = ''
if (navigator.userAgent.match('Mobile') !== null) {
localStorage.setItem('navigator_mobile', 'mobile')
height = window.screen.height + 'px'
} else if (navigator.userAgent.match('Mobile') == null) {
localStorage.setItem('navigator_pc', 'pc')
if (localStorage.getItem('dh_buttonMain') !== null && localStorage.getItem('navigator_mobile') !== 'mobile') {
height = localStorage.getItem('dh_buttonMain');
} else {
localStorage.setItem('navigator_mobile', '')
height = '520px'
}
}
return height;
}
function bottom() {
var bottom = ''
if (navigator.userAgent.match('Mobile') !== null) {
//height = window.screen.height + 'px'
bottom = 'mobile'
} else {
//height = '420px'
bottom = 'pc'
}
return bottom;
}
function bottom_wrapper() {
if (navigator.userAgent.match('Mobile') !== null) {
document.getElementById('dh_buttonContainer').classList.add('bottom-mobile') // 移动端新增类
} else if (document.getElementById('dh_buttonContainer').className.match('bottom-mobile') !== '') {
document.getElementById('dh_buttonContainer').classList.remove('bottom-mobile') // PC端移除该类
}
}
function position() {
if (navigator.userAgent.match('Mobile') !== null) {
document.getElementById('dh_buttonMain').classList.add('positiondh_buttonMain') // 移动端新增类
} else if (document.getElementById('dh_buttonMain').className.match('positon') !== '') {
document.getElementById('dh_buttonMain').classList.remove('positiondh_buttonMain') // PC端移除该类
}
}
// 先新建一个按钮
function adblock4limbo(x, csp) {
// 新建 dh_buttonContainer
let dh_buttonContainer = document.createElement('div');
dh_buttonContainer.id = 'dh_buttonContainer';
let body = document.body;
document.querySelector('html').appendChild(dh_buttonContainer)
// document.querySelector('html').insertBefore(dh_buttonContainer, body);
// 新建 dh_buttonMain
let dh_buttonMain = document.createElement('div'); // body 换为 div
dh_buttonMain.id = 'dh_buttonMain'; // 高等悬挂
dh_buttonMain.style.height = height()
document.getElementById('dh_buttonContainer').appendChild(dh_buttonMain)
// 定义按钮
let _button = document.createElement('button')
_button.id = 'dh_button';
_button.draggable = "true";
if (getCookie("daohangMode_global") == 'false' && getCookie("daohangMode_yourChoice") !== "show" || getCookie("daohangMode_global") == '') {
_button.setAttribute("class", "cmsnone " + bottom());
} else if (getCookie("daohangMode_global") == 'true') {
_button.setAttribute("class", "cms " + bottom());
} else {
_button.setAttribute("class", "cms " + bottom());
}
if (csp == 'nocsp') {
console.log('创建不带CSP属性按钮...')
//_button.setAttribute('onclick', "body_build('true');")
//// var nocsp = 'padding:0px;transition-duration:666ms;transition-property:height;z-index:114154;bottom:15%;right:0.5%;position:fixed;border:transparent;background-color:transparent;background-image:url("https://raw.githubusercontent.com/limbopro/Adblock4limbo/main/Adguard/uploads/imgs/Adblock4limbo.svg") !important;background-size:100% !important;background-repeat:no-repeat;';
var nocsp = '/*border:1px solid blue !important; */ padding:0px;transition-duration:666ms;transition-property:height;z-index:114154;right:0;position:fixed;border:transparent;background-color:transparent;background-image:url("https://raw.githubusercontent.com/limbopro/Adblock4limbo/main/Adguard/Adblock4limbo.png") !important;background-size:100% !important;background-repeat:no-repeat;';
_button.style = nocsp;
document.getElementById('dh_buttonMain').appendChild(_button); // 在 dh_buttonMain 下添加按钮
} else if (csp == 'csp') {
console.log('创建带CSP属性按钮...')
var csp = 'box-shadow:inset 0px 0px 15px 3px #23395e;background:linear-gradient(to bottom,#2e466e 5%,#415989 100%);background-color:#2e466e;border-radius:17px;border:1px solid #1f2f47;display:inline-block;cursor:pointer;color:#ffffff;font-family:Arial;font-size:15px;padding:6px 13px;text-decoration:none;text-shadow:0px 1px 0px #263666;padding:0px;transition-duration:666ms;transition-property:height;z-index:114154;bottom:15%;right:0.5%;/*position:fixed;*/border:transparent;border-radius:50%;';
_button.style = csp;
_button.textContent = '导航';
document.getElementById('dh_buttonMain').appendChild(_button); // 在 dh_buttonMain 下添加按钮
//_button.setAttribute("class", "cspButton");
document.getElementById('dh_button').style.height = x;
document.getElementById('dh_button').style.width = x;
if (window.innerHeight < 600) {
document.querySelector('#dh_button').style.bottom = '30%';
}
}
if ((navigator.userAgent.match('Mobile') !== null)) {
if (localStorage.getItem('dh_button') !== null) {
_button.style.top = localStorage.getItem('dh_button')
};
} else {
_button.style.top = 'px';
}
position();
bottom_wrapper();
touchandmove('#dh_button');
// 监控用户是否需要拖动导航按钮
document.getElementById('dh_button').addEventListener("mouseover", (event) => {
document.getElementById('dh_buttonContainer').classList.remove('pointer-events-none')
setTimeout(() => {
document.getElementById('dh_buttonContainer').classList.add('pointer-events-none')
}, 4000)
});
}
// 定义按钮尺寸
function _button_button_width() {
//const userAgent = navigator.userAgent.toLowerCase();
const window_innerWidth = window.innerWidth;
if (window_innerWidth <= 920) {
//if (/\b(android|iphone|ipad|ipod)\b/i.test(userAgent)) {
var size = '40px';
return size;
} else {
var size = '55px';
return size;
}
}
var click_dont_move_and_click = 600;
function hidden_adblock4limbo() {
if (document.getElementById('dh_button') !== null) {
console.log("//页面滑动且导航按钮存在...") // 存在
var last_known_scroll_position = window.scrollY;
// const _button = document.getElementById('dh_button'); const new_div = document.getElementById('dh_buttonMain');
setTimeout(() => {
if (last_known_scroll_position !== window.scrollY && document.querySelector('img.lockscreen') == null) {
////console.log("// hidden_adblock4limbo() 按钮存在,且页面还在滑动...");
if (document.querySelector("#dh_pageContainer").style.zIndex > 0) {
document.querySelector("#dh_pageContainer").style.zIndex = ++document.querySelector("#dh_pageContainer").style.zIndex;
}
znsh_unlock();
// _button_button('1');
if (click_dont_move_and_click < 400) { // 定时400秒
click_dont_move_and_click = click_dont_move_and_click + 600;
} else {
click_dont_move_and_click = click_dont_move_and_click + 120;
}
document.querySelector('#dh_button').style.zIndex = document.querySelector('#dh_button').style.zIndex + 1;
} else {
// _button_button('0');
click_dont_move_and_click = --click_dont_move_and_click;
if (click_dont_move_and_click < 300) {
// 暂时开启宅男守护模式
// znsh_ele_create();
// znsh_css_create();
}
}
}, 1000)
} else {
////console.log("// hidden_adblock4limbo() 按钮存在,但已隐藏...");
}
}
document.body.addEventListener('click', () => { // 点击计数器
if (click_dont_move_and_click < 400) { // 定时400秒
click_dont_move_and_click = click_dont_move_and_click + 600;
} else {
click_dont_move_and_click = click_dont_move_and_click + 120;
}
})
// 长时间不动则隐藏按钮
function _button_button(x) { // 显示导航按钮
if (document.getElementById('dh_button') !== null) {
const _button = document.getElementById('dh_button');
const new_div = document.getElementById('dh_buttonMain');
if (x == 1 && !(document.getElementById('dh_button') === null)) {
_button.style.height = _button_button_width();
_button.style.width = _button_button_width();
new_div.style.zIndex = '114154';
console.log('显示导航按钮🔘')
} else {
/*
if ((_button.style.height == "0%")) {
} else {
setTimeout(() => {
_button.style.height = '0%';
}, 500)
}
*/
}
}
}
// 当鼠标🖱靠近时显示按钮
//onload = () => {
/*
const mousemove_element = document.querySelectorAll('body')[0];
// 绑定鼠标移动事件
mousemove_element.addEventListener('mousemove', e => {
////console.log("// mousemove_element 鼠标所在位置:" + e.offsetX);
////console.log("// mousemove_element 要触发位置为:" + Math.floor(0.55 * window.innerWidth));
if (document.body.clientWidth) {
if (e.offsetX >= 0.85 * window.innerWidth) {
_button_button('1');
}
}
});
*/
//}
// 为按钮添加监听事件 防止被破坏
function _onclick_button() {
if (document.querySelector('button#dh_button')) {
document.querySelector('button#dh_button').addEventListener("click", function () {
body_build('true'); // 添加监听事件
})
}
setTimeout(() => {
if (document.querySelector("button#xX")) {
document.querySelector('button#xX').addEventListener("click", function () {
body_build('false'); // 添加监听事件
})
}
if (document.querySelector('button#webChat')) {
document.querySelector('button#webChat').addEventListener("click", function () {
crisp_active('1', '1', '1'); // 添加监听事件
})
}
if (document.querySelector('button#hidedaohang')) {
document.querySelector('button#hidedaohang').addEventListener("click", function () {
daohangMode_switch(); // 添加监听事件
})
}
if (document.querySelector('button#resetting')) {
document.querySelector('button#resetting').addEventListener("click", function () {
// 移动端 重置导航按钮高度记忆
localStorage.setItem('dh_buttonMain', '')
localStorage.setItem('navigator_pc', '')
document.getElementById('dh_button').style.top = null
// PC端 重置导航按钮高度记忆
if (navigator.userAgent.match('Mobile') == null) {
document.getElementById('dh_buttonMain').style.height = '420px'
}
// 隐藏聊天💬按钮
if (localStorage.getItem("crisp") == 'active') {
localStorage.setItem("crisp", ""); // 重置导航
}
setCookie("daohangMode_yourChoice", 'show', 400) // 显示按钮
localStorage.setItem('crisp_active_c', '')
cookiesRemove()
setTimeout(() => {
location.reload();
}, 1000);
})
}
/*
if (document.querySelector('a#lsj')) {
document.querySelector('a#lsj').addEventListener("click", function () {
open_googlesearch_iframe(); // 添加监听事件
})
}
*/
if (document.getElementById('nsfwmode_switch')) {
document.getElementById('nsfwmode_switch').addEventListener('click', function () {
nsfwmode(); // 开始或关闭成人模式
})
}
if (document.getElementById('lock_screen')) {
document.getElementById('lock_screen').addEventListener('click', function () {
lock_screen_switch(); // 开始或关闭锁屏
})
}
}, 1000)
}
// 监听导航页的按钮是否被点击
/*
function if_a_click_then_close_daohang() {
if (document.querySelector('div.echo')) {
document.querySelector('div.echo').querySelectorAll('a').forEach((x) => {
x.addEventListener('click', () => {
body_build('false');
})
})
}
}
*/
var nsfw_regex = new RegExp(/\b(javlibrary|thisav|njav|missav|javlib|javbus|attackers|18comic|javday|hamnime|takara|tameikegoro|deeps|moodyz|s1s1s1|nagae|ideapocket|dasdas|oppai|kawaii|satsu|mgstage|manji-group|rocket|muku|dmm|beauty|gloryquest|javbus|supjav|jable|xvideos|pornhub|porn|wnacg|av)\b/i);
var csp_regex = new RegExp(/\b(twitter|xvideos)\b/i);
var echo_ell_length = 21; // 总共导航类目数量
var echo_ell_overlay_length = 1; // 带有滚动条的的导航类目数量
// 判断是否需要在当前页面插入导航按钮
let str_ua = navigator.userAgent.toLowerCase();
let regexp = /(.*)(iphone\sos\s)(\d{2})(.*)/;
let ios_version = str_ua.replace(regexp, '$3');
var csp = ['twitter', 'xvideos'];
var number_x = 0;
if (/\b(google|bing)\b/i.test(window.location.href.toLowerCase())) { // 谷歌和必应均不插入导航按钮
} else if (csp_regex.test(window.location.href.toLowerCase()) && !(/\b(mobile)\b/i.test(navigator.userAgent.toLowerCase()))) { // 如果是带有CSP的网站则带上参数 csp // 2333
adblock4limbo(_button_button_width(), 'csp');
_onclick_button();
}
else {
adblock4limbo(_button_button_width(), 'nocsp'); // 反之则不带
_onclick_button();
}
function csp_remove() {
// 删除CSP模式下不可点击的按钮
var csp_regex = new RegExp(/\b(twitter|xvideos)\b/i);
if (csp_regex.test(window.location.href.toLowerCase())) {
if (document.querySelector("button#dh_button") !== null && document.querySelector("script[src*='Adblock4limbo.function.js']") !== null) {
// 如果引用了 Adblock4limbo.function.js 则什么也不做
} else {
document.querySelectorAll('.li_global').forEach((x) => { // 移除网页聊天的功能按钮 webchat
if (x.querySelector('#webChat') !== null) {
x.remove()
}
})
document.getElementById('dh_pageContainer').style.background = 'black'; // 设置背景颜色
console.log('CSP-设置背景颜色!')
}
} else {
if (document.querySelector("button#dh_button") !== null && document.querySelector("script[src*='Adblock4limbo.function.js']") !== null) {
// 如果引用了 Adblock4limbo.function.js 则什么也不做
} else {
document.querySelectorAll('.li_global').forEach((x) => { // 移除网页聊天的功能按钮 webchat
if (x.querySelector('#webChat') !== null) {
x.remove()
}
})
document.getElementById('dh_pageContainer').style.background = 'black'; // 设置背景颜色
console.log('CSP-设置背景颜色!')
}
}
}
/*
如不想显示 chat 聊天按钮
可使用双斜杠 // 注释上述函数调用代码;
举例如下:
// adblock4limbo();
// hidden_adblock4limbo();
*/
/* Chat and dh_pageContainer End */
// 初始化导航内容
function dh_pageContainer_body_pre() {
let dh_pageContainer = document.createElement('div')
dh_pageContainer.id = 'dh_pageContainer';
dh_pageContainer.setAttribute("class", "dh_pageContainer_css");
let body = document.body;
document.querySelector('html').appendChild(dh_pageContainer)
// document.querySelector('html').insertBefore(dh_pageContainer, body);
let ele_innerHTML = '\
<div class="echo">\
\
<div class="closeX_W">\
<div class="ellCloseX"><button style="border-radius: 50%;opacity: 0.5;" id="xX" ></button></div>\
</div>\
<div class="_header4tips" style="color:black; text-align: center;width: 90%;bottom: -6px;left: 7px;">本导航为<a style="background:black;color:white" href="https://limbopro.com/archives/12904.html" target="_blank">毒奶去网页广告计划</a>的一部分!持续维护更新中...<br><b>✨导航使用小Tips</b> -> 1秒内,<b>电脑用户</b>(连续敲击<b>2次ESC键</b>),<b>iOS用户</b>(<b>在页面空白处连续点击4次及以上</b>) 可<b>快速唤起本导航页面</b>!<br><b>反馈/建议/功能设置</b>中的<b>ON代表该功能已开启</b>,可<b>点击切换至OFF</b>进行关闭!<br>P.S.有好的网站欢迎<a href="https://limbopro.com/6.html" target="_blank" style="background:black; color:aliceblue">推给我!</a>(将为ta移除广告,并添加至本导航页面...</div>\
\
\
<div class="div_global feedback">\
<div class="title_global" >反馈/建议/功能设置//</div>\
<ul class="ul_global">\
<li class="li_global"><button style="border-radius:4px; background:#688e4e !important; box-shadow:inset 0px 0px 15px 3px #16191f00;" class="a_global red" id="webChat">在线联系</button></li>\
<li class="li_global"><a class="a_global" id="admin" href="https://t.me/limboprobot" \
target="_blank">联系博主TG</a></li>\
<li class="li_global"><button style="border-radius:4px; " class="crbhms" id="hidedaohang">导航按钮(OFF)</button></li>\
<li class="li_global"><button style="border-radius:4px; background:#171212 !important; box-shadow:inset 0px 0px 15px 3px #16191f00;" class="a_global red" id="resetting">重置导航设置</button></li>\
<li class="li_global"><button style="border-radius:4px; " class="crbhms" id="nsfwmode_switch">WTF!</button></li>\
<li class="li_global"><button style="border-radius:4px; background:#171212 !important; box-shadow:inset 0px 0px 15px 3px #171212 !important;" class="a_global red" id="lock_screen">锁屏! 🔐</button></li>\
<li class="li_global"><a href="https://github.com/limbopro/Adblock4limbo?tab=readme-ov-file#%E6%AF%92%E5%A5%B6%E5%8E%BB%E5%B9%BF%E5%91%8A%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E9%85%8D%E7%BD%AE%E6%AD%A5%E9%AA%A4" target="_blank" class="a_global" id="jiaocheng">导航使用教程</a></li>\
<li class="li_global"><a class="a_global" id="issue" href="https://github.com/limbopro/Adblock4limbo?tab=readme-ov-file#%E5%A6%82%E4%BD%95%E5%8F%8D%E9%A6%88%E9%97%AE%E9%A2%98%E6%8F%90%E4%BA%A4%E6%96%B0%E7%BD%91%E7%AB%99%E9%87%8D%E8%A6%81" \
target="_blank">提交issue</a></li>\
<li class="li_global"><a class="a_global" id="tgGroup" href="https://t.me/Adblock4limbo/21" \
target="_blank">电报群组</a></li>\
<li class="li_global"><a class="a_global" id="issue" href="https://github.com/limbopro/Adblock4limbo/tree/main?tab=readme-ov-file#%E5%8E%BB%E7%BD%91%E9%A1%B5%E5%B9%BF%E5%91%8A%E8%AE%A1%E5%88%92%E6%B6%89%E5%8F%8A%E8%84%9A%E6%9C%AC%E5%90%8D%E7%A7%B0%E5%8F%8A%E5%85%B6%E6%BA%90%E7%A0%81" \
target="_blank">查看源码</a></li>\
<div class="fbt">新网站收录、当前网站广告问题反馈,其他建议或意见,请通过<span style="color:black;font-weight:bolder;">以上方式</span>告知我们(告知前可先看一下<a class="a_global title_" href="https://t.me/Adblock4limbo/21">FAQ </a>)...P.S. 该 Feature 持续增加/完善中,欢迎大家为之添砖加瓦!</div>\
</ul>\
</div>\
\
\
<div class="div_global gkd">\
<div class="title_global">关注博主//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global" id="Github" href="https://github.com/limbopro" \
target="_blank">Github</a></li>\
<li class="li_global"><a class="a_global" id="GreasyFork" href="https://sleazyfork.org/zh-CN/users/893587-limbopro" \
target="_blank">GreasyFork</a></li>\
<li class="li_global"><a class="a_global special" id="limboprossr" href="https://t.me/limboprossr" \
target="_blank">资讯频道</a></li>\
<li class="li_global"><a class="a_global special" id="SecretGarden" href="https://t.me/+dQ-tZYqhSDEwNTk1" \
target="_blank">春潮频道</a></li>\
<li class="li_global"><a class="a_global better" id="limboprossr" href="https://twitter.com/limboprossr" \
target="_blank">Twitter</a></li>\
<li class="li_global"><a class="a_global" id="YouTube" href="https://m.youtube.com/@limboprossr/featured" \
target="_blank">YouTube</a></li>\
</ul>\
</div>\
\
\
<div class="div_global magicbox">\
<div class="title_global">工具箱//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global" id="itimer" >计时器⏱️</a></li>\
<li class="li_global"><a style="background:#5a4771;box-shadow:inset 0px 0px 15px 3px #16191f00;" class="a_global" id="Adblock4limbo" href="https://limbopro.com/archives/12904.html" \
target="_blank">广告拦截大全</a></li>\
<li class="li_global"><a class="a_global" id="software_skills" href="https://limbopro.com/category/software-skills/" \
target="_blank">软件百科</a></li>\
<li class="li_global"><a style="background:#5a4771; " class="a_global special" id="index" href="https://limbopro.com/" \
target="_blank">毒奶博客</a></li>\
<li class="li_global"><a class="a_global special" style="border-radius:4px; background:#c53f3f; " id="毒奶搜索" href="https://limbopro.com/search.html"\
target="_blank">毒奶搜索</a></li>\
<li class="li_global"><a class="a_global special" style="border-radius:4px; background:#c53f3f; " id="番号搜索" href="https://limbopro.com/btsearch.html"\
target="_blank">番号搜索</a></li>\
</ul>\
</div>\
\
\
<div class="div_global speedtest">\
<div class="title_global">测速工具//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global better" id="CloudflareSpeedtest" href="https://speed.cloudflare.com/"\
target="_blank">Cloudflare</a></li>\
<li class="li_global"><a class="a_global special" id="StairSpeedTest" href="https://limbopro.com/archives/ssrspeed.html"\
target="_blank">StairSpeedTest(机场测速)</a></li>\
<li class="li_global"><a class="a_global" id="Speedtest" href="https://www.speedtest.net/zh-Hans"\
target="_blank">Speedtest</a></li>\
\
</ul>\
</div>\
\
\
<div class="div_global ipcheck">\
<div class="title_global">网络连通及被墙检测//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global special" id="Sukka" href="https://ip.skk.moe/"\
target="_blank">ip地址查询(当前代理节点/本地IP信息)</a></li>\
<li class="li_global"><a class="a_global" id="checkgfw" href="https://www.checkgfw.com/"\
target="_blank">域名被墙检测</a></li>\
\
</ul>\
</div>\
\
\
<div class="div_global front">\
<div class="title_global">前端入门//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global" id="wangdoc" href="https://wangdoc.com/" \
target="_blank">网道</a></li>\
<li class="li_global"><a class="a_global" id="Web_mdn" href="https://developer.mozilla.org/zh-CN/docs/Web" \
target="_blank">Web 开发技术</a></li>\
<li class="li_global"><a class="a_global special" id="JavaScript" href="https://zh.javascript.info/" \
target="_blank">现代 JavaScript 教程</a></li>\
\
</ul>\
</div>\
\
\
<div class="div_global boysshouldread">\
<div class="title_global">男孩子读物//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global better" id="regex" href="https://limbopro.com/archives/Regular_Expressions.html" \
<
10000
/div> target="_blank">正则表达式</a></li>\
<li class="li_global"><a class="a_global special" id="Linux-Shell" href="https://t.me/limboprossr/3197" \
target="__blank">快乐的命令行</a></li>\
\
</ul>\
</div>\
\
\
<div class="div_global leetcode">\
<div class="title_global">技术成长平台//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global better" id="leetcode" href="https://leetcode.cn/" \
target="_blank">力扣</a></li>\
\
</ul>\
</div>\
\
\
<div class="div_global onlinemovies">\
<div class="title_global">在线影视//</div>\
<ul class="ul_global">\
<li class="li_global"><a class="a_global special" id="common" href="https://ddys.pro/"\
target="_blank">低端影视</a></li>\
<li class="li_global"><a class="a_global special" id="common" href="https://xiaobaotv.com/"\
target="_blank">小宝影视</a></li>\
</ul>\
</div>\
\
<div class="_footer" style="color:black!important;">当前网站已在<a href="https://github.com/limbopro/Adblock4limbo/blob/main/Adblock4limbo.weblist" target="_blank" >去广告计划</a>范围,如在此页面发现广告请及时反馈。<div>\
\
</div>\
\
'
let dh_pageContainer_parents = document.getElementById('dh_pageContainer');
dh_pageContainer_parents.innerHTML = ele_innerHTML;
}
var file = {
javlibrary: "td.advsearch {display:none}#rightcolumn{right:90px;width:auto;} .videothumblist .videos {min-width:auto} table.about td {width:auto!important} table.about td.desc {width:auto !important;min-width:0px!important} .titlebox {width:auto !important}.videothumblist.videos {width:auto !important} #leftmenu{max-width:90px;} div.videothumblist{overflow:scroll !important; overflow-x:hidden !important}iframe{display:none} table.about td {min-width:0px;} body.main{min-width:0px !important}\
\
",
global_css: '\
.pointer-events-none {pointer-events:none !important;} .pointer-events-auto {pointer-events:auto;} .bottom-mobile {bottom:30%} .positiondh_buttonMain {position:static !important;} /*::-webkit-scrollbar {display: none;}*/ #dh_buttonContainer{top:20px; position:fixed;right:0px;z-index:114154;} .pc {bottom:0px;} .mobile {bottom:30%;} #dh_button {position:absolute!important;} div._header4tips > b {color:black;} ._header4tips{color:black;} #dh_buttonMain {height:520px;width:60px;position:relative; resize:vertical; overflow:scroll; opacity:1;} ._header {position:absolute;text-align:left;margin-bottom:-30px;background:transparent;z-index:-1 !important;bottom:-41px;padding-bottom:20px;font-size:small;font-weight:lighter;} .cmsnone {display:none; z-index:-114154; opacity:0 !important; pointer-events:none !important;} .crbhms {text-align:center;white-space:break-spaces;color:white !important; border-radius:0px;margin:1px;border:1px solid #1f2f47 !important;display:inline-block;cursor:pointer;color:#ffffff;font-family:Arial;/*font-size:100% !important;*/padding-bottom:6px;padding-top:6px;text-decoration:none;text-shadow:0px 1px 0px #263666;} div.crisp-client.active{pointer-events:auto; z-index:114154; opacity:1;} div.crisp-client{pointer-events:none; z-index:-114154; opacity:0;} .a_global.moviesColor {font-weight:300;background:black;color:#01ff5f!important;box-shadow:inset 0px 0px 15px 3px black} .active { z-index:114154 !important; pointer-events:auto !important; opacity:1 !important; } img.nsfw {position:fixed;width:100%;} img.lockscreen {position:fixed;width:100%;} #nsfw_echo span.nsfw {position:fixed;top:60%;} #nsfw_echo { color:white;width:100%;height:100%} #nsfw { opacity:0.7; filter:blur(0.5px);filter: grayscale(1);z-index:114154;background:black;position:fixed;width:100%;height:100%;} .new_div_search{padding:20px;position:fixed;bottom:0%;} .close_search_button:hover {background-color:red;opacity:1 !important;} .close_search_button_csp{font-size:xxx-large;transition-property:opacity;transition-duration:666ms;right:2%;bottom:13%;position:fixed;width:108px;height:108px;background-size:100%;background-repeat:no-repeat;border-radius:50%;opacity:0.5;} .close_search_button_csp:hover {background-color:red;opacity:1 !important;} .close_search_button {transition-property:opacity;transition-duration:666ms;right:2%;bottom:13%;position:fixed;width:108px;height:108px;background-image:url(https://limbopro.com/Adblock4limbo_google_close.png);background-size:100%;background-repeat:no-repeat;border-radius:50%;opacity:0.5;} .div_global.feedback{background:transparent;} .a_global.title_{background:blue !important;font-size:8px!important} a.a_global.better{/*background:#2e64bb !important;box-shadow:inset 0px 0px 15px 3px #10336d;*/} .boom {opacity:0.5;} a.a_global.red{background:#df0f0f !important;transition-property:opacity;transition-duration:2s;box-shadow:inset 0px 0px 15px 3px #E55B5B;} a.a_global.green{background:#688e4e !important; transition-property:opacity;transition-duration:2s;box-shadow:inset 0px 0px 15px 3px #688e4e;} a.a_global.special{background:#141d2f !important;transition-property:opacity;transition-duration:2s;},a .a_global#CloudflareSpeedtest{} a.a_global#jichangtuijian{background:#3d3843; opacity:0.8;box-shadow:inset 0px 0px 15px 3px #000000}.carousel-inner{z-index:0!important} a.a_global#common {background:#3764ac}.a_global.xOnline {background:black;color:#f09636!important;box-shadow:inset 0px 0px 15px 3px black} .cms_opacity {pointer-events:none !important;opacity:0} .cms {pointer-events:auto} div.closeX_Z{position:relative;text-align:right;z-index:1} div.closeX_W{position:relative;text-align: right;right:0px;top:0px;z-index:1} .scroll{position:absolute;width:110px;font-size:smaller;font-weight:lighter;padding-top:6px;color:#00000070;}button #dh_button{ bottom:32%; height:100px;background:red;opacity:1 !important;}.a_global.comics{background:#2a2146;box-shadow:inset 0px 0px 15px 3px #2a2146}.a_global.porn{background:#2a2146;box-shadow:inset 0px 0px 15px 3px #2a2146} div._footer a{color:#ffffff;font-weight:bolder;} div ._footer{position:absolute;text-align:left;margin-bottom:-30px;background:transparent;z-index:-1 !important;bottom:-41px;padding-bottom:20px;font-size:small;font-weight:lighter;} div#dh_pageContainer.dh_pageContainer_css{overscroll-behavior:none;top:0px;transition-property:opacity;transition-duration:999ms;margin:0px !important} div#dh_pageContainer.dh_pageContainer_css_0{transition-duration:0ms !important;margin:0px !important} div > button#xX{background-image:url("https://limbopro.com/Adblock4limbo_close.svg");transition-property:opacity;transition-duration:666ms;background-color:#542c3e;color:#ffffff;opacity:0.5 !important;border:0px;margin:0px;width:108px;height:108px;border-radius:0%;}div > button#xX:hover{background-color:red;opacity:1 !important;}div > button:active{background-color:red;}div .ellCloseX{display:contents; z-index:-1;margin:0px;position:initial;};span#nspan{margin:0px;font-weight:bolder !important;color:black !important;}div > div .fbt{color:#6064a2 !important;margin:0px;font-size:small;width:112px;padding-top:5px;padding-left:4px;padding-right:4px;}.echo{width:auto;font-size:15px;text-align:inherit;position:absolute;}ul > li > button{overflow:visible;width:106px !important;line-height:15px !important;} ul.ul_global > li > a{word-wrap:break-word;font-weight:lighter;overflow:visible;width:106px !important;font-size:15px !important;line-height:15px !important;}.li_global{display:flex; min-height:31px;font-size:medium;list-style:none;width:112px;}.ul_global{padding:0px;font-size:15px !important;height:258px;margin:0px;overflow:auto;width:auto;} .title_global{padding-left:2px;display:table-cell;vertical-align:bottom;width:106px;height:50px;text-align:center;font-size:initial;margin-bottom:5px;font-weight:lighter;color:black !important;padding-bottom:4px;} .div_global{text-align:center;float:left;padding-top:31px;margin-bottom:29px;padding-left:0px;}.ellClose{text-align:center;float:left;padding-top:15px;margin-bottom:15px;padding-left:0px;}#dh_pageContainer{overflow-y:overlay;overflow-x:hidden;background-image:url("https://raw.githubusercontent.com/limbopro/Adblock4limbo/main/Adguard/Adblock4limbo_bgp.jpg");background-size:100% !important;background-repeat:round;margin:auto;width:200px;height:200px;z-index:-114154;opacity:0;background-color:transparent;position:fixed;top:50%;}.a_global{text-align:center;white-space:break-spaces;color:white !important;box-shadow:inset 0px 0px 15px 3px #23395e;background:linear-gradient(to bottom,#2e466e 5%,#415989 100% );background-color:#2e466e !important;border-radius:0px;margin:1px;border:1px solid #1f2f47 !important;display:inline-block;cursor:pointer;color:#ffffff;font-family:Arial;/*font-size:100% !important;*/padding-bottom:6px;padding-top:6px;text-decoration:none;text-shadow:0px 1px 0px #263666;}.a_global:hover{background:linear-gradient(to bottom,#415989 5%,#2e466e 100%);background-color:#415989;}.a_global:active{position:relative;top:1px;}\
'
}
// 优先追加style元素 以内联样式的方式
function css_add(css, here_write_css_name_you_want) {
// css style 创建
let body = document.body;
var css_name_x = document.createElement('style');
css_name_x.id = here_write_css_name_you_want;
css_name_x.innerText = css;
// document.querySelector('html').insertBefore(css_name_x, body);
document.querySelectorAll('head')[0].insertBefore(css_name_x, document.querySelectorAll('head')[0].lastChild)
}
// 优先追加style元素 以 link 的方式
function css_url_add(css_url, here_write_css_name_you_want) {
// css file 创建
let head = document.querySelectorAll('head')[0];
var css_name_y = document.createElement('link');
css_name_y.id = here_write_css_name_you_want;
css_name_y.href = css_url;
css_name_y.type = 'text/css';
css_name_y.rel = 'stylesheet';
head.appendChild(css_name_y);
}
css_add(file.global_css, 'dh_pageContainer_style'); // 在body后面插入 css
function insertBefore_that_element_xx(x) {
let parentElement = document.querySelector('div#rightcolumn')
let insertBefore_that_element_X = document.querySelector('div#video_favorite_edit');
let son = document.querySelectorAll("[style*='vertical-align: top']")[1]
parentElement.insertBefore(son, insertBefore_that_element_X);
document.querySelectorAll(x).forEach((x) => { x.style.width = '140px' })
if (window.innerWidth < 430) {
}
}
// 新建一个独立的 div 元素 用作sample
function div_sample(echo_selector, insertBefore_that_element, switchX, child_css_change) {
let target = document.querySelector(echo_selector);
let div_global_x = document.createElement('div');
div_global_x.className = "div_global " + child_css_change;
let div_title = document.createElement('div');
div_title.textContent = 'sample';
div_title.className = 'title_global'; // 全局
let ul_ul_global = document.createElement('ul');
ul_ul_global.className = 'ul_global';
let li_li_global = document.createElement('li');
li_li_global.className = 'li_global';
let a = document.createElement('a');
a.className = 'a_global';
a.href = 'https://limbopro.com/';
a.target = '_blank';
a.textContent = 'Sample';
//a.id = 'sample';
li_li_global.appendChild(a);
ul_ul_global.appendChild(li_li_global);
div_global_x.appendChild(div_title);
div_global_x.appendChild(ul_ul_global);
if (switchX == 1) {
let insertBefore_that_elementx = document.querySelector(insertBefore_that_element);
target.insertBefore(div_global_x, insertBefore_that_elementx); // 插入到现有 body 前
} else {
target.appendChild(div_global_x);
}
}
// 新建一个独立的 li 元素 用作sample
function li_sample(div_global_selector, insertBefore_that_element, switchX) {
let target = document.querySelector(div_global_selector);
let li_global_x = document.createElement('li');
li_global_x.className = "li_global";
let a = document.createElement('a')
a.className = 'a_global';
//a.id = 'sample';
a.href = 'https://limbopro.com/';
a.target = '_blank';
a.textContent = 'Sample';
li_global_x.appendChild(a);
if (switchX == 1) {
let thatli = target.querySelectorAll('li');
// document.querySelector('.div_global.speedtest').querySelectorAll('li')
for (i = 0; i < thatli.length; i++) {
if (thatli[i].querySelector(insertBefore_that_element)) {
// document.querySelector('.div_global.speedtest').querySelectorAll('li').querySelector('#Speedtest')
target.insertBefore(li_global_x, thatli[i])
}
}
} else {
target.appendChild(li_global_x);
}
}
// .div_global.DeverloperX
// 可向上滑动判断
function scroll_switch() {
//let scroll_check = setInterval(() => {
var div_global = document.querySelectorAll('.div_global');
////console.log("// scroll_switch() 查看子元素数量是否超出设定");
for (i = 0; i < div_global.length; i++) {
if (div_global[i].querySelector('div.fbt')) {
var fbt = div_global[i].querySelector('div.fbt').clientHeight
} else { var fbt = 0 }
var sum = 0;
let li = div_global[i].querySelectorAll('li')
//let li = document.querySelectorAll('.div_global')[20].querySelectorAll('li')
for (x = 0; x < li.length; x++) {
sum += li[x].clientHeight;
}
//console.log(sum)
if (div_global[i].querySelectorAll('li').length * 31 + fbt > 8 * 31 || sum + fbt > 8 * 31) {
// if (sum_scroll() + fbt > 8 * 31) {
let scroll_innerHTML = document.createElement('div');
scroll_innerHTML.textContent = '*可向上滑动查看更多';
scroll_innerHTML.className = "scroll";
document.querySelectorAll("div.div_global")[i].appendChild(scroll_innerHTML);
////console.log("// scroll_switch() 正在执行插入 // 子元素较多");
////clearInterval(scroll_check);
}
}
//}, 1000)
}
//document.querySelectorAll('.div_global')[3].querySelectorAll("li").length * 31
function xXX() {
let div_global = document.querySelectorAll('.div_global');
for (i = 0; i < div_global.length; i++) {
let a_length = div_global[i].querySelectorAll("a").length;
for (i = 0; i < a_length; i++) {
div_global[i].querySelectorAll('a')
}
}
var a_length = document.querySelectorAll('.div_global')[3].querySelectorAll("li").length;
for (i = 0; i < a_length; i++) {
//console.log(document.querySelectorAll('.div_global')[3].querySelectorAll("a")[i].clientHeight);
if (document.querySelectorAll('.div_global')[3].querySelectorAll("a")[i].clientHeight > 27) {
let scroll_innerHTML = document.createElement('div');
scroll_innerHTML.textContent = '*可向上滑动查看更多';
scroll_innerHTML.className = "scroll";
}
}
}
var selector = { // css 定义选择器
body_css_real: ["div.dh_pageContainer_css", 'common'],
body_css: ["div#dh_pageContainer.dh_pageContainer_css", 'common'],
footer: ["div._footer", 'common'],
}
function all(opacity, zIndex, switchX, pointevents = '') {
//console.log("// body_build() 输入为 true,开始创建导航..." + " 透明度为 " + opacity + " 层级数目为 " + zIndex)
if (!document.querySelector('div#dh_pageContainer[style]')) { // 如果导航不存在则生成
dh_pageContainer_body_pre(); // 生成导航
let parentElement = document.getElementById('dh_pageContainer');
parentElement.style.zIndex = zIndex;
parentElement.style.opacity = opacity;
parentElement.style.pointerEvents = pointevents;
body_align("dh_pageContainer");// 初始化导航大小
body_bgp_switch(); // 设置背景图片
echo_align(); // 导航居中
//new_align();
echo_check_switch(switchX); // 监控导航大小变化
//boom();
} else {
//boom();
let parentElement = document.getElementById('dh_pageContainer');
parentElement.style.zIndex = zIndex + 1;
parentElement.style.opacity = opacity;
parentElement.style.pointerEvents = pointevents;
body_align("dh_pageContainer");// 初始化导航大小
body_bgp_switch(); // 设置背景图片
echo_align(); // 导航居中
//new_align();
echo_check_switch(switchX); // 监控导航大小变化
}
}
// 按钮闪烁提示
function opacity_switch() {
if (document.querySelector('#windowClose')) {
document.querySelector('#windowClose').style.opacity = '0.5'
setTimeout(() => {
document.querySelector('#windowClose').style.opacity = '1.5'
}, 1500)
}
}
function boom() {
var true_ = 10;
let xman = setInterval(() => {
true_--;
opacity_switch();
console.log(true_)
You can’t perform that action at this time.