forked from F9y4ng/GreasyFork-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Font Rendering.user.js
4800 lines (4600 loc) · 287 KB
/
Font Rendering.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:ja フォントレンダリング(カスタマイズ)
// @name:en Font Rendering (Customized)
// @version 2023.05.06.1
// @author F9y4ng
// @description 无需安装MacType,优化浏览器字体渲染效果,让每个页面的字体变得更有质感。默认使用“微软雅黑字体”,也可根据喜好自定义其他字体使用。脚本针对浏览器字体渲染提供了字体重写、字体平滑、字体缩放、字体描边、字体阴影、对特殊样式元素的过滤和许可、自定义等宽字体等高级功能。脚本支持全局渲染与个性化渲染功能,可通过“单击脚本管理器图标”或“使用快捷键”呼出配置界面进行参数配置。脚本已兼容绝大部分主流浏览器及主流脚本管理器,且兼容常用的Greasemonkey脚本和浏览器扩展。
// @description:zh-CN 无需安装MacType,优化浏览器字体渲染效果,让每个页面的字体变得更有质感。默认使用“微软雅黑字体”,也可根据喜好自定义其他字体使用。脚本针对浏览器字体渲染提供了字体重写、字体平滑、字体缩放、字体描边、字体阴影、对特殊样式元素的过滤和许可、自定义等宽字体等高级功能。脚本支持全局渲染与个性化渲染功能,可通过“单击脚本管理器图标”或“使用快捷键”呼出配置界面进行参数配置。脚本已兼容绝大部分主流浏览器及主流脚本管理器,且兼容常用的Greasemonkey脚本和浏览器扩展。
// @description:zh-TW 無需安裝MacType,優化瀏覽器字體渲染效果,讓每個頁面的字體變得更有質感。默認使用“微軟雅黑字體”,也可根據喜好自定義其他字體使用。腳本針對瀏覽器字體渲染提供了字體重寫、字體平滑、字體縮放、字體描邊、字體陰影、對特殊樣式元素的過濾和許可、自定義等寬字體等高級功能。腳本支持全局渲染與個性化渲染功能,可通過「單擊腳本管理器圖標」或「使用快捷鍵」呼出配置界面進行參數配置。腳本已兼容絕大部分主流瀏覽器及主流腳本管理器,且兼容常用的Greasemonkey腳本和瀏覽器擴展。
// @description:ja MacTypeを実装することなく,ブラウザフォントレンダリング効果を最適化し,ページごとのフォントをより質感にする.。デフォルトでは“Microsoft雅黒フォント”を使用しており、好みに応じて他のフォントをカスタマイズして使用することもできます。スクリプトは,ブラウザフォントレンダリングに対して,フォント書き換え,フォント平滑化,フォントスケーリング,フォント描画エッジ,フォント陰影,特殊パターン要素のフィルタリングと許可,カスタマイズなどの広いフォントなどの高度な機能を提供している.。スクリプトは、グローバルレンダリングと個人化レンダリング機能を提供し、“スクリプトマネージャアイコンをクリックする”または“ショートカットキーを使用して”構成インタフェースを呼び出すことでパラメータ構成を行うことができます。スクリプトは,ほとんどの主流ブラウザと主流スクリプトマネージャに対応しており,通常のGreasemonkeyスクリプトやブラウザ拡張に対応している.
// @description:en Without MacType, improve browser displaying more textured. "Microsoft Yahei" is used by default. For browser displaying, the script provides advanced features such as font rewriting, smoothing, scaling, stroke, shadow, special style elements, custom monospaced, etc. It can configure by "click Script Manager icon" or "use hotkeys" to call out the setup. The script is already compatible with major browsers and userscript managers, also commonly used Greasemonkey scripts and browser extensions.
// @namespace https://openuserjs.org/scripts/f9y4ng/Font_Rendering_(Customized)
// @icon https://img.icons8.com/stickers/48/font-style-formatting.png
// @homepage https://f9y4ng.github.io/GreasyFork-Scripts/
// @homepageURL https://f9y4ng.github.io/GreasyFork-Scripts/
// @supportURL https://github.com/F9y4ng/GreasyFork-Scripts/issues
// @updateURL https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Font%20Rendering.meta.js
// @downloadURL https://github.com/F9y4ng/GreasyFork-Scripts/raw/master/Font%20Rendering.user.js
// @require https://greasyfork.org/scripts/437214/code/frColorPicker.js?version=1178663#sha256-76Z8Zc/y04xxvKypwwibFTkDpem4N9IGWxL3Eq7qXNY=
// @match *://*/*
// @grant GM_getValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM.setValue
// @grant GM_listValues
// @grant GM.listValues
// @grant GM_deleteValue
// @grant GM.deleteValue
// @grant GM_openInTab
// @grant GM.openInTab
// @grant GM_registerMenuCommand
// @grant GM.registerMenuCommand
// @grant GM_unregisterMenuCommand
// @compatible edge 兼容Tampermonkey, Violentmonkey
// @compatible Chrome 兼容Tampermonkey, Violentmonkey
// @compatible Firefox 兼容Greasemonkey, Tampermonkey, Violentmonkey
// @compatible Opera 兼容Tampermonkey, Violentmonkey
// @compatible Safari 兼容Tampermonkey, Userscripts
// @license GPL-3.0-only
// @create 2020-11-24
// @copyright 2020-2023, F9y4ng
// @run-at document-start
// ==/UserScript==
/* jshint esversion: 11 */
~(function (w) {
"use strict";
/**
* LICENSE FOR OPEN SOURCE USE: GPLv3.
* CUSTOM SCRIPT DEBUGGING, DO NOT TURN ON FOR DAILY USE.
* SET TO "TRUE" FOR SCRIPT DEBUGGING, MAY CAUSE THE SCRIPT TO RUN SLOWLY.
* THE SETTING VALUE TYPE MUST BE BOOLEAN, FALSE BY DEFAULT.
*/
const IS_OPEN_DEBUG = false;
/* PERFECTLY COMPATIBLE FOR GREASEMONKEY, TAMPERMONKEY, VIOLENTMONKEY, USERSCRIPTS 2023-04-08 F9Y4NG */
const GMinfo = GM_info;
const GMversion = GMinfo.version ?? GMinfo.scriptHandlerVersion ?? "unknown";
const GMscriptHandler = GMinfo.scriptHandler;
const GMsetValue = gmSelector("setValue");
const GMgetValue = gmSelector("getValue");
const GMdeleteValue = gmSelector("deleteValue");
const GMlistValues = gmSelector("listValues");
const GMopenInTab = gmSelector("openInTab");
const GMregisterMenuCommand = gmSelector("registerMenuCommand");
const GMunregisterMenuCommand = gmSelector("unregisterMenuCommand");
const GMunsafeWindow = gmSelector("unsafeWindow");
const GMcontextMode = gmSelector("contextMode");
/* INITIALIZE_DEBUG_FUNCTIONS */
const IS_DEBUG = setDebuggerMode() || IS_OPEN_DEBUG;
const DEBUG = IS_DEBUG ? __console.bind(console, "log") : () => {};
const INFO = IS_DEBUG ? __console.bind(console, "info") : () => {};
const ERROR = IS_DEBUG ? __console.bind(console, "error") : () => {};
const COUNT = IS_DEBUG ? __console.bind(console, "count") : () => {};
/* INITIALIZE_COMMON_CONSTANTS */
const def = {
array: { exps: [], values: [], scaleValueMatrix: [], props: { Element: [], HTMLElement: [] }, frcontainer: ["fr-configure", "fr-dialogbox"] },
count: { domainCount: 0, clickTimer: 0, exsiteSearch: 0, domainSearch: 0 },
const: {
seed: generateRandomString(6, "mix"),
raf: `__FR_rAF_${generateRandomString(24, "attr")}`,
caf: `__FR_cAF_${generateRandomString(24, "attr")}`,
boldAttrName: `fr-fix-${generateRandomString(8, "attr")}`,
cssAttrName: `fr-css-${generateRandomString(8, "attr")}`,
frameAttrName: `fr-frames-${generateRandomString(8, "attr")}`,
gfHost: decrypt("aHR0cHMlM0ElMkYlMkZncmVhc3lmb3JrLm9yZyUyRnNjcmlwdHMlMkY0MTY2ODg="),
defaultFont: decrypt("JUU3JUJEJTkxJUU3JUFCJTk5JUU5JUJCJTk4JUU4JUFFJUE0JUU1JUFEJTk3JUU0JUJEJTkz"),
fontlistImg: decrypt("aHR0cHMlM0ElMkYlMkZzMS5heDF4LmNvbSUyRjIwMjIlMkYwNCUyRjAyJTJGcW9SZldkLmdpZg=="),
loadImg: decrypt("aHR0cHMlM0ElMkYlMkZpbWcuemNvb2wuY24lMkZjb21tdW5pdHklMkYwMzhkZGU0NThmOWE4NzRhODAxMjE2MGY3NDE3ZjZlLmdpZg=="),
exQueryString: `html,head,head *,base,meta,style,link,script,noscript,iframe,img,br,hr,wbr,map,area,meter,canvas,svg,svg *,picture,form,object,param,embed,audio,video,source,track,progress,fr-colorpicker,fr-colorpicker *,fr-configure,fr-configure *,fr-dialogbox,fr-dialogbox *,gb-notice,gb-notice *`,
},
variable: {
prototype: {
getScreenCTM: SVGGraphicsElement.prototype.getScreenCTM,
getClientRects: Element.prototype.getClientRects,
getBoundingClientRect: Element.prototype.getBoundingClientRect,
},
lisence: generateRandomString(64, "attr"),
feedback: getMetaValue("supportURL") ?? "",
curVersion: getMetaValue("version") ?? GMinfo.script.version ?? "2023.04.22.0",
scriptAuthor: getMetaValue("author") ?? GMinfo.script.author ?? "F9y4ng",
scriptName: getMetaValue(`name:${navigator.language ?? "zh-CN"}`) ?? GMinfo.script.name ?? "Font Rendering",
},
dialog: {
alert: alert.bind(w),
prompt: prompt.bind(w),
confirm: confirm.bind(w),
},
class: {
guide: generateRandomString(6, "mix"),
title: generateRandomString(8, "char"),
rotation: generateRandomString(7, "char"),
emoji: generateRandomString(7, "mix"),
main: generateRandomString(8, "char"),
fontList: generateRandomString(8, "char"),
spanlabel: generateRandomString(6, "mix"),
label: generateRandomString(6, "mix"),
placeholder: generateRandomString(6, "mix"),
checkbox: generateRandomString(8, "char"),
flex: generateRandomString(9, "char"),
tooltip: generateRandomString(8, "char"),
tooltiptext: generateRandomString(9, "char"),
ps1: generateRandomString(6, "mix"),
ps2: generateRandomString(6, "mix"),
ps3: generateRandomString(6, "mix"),
ps4: generateRandomString(6, "mix"),
ps5: generateRandomString(6, "mix"),
slider: generateRandomString(8, "char"),
frColorPicker: generateRandomString(9, "char"),
readonly: generateRandomString(8, "char"),
notreadonly: generateRandomString(8, "char"),
reset: generateRandomString(7, "mix"),
cancel: generateRandomString(7, "mix"),
submit: generateRandomString(7, "mix"),
selector: generateRandomString(9, "char"),
selectFontId: generateRandomString(8, "char"),
close: generateRandomString(7, "char"),
db: generateRandomString(10, "char"),
dbbc: generateRandomString(9, "char"),
dbb: generateRandomString(8, "char"),
dbm: generateRandomString(8, "char"),
dbt: generateRandomString(8, "char"),
dbbt: generateRandomString(7, "mix"),
dbbf: generateRandomString(7, "mix"),
dbbn: generateRandomString(7, "mix"),
switch: generateRandomString(6, "mix"),
anim: generateRandomString(6, "mix"),
range: generateRandomString(10, "char"),
rangeProgress: generateRandomString(9, "mix"),
},
id: {
rndStyle: generateRandomString(12, "char"),
configure: generateRandomString(12, "char"),
dialogbox: generateRandomString(12, "char"),
container: generateRandomString(10, "char"),
field: generateRandomString(10, "char"),
fontList: generateRandomString(8, "char"),
fontFace: generateRandomString(8, "char"),
fontSmooth: generateRandomString(8, "char"),
fontStroke: generateRandomString(8, "char"),
fontShadow: generateRandomString(8, "char"),
shadowColor: generateRandomString(8, "char"),
fontCss: generateRandomString(8, "char"),
fontEx: generateRandomString(8, "char"),
submit: generateRandomString(8, "char"),
fface: generateRandomString(8, "char"),
smooth: generateRandomString(8, "char"),
fontSize: generateRandomString(8, "char"),
fontScale: generateRandomString(8, "char"),
scaleSize: generateRandomString(8, "char"),
fviewport: generateRandomString(8, "mix"),
fixViewport: generateRandomString(8, "mix"),
strokeSize: generateRandomString(8, "mix"),
stroke: generateRandomString(8, "char"),
fstroke: generateRandomString(8, "mix"),
fixStroke: generateRandomString(8, "mix"),
shadowSize: generateRandomString(8, "mix"),
shadow: generateRandomString(8, "char"),
color: generateRandomString(8, "char"),
cssinclued: generateRandomString(8, "char"),
cssexclude: generateRandomString(8, "char"),
mono: generateRandomString(8, "char"),
cm: generateRandomString(8, "mix"),
iscusmono: generateRandomString(6, "char"),
selector: generateRandomString(8, "char"),
cleaner: generateRandomString(6, "char"),
fonttooltip: generateRandomString(9, "char"),
fontName: generateRandomString(8, "char"),
cSwitch: generateRandomString(6, "mix"),
eSwitch: generateRandomString(6, "mix"),
backup: generateRandomString(8, "char"),
files: generateRandomString(6, "char"),
tfiles: generateRandomString(7, "mix"),
db: generateRandomString(6, "char"),
ct: generateRandomString(6, "char"),
isclosetip: generateRandomString(7, "mix"),
bk: generateRandomString(6, "char"),
isbackup: generateRandomString(7, "mix"),
pv: generateRandomString(6, "char"),
ispreview: generateRandomString(7, "mix"),
fs: generateRandomString(6, "char"),
isfontsize: generateRandomString(7, "mix"),
fvp: generateRandomString(6, "char"),
isfixviewport: generateRandomString(7, "mix"),
hk: generateRandomString(6, "char"),
ishotkey: generateRandomString(7, "mix"),
mps: generateRandomString(6, "char"),
maxps: generateRandomString(7, "mix"),
gc: generateRandomString(6, "char"),
globaldisable: generateRandomString(7, "char"),
feedback: generateRandomString(7, "char"),
flc: generateRandomString(6, "char"),
flcid: generateRandomString(7, "mix"),
},
};
if (checkRedundantScript(GMunsafeWindow)) return;
/* INITIALIZE_SETTIMEOUT_AND_SETINTERVAL_FUNCTION_CLASSES */
class RAF {
constructor(global) {
this.timerMap = { timeout: {}, interval: {} };
this.setTimeout = this.setTimeout.bind(this);
this.global = global;
registerWindowsProperties();
}
_ticking(fn, type, interval, lastTime = Date.now()) {
const timerSymbol = Symbol(type);
const step = () => {
this._setTimerMap(timerSymbol, type, step);
if (interval < 1000 / 60 || Date.now() - lastTime >= interval) {
typeof fn === "function" && fn();
if (type === "interval") {
lastTime = Date.now();
} else {
this.clearTimeout(timerSymbol);
}
}
};
this._setTimerMap(timerSymbol, type, step);
return timerSymbol;
}
_setTimerMap(timerSymbol, type, step) {
this.timerMap[type][timerSymbol] = this.global[def.const.raf](step);
}
setTimeout(fn, interval) {
return this._ticking(fn, "timeout", interval);
}
clearTimeout(timer) {
this.global[def.const.caf](this.timerMap.timeout[timer]);
delete this.timerMap.timeout[timer];
}
setInterval(fn, interval) {
return this._ticking(fn, "interval", interval);
}
clearInterval(timer) {
this.global[def.const.caf](this.timerMap.interval[timer]);
delete this.timerMap.interval[timer];
}
}
const raf = new RAF(w);
/* GLOBAL_GENERAL_FUNCTIONS */
function gmSelector(rec) {
const gmFunctions = {
setValue: typeof GM_setValue !== "undefined" ? GM_setValue : GM?.setValue ?? localStorage.setItem.bind(localStorage),
getValue: typeof GM_getValue !== "undefined" ? GM_getValue : GM?.getValue ?? localStorage.getItem.bind(localStorage),
deleteValue: typeof GM_deleteValue !== "undefined" ? GM_deleteValue : GM?.deleteValue ?? localStorage.removeItem.bind(localStorage),
listValues: typeof GM_listValues !== "undefined" ? GM_listValues : GM?.listValues ?? (() => []),
openInTab: typeof GM_openInTab !== "undefined" ? GM_openInTab : GM?.openInTab ?? w.open,
registerMenuCommand: typeof GM_registerMenuCommand !== "undefined" ? GM_registerMenuCommand : GM?.registerMenuCommand ?? (() => []),
unregisterMenuCommand: typeof GM_unregisterMenuCommand !== "undefined" ? GM_unregisterMenuCommand : GM?.unregisterMenuCommand ?? (() => []),
unsafeWindow: typeof unsafeWindow !== "undefined" ? unsafeWindow : w,
contextMode: GMinfo.injectInto === "content" || GMinfo.script["inject-into"] === "content" || ["dom", "js"].includes(GMinfo.sandboxMode),
};
return gmFunctions[rec] ?? (() => {});
}
function __console(act) {
const __this = console;
const __arguments = [...arguments];
const [argm = "", ...args] = __arguments.slice(1);
switch (__arguments[0]) {
case "log":
__this[act](`%c\u27A4 %c${argm}`, "display:inline-block", "font-family:monospace", ...args);
break;
case "info":
__this.log(`%c\u27A4 ${argm}`, "display:inline-block;padding:4px 0", ...args);
break;
case "error":
case "warn":
__this[act](`%c\ud83d\udea9 ${argm}`, "display:inline-block;font-family:monospace", ...args);
break;
case "count":
__this[act](`\u27A4 ${argm}`);
break;
default:
__this.log(argm, ...args);
break;
}
}
function registerWindowsProperties() {
// REGISTER RAF
w[def.const.raf] =
w.requestAnimationFrame ||
w.webkitRequestAnimationFrame ||
w.mozRequestAnimationFrame ||
w.oRequestAnimationFrame ||
(function () {
const fps = 60;
const delay = 1000 / fps;
const animationStartTime = Date.now();
let previousCallTime = animationStartTime;
return function requestAnimationFrame(callback) {
const requestTime = Date.now();
const timeout = Math.max(0, delay - (requestTime - previousCallTime));
const timeToCall = requestTime + timeout;
previousCallTime = timeToCall;
return setTimeout(function onAnimationFrame() {
callback(timeToCall - animationStartTime);
}, timeout);
};
})();
// REGISTER CAF
w[def.const.caf] =
w.cancelAnimationFrame ||
w.webkitCancelAnimationFrame ||
w.mozCancelAnimationFrame ||
w.oCancelAnimationFrame ||
w.cancelRequestAnimationFrame ||
w.webkitCancelRequestAnimationFrame ||
w.mozCancelRequestAnimationFrame ||
w.oCancelRequestAnimationFrame ||
function cancelAnimationFrame(id) {
clearTimeout(id);
};
// REGISTER UNSAFEWINDOW RAF/CAF
GMunsafeWindow[def.const.raf] = w[def.const.raf];
GMunsafeWindow[def.const.caf] = w[def.const.caf];
// REGISTER PUSHSTATE/REPLACESTATE
history.pushState = wrapHistory("pushState");
history.replaceState = wrapHistory("replaceState");
function wrapHistory(type) {
const original = history[type];
const event = new Event(type);
return function () {
const fn = original.apply(this, arguments);
event.arguments = arguments;
w.dispatchEvent(event);
return fn;
};
}
}
function qS(expr, target = document) {
try {
if (/^#\w+$/.test(expr)) return target.getElementById(expr.slice(1));
return target.querySelector(expr);
} catch (e) {
return null;
}
}
function qA(expr, target = document) {
try {
return Array.prototype.slice.call(target.querySelectorAll(expr), 0);
} catch (e) {
return [];
}
}
function cE(nodeName) {
return document.createElement(nodeName);
}
function aS(target) {
return target.attachShadow({ mode: "open" });
}
function gS(target, value = null, opt = null) {
if (value) {
return w.getComputedStyle(target, opt).getPropertyValue(value);
} else {
return w.getComputedStyle(target, opt);
}
}
function random(range, type = "round") {
return Math[type]((w.crypto.getRandomValues(new Uint32Array(1))[0] / (0xffffffff + 1)) * range);
}
function unescape(input) {
input = input?.toString() ?? "";
if (input.search("%") === -1) return input;
let output = "";
const hexDigits = "0123456789ABCDEF";
for (let i = 0, len = input.length; i < len; i++) {
let char = input[i];
if (char === "%") {
if (
i <= len - 6 &&
input[i + 1] === "u" &&
hexDigits.includes(input[i + 2]) &&
hexDigits.includes(input[i + 3]) &&
hexDigits.includes(input[i + 4]) &&
hexDigits.includes(input[i + 5])
) {
char = String.fromCharCode(parseInt(input.substring(i + 2, i + 7), 16));
i += 5;
} else if (i <= len - 3 && hexDigits.includes(input[i + 1]) && hexDigits.includes(input[i + 2])) {
char = decodeURIComponent(input.substring(i, i + 3));
i += 2;
}
}
output += char;
}
return output;
}
function uniq(array) {
if (!Array.isArray(array)) return [];
return [...new Set(array)].filter(Boolean);
}
function capitalize(string) {
string = String(string);
return string.charAt(0).toUpperCase() + string.slice(1);
}
function encrypt(string) {
if (typeof string !== "string") return "";
return btoa(encodeURIComponent(string));
}
function decrypt(string) {
if (typeof string !== "string") return "";
return decodeURIComponent(atob(string.replace(/[^A-Za-z0-9+/=]/g, "")));
}
function compareArray(array1, array2) {
if (!Array.isArray(array1) || !Array.isArray(array2)) return false;
return (
array1.length === array2.length &&
array1.sort().every(function (element, index) {
return element === array2.sort()[index];
})
);
}
function generateRandomString(length, type) {
const digits = "0123456789";
const lowerCaseLetters = "abcdefghijklmnopqrstuvwxyz";
const upperCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
let characters = upperCaseLetters;
let prefix = "";
let randomString = "";
switch (type) {
case "mix":
characters = lowerCaseLetters + digits + upperCaseLetters;
prefix = upperCaseLetters[random(upperCaseLetters.length, "floor")];
length--;
break;
case "char":
characters = lowerCaseLetters + upperCaseLetters;
break;
case "digit":
characters = digits;
break;
case "attr":
characters = digits + lowerCaseLetters.slice(0, 6);
break;
}
for (let i = length; i > 0; i--) {
randomString += characters[random(characters.length, "floor")];
}
return prefix + randomString;
}
function createTrustedTypePolicy() {
const policy = { createHTML: string => string };
if (!w.trustedTypes?.createPolicy) return policy;
const currentHostName = location.hostname;
const whiteList = new Set([
{ host: "teams.live.com", policy: "goog#html" },
{ host: "github.dev", policy: "safeInnerHtml" },
{ host: "vscode.dev", policy: "safeInnerHtml" },
]);
let policyName = "fr#safeCreateHTML";
for (const item of whiteList) {
if (currentHostName.endsWith(item.host)) {
policyName = item.policy;
break;
}
}
return w.trustedTypes.createPolicy(policyName, policy);
}
function getMainStyleElements({ currentScope, target } = {}) {
return currentScope ? qS(`#${def.id.rndStyle}`, document.head) : qA("style", target || document.head).filter(item => item.attributes[0]?.name.startsWith("fr-css-"));
}
function checkRedundantScript(global) {
const { isTop: CUR_WINDOW_TOP } = getLocationInfo();
// PAGE_MODE
const redundantScripts = global["fr-init-redundantscripts"];
if (redundantScripts === true) return scriptRedundancyWarning();
global["fr-init-redundantscripts"] = true;
// CONTEXT_MODE
if (storageAvailable("__storage_test__")) {
if (GMcontextMode) {
let redundantScriptsJSON = JSON.parse(sessionStorage.getItem("fr-init-redundantscripts"));
if (redundantScriptsJSON?.check === true && redundantScriptsJSON?.lisence !== def.variable.lisence) {
sessionStorage.removeItem("fr-init-redundantscripts");
return scriptRedundancyWarning();
}
CUR_WINDOW_TOP &&
__console("warn", `${def.variable.scriptName}警告:\r\n脚本的注入模式已设置为"content",部分脚本功能将受限制,如框架页面内部分功能失效、字体缩放后无法全局修正坐标等。`);
}
sessionStorage.setItem("fr-init-redundantscripts", JSON.stringify({ check: true, lisence: def.variable.lisence }));
w.addEventListener("beforeunload", () => sessionStorage.removeItem("fr-init-redundantscripts"));
}
return false;
function scriptRedundancyWarning() {
if (CUR_WINDOW_TOP) {
__console("error", `\ud83d\udea9 [Redundant Scripts]:\r\n发现冗余安装的脚本:${def.variable.scriptName},如刷新后问题依旧,请访问 ${def.variable.feedback}/117 排查错误。`);
GMregisterMenuCommand("\ufff8\ud83d\uded1 发现冗余安装的脚本,点击刷新!", () => GMopenInTab(`${def.variable.feedback}/117`, false));
}
return true;
}
function storageAvailable(v) {
try {
sessionStorage.setItem(v, v);
sessionStorage.removeItem(v);
return true;
} catch (e) {
return false;
}
}
}
function getNavigatorInfo() {
const vmuad = (uad => {
if (!uad) return;
const archs = uad.arch?.split("-") ?? [];
return {
brands: [{ brand: capitalize(uad.browserName), version: uad.browserVersion }],
platform: capitalize(uad.os),
bitness: archs[1] ?? "unknown",
architecture: archs[0] ?? "unknown",
credit: GMscriptHandler,
};
})(GMinfo.platform);
const tmuad = (uad => {
if (!uad) return;
uad.credit = GMscriptHandler;
return uad;
})(GMinfo.userAgentData);
const uad = vmuad ?? tmuad ?? navigator.userAgentData;
const trustengine = w.webkitRequestFileSystem ? "Blink" : !isNaN(parseFloat(w.mozInnerScreenX)) ? "Gecko" : w.GestureEvent ? "WebKit" : "Unknown";
let engine = "Unknown";
let brand = "Unknown";
let brandversion = "0.00";
if (uad) {
const os = capitalize(uad.platform);
const brandMap = {
IE: { engine: "Trident", brand: "IE" },
SAFARI: { engine: "WebKit", brand: "Safari" },
FIREFOX: { engine: "Gecko", brand: "Firefox" },
EDGE: { engine: "Blink", brand: "Edge" },
CHROME: { engine: "Blink", brand: "Chrome" },
OPERA: { engine: "Blink", brand: "Opera" },
BRAVE: { engine: "Blink", brand: "Brave" },
YANDEX: { engine: "Blink", brand: "Yandex" },
"MICROSOFT EDGE": { engine: "Blink", brand: "Edge" },
"GOOGLE CHROME": { engine: "Blink", brand: "Chrome" },
};
uad.brands.some(b => {
const reqBrand = b.brand.toUpperCase();
const brandInfo = brandMap[reqBrand];
if (brandInfo) {
engine = brandInfo.engine;
brand = brandInfo.brand;
brandversion = b.version;
return true;
} else if (reqBrand === "CHROMIUM") {
engine = "Blink";
brand = "Chromium";
brandversion = b.version;
}
});
return { engine, brand, brandversion, os, "trust-engine": trustengine, credit: uad.credit ?? null };
} else {
const ua = navigator.userAgent;
let nameOffset, verOffset, ix;
if ((verOffset = ua.indexOf("OPR")) !== -1) {
brand = "Opera";
engine = "Blink";
brandversion = ua.substring(verOffset + 4);
if ((verOffset = ua.indexOf("Version")) !== -1) brandversion = ua.substring(verOffset + 8);
} else if ((verOffset = ua.indexOf("UBrowser")) !== -1) {
brand = "UCBrowser";
engine = "Blink";
brandversion = ua.substring(verOffset + 9);
} else if ((verOffset = ua.indexOf("YaBrowser")) !== -1) {
brand = "Yandex";
engine = "Blink";
brandversion = ua.substring(verOffset + 10);
} else if ((verOffset = ua.indexOf("Brave")) !== -1) {
brand = "Brave";
engine = "Blink";
brandversion = ua.substring(verOffset + 6);
} else if ((verOffset = ua.indexOf("Edg")) !== -1) {
brand = "Edge";
engine = "Blink";
brandversion = ua.substring(verOffset + 4);
} else if ((verOffset = ua.indexOf("Chromium")) !== -1) {
brand = "Chromium";
engine = "Blink";
brandversion = ua.substring(verOffset + 9);
} else if ((verOffset = ua.indexOf("Maxthon")) !== -1) {
brand = "Maxthon";
engine = "Blink";
brandversion = ua.substring(verOffset + 8);
} else if ((verOffset = ua.indexOf("Chrome")) !== -1) {
brand = "Chrome";
engine = "Blink";
brandversion = ua.substring(verOffset + 7);
} else if ((verOffset = ua.indexOf("Safari")) !== -1) {
brand = "Safari";
engine = "WebKit";
brandversion = ua.substring(verOffset + 7);
if ((verOffset = ua.indexOf("Version")) !== -1) brandversion = ua.substring(verOffset + 8);
} else if ((verOffset = ua.indexOf("Waterfox")) !== -1) {
brand = "Waterfox";
engine = "Gecko";
brandversion = ua.substring(verOffset + 9);
} else if ((verOffset = ua.indexOf("Firefox")) !== -1) {
brand = "Firefox";
engine = "Gecko";
brandversion = ua.substring(verOffset + 8);
} else if ((verOffset = ua.indexOf("Trident")) !== -1) {
brand = "IE";
engine = "Trident";
brandversion = String(parseFloat(ua.substring(ua.indexOf("MSIE") + 5)) || parseFloat(ua.substring(ua.indexOf("rv") + 3)));
} else if ((nameOffset = ua.lastIndexOf(" ") + 1) < (verOffset = ua.lastIndexOf("/"))) {
brand = ua.substring(nameOffset, verOffset);
engine = trustengine;
brandversion = ua.substring(verOffset + 1);
if (brand.toLowerCase() === brand.toUpperCase()) {
brand = navigator.appName;
}
}
if ((ix = brandversion.indexOf(";")) !== -1) brandversion = brandversion.substring(0, ix);
if ((ix = brandversion.indexOf(" ")) !== -1) brandversion = brandversion.substring(0, ix);
let os = "Unknown";
if (ua.indexOf("Win") !== -1) os = "Windows";
if (ua.indexOf("Mac") !== -1) os = "MacOS";
if (ua.indexOf("Linux") !== -1) os = "Linux";
if (ua.indexOf("Android") !== -1) os = "Android";
if (ua.indexOf("like Mac") !== -1) os = "iOS";
return { engine, brand, brandversion, os, "trust-engine": trustengine, credit: null };
}
}
function getLocationInfo() {
const { pathname: cPN, hostname: cHN, protocol: cP } = location;
const isTop = self === top;
const pHN = parent !== self ? getParentHost() : cHN;
return { cHN, cPN, cP, pHN, isTop };
function getParentHost() {
try {
return parent.location.hostname;
} catch (e) {
return new URL(document.referrer || location).hostname;
}
}
}
function getMetaValue(str) {
const queryReg = new RegExp(`//\\s+@${str}\\s+(.+)`);
const metaValue = (GMinfo.scriptMetaStr || GMinfo.scriptSource)?.match(queryReg);
return metaValue?.[1];
}
function setDebuggerMode() {
return new URLSearchParams(location.search).get("whoami") === (getMetaValue("author") ?? GMinfo.script.author);
}
function sleep(delay, { useCachedSetTimeout } = {}) {
const timeoutFunction = useCachedSetTimeout ? setTimeout : raf.setTimeout;
const sleepPromise = new Promise(resolve => {
timeoutFunction(resolve, delay);
});
const promiseFunction = value => sleepPromise.then(() => value);
promiseFunction.then = (...args) => sleepPromise.then(...args);
promiseFunction.catch = Promise.resolve().catch;
return promiseFunction;
}
function deBounce({ fn, delay, timer, immed, once } = {}) {
if (typeof fn !== "function") return;
let caller = 0;
const threshold = Number(Boolean(immed));
return function () {
const context = this;
const args = arguments;
if (once === true) {
if (!def.count[timer]) {
def.count[timer] = true;
fn.apply(context, args);
}
} else {
if (typeof def.count[timer] === "undefined") {
immed === true && fn.apply(context, args);
} else {
raf.clearTimeout(def.count[timer]);
caller++;
}
def.count[timer] = raf.setTimeout(() => {
caller >= threshold && fn.apply(context, args);
delete def.count[timer];
caller = null;
}, delay);
}
};
}
function safeRemove(expr, scope) {
let removedNodes = [];
let pendingNodes = [];
switch (typeof expr) {
case "string":
pendingNodes = qA(expr, scope);
pendingNodes.forEach(item => {
removeNode(item);
});
break;
case "object":
if (expr instanceof Element) {
pendingNodes.push(expr);
removeNode(expr);
}
break;
}
return compareArray(removedNodes, pendingNodes);
function removeNode(item) {
try {
removedNodes.push(item.parentNode.removeChild(item));
} catch (e) {
item.remove();
removedNodes.push(item);
}
}
}
function convertToUnicode(str) {
if (typeof str !== "string") return "";
let ret = "";
for (let i = 0, l = str.length; i < l; i++) {
ret += `\\${("00" + str.charCodeAt(i).toString(16)).slice(-4)}`;
}
return ret.toUpperCase();
}
function debugOnce(name, ...logs) {
deBounce({ fn: DEBUG, timer: name, once: true })(...logs);
}
/* ENVIRONMENT_VARIABLE_PREPROCESSING */
~(function (tTP, requestEnvironmentConstants) {
"use strict";
const SET_BOOL_FOR_UPDATE = true; // DON'T TOUCH IT! MUST BE BOOLEAN TYPE. RECONSTRUCTION DATE: 2023.04.08
const { navigatorInfo, locationInfo } = requestEnvironmentConstants();
const { engine, brand, brandversion, os, "trust-engine": trustengine, credit } = navigatorInfo;
const { cHN: CUR_HOST_NAME, cPN: CUR_HOST_PATH, cP: CUR_PROTOCOL, pHN: TOP_HOST_NAME, isTop: CUR_WINDOW_TOP } = locationInfo;
const IS_REAL_BLINK = trustengine === "Blink";
const IS_REAL_GECKO = trustengine === "Gecko";
const IS_REAL_WEBKIT = trustengine === "WebKit";
const IS_CHEAT_UA = !credit && (engine !== trustengine || checkBlinkCheatingUA());
const IS_IN_FRAMES = CUR_WINDOW_TOP ? "" : "[FRAMES]";
const IS_GREASEMONKEY = GMscriptHandler === "Greasemonkey";
const CAN_I_USE = detectBrowserCompatibility();
/* CUSTOMIZE_UPDATE_PROMPT_INFORMATION */
const UPDATE_VERSION_NOTICE = String(
`<li class="${def.const.seed}_add">新增自定义排除渲染网址的管理功能,请查阅[<a target="_blank" href="${def.const.gfHost}#ex">使用说明</a>]</li>
<li class="${def.const.seed}_add">新增自定义等宽字体开关,默认关闭需手动开启[<a target="_blank" href="${def.const.gfHost}#custommonofont">看图</a>]</li>
<li class="${def.const.seed}_fix">优化全局样式的预定义内容及样式加载的逻辑与效率。</li>
<li class="${def.const.seed}_fix">修正window.find()非标方法在ShadowRoot中无效的Bug.</li>
<li class="${def.const.seed}_fix">修正Github:Feature preview中代码预览功能的样式Bug.</li>
<li class="${def.const.seed}_fix">修正一些已知的问题,优化样式,优化代码。</li>`
);
/* INITIALIZE_FONT_LIBRARY */
const fontCheck = new Set([
{ ch: "微软雅黑", en: "Microsoft YaHei UI", ps: "MicrosoftYaHeiUI" },
{ ch: "微軟正黑體", en: "Microsoft JhengHei", ps: "MicrosoftJhengHeiRegular" },
{ ch: "苹方-简", en: "PingFang SC", ps: "PingFangSC-Regular" },
{ ch: "蘋方-繁", en: "PingFang TC", ps: "PingFangTC-Regular" },
{ ch: "蘋方-港", en: "PingFang HK", ps: "PingFangHK-Regular" },
{ ch: "更纱黑体 SC", en: "Sarasa Gothic SC", ps: "Sarasa-Gothic-SC-Regular" },
{ ch: "更紗黑體 TC", en: "Sarasa Gothic TC", ps: "Sarasa-Gothic-TC-Regular" },
{ ch: "冬青黑体简", en: "Hiragino Sans GB", ps: "HiraginoSansGB-Regular" },
{ ch: "兰亭黑-简", en: "Lantinghei SC", ps: "FZLTTHK--GBK1-0" },
{ ch: "OPPOSans", en: "OPPOSans", ps: "OPPOSans-R" },
{ ch: "霞鹜文楷", en: "LXGW WenKai", ps: "LXGWWenKai-Regular" },
{ ch: "鸿蒙黑体", en: "HarmonyOS Sans SC", ps: "HarmonyOS_Sans_SC" },
{ ch: "浪漫雅圆", en: "LMYY", ps: "浪漫雅圆" },
{ ch: "思源黑体", en: "Source Han Sans SC", ps: "SourceHanSansSC-Regular" },
{ ch: "思源宋体", en: "Source Han Serif SC", ps: "SourceHanSerifSC-Regular" },
{ ch: "汉仪旗黑", en: "HYQiHei", ps: "HYQiHei-EES" },
{ ch: "文泉驿微米黑", en: "WenQuanYi Micro Hei", ps: "WenQuanYiMicroHei" },
{ ch: "文泉驿正黑", en: "WenQuanYi Zen Hei", ps: "WenQuanYiZenHei" },
{ ch: "方正舒体", en: "FZShuTi", ps: "FZSTK--GBK1-0" },
{ ch: "方正姚体", en: "FZYaoti", ps: "FZYTK--GBK1-0" },
{ ch: "华文仿宋", en: "STFangsong", ps: "STFangsong" },
{ ch: "华文楷体", en: "STKaiti", ps: "STKaiti" },
{ ch: "华文细黑", en: "STXihei", ps: "STXihei" },
{ ch: "华文彩云", en: "STCaiyun", ps: "STCaiyun" },
{ ch: "华文琥珀", en: "STHupo", ps: "STHupo" },
{ ch: "华文新魏", en: "STXinwei", ps: "STXinwei" },
{ ch: "华文隶书", en: "STLiti", ps: "STLiti" },
{ ch: "华文行楷", en: "STXingkai", ps: "STXingkai" },
{ ch: "雅痞-简", en: "Yuppy SC", ps: "YuppySC-Regular" },
{ ch: "圆体-简", en: "Yuanti SC", ps: "YuantiSC-Regular" },
{ ch: "手书体", en: "ShouShuti", ps: "ShouShuti" },
{ ch: "幼圆", en: "YouYuan", ps: "YouYuan" },
{ ch: "微软雅黑(置换版)", en: "Microsoft YaHei", ps: "MicrosoftYaHei" },
]);
/* INITIALIZE_FONT_RENDERING_PARAMETERS */
const INITIAL_VALUES = {
fontBase: `system-ui,-apple-system,BlinkMacSystemFont,sans-serif,'iconfont','icomoon','FontAwesome','Font Awesome 5 Pro','Font Awesome 6 Pro','IcoFont','fontello','themify','Material Icons','Material Icons Extended','bootstrap-icons','Segoe Fluent Icons','Material-Design-Iconic-Font','office365icons','Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji','Android Emoji','EmojiSymbols','emojione mozilla','twemoji mozilla'`,
fontSelect: IS_REAL_WEBKIT ? `'PingFang SC'` : `'Microsoft YaHei UI'`,
fontFace: true,
fontSmooth: true,
fontSize: 1.0,
fixViewport: true,
fontStroke: IS_REAL_GECKO ? 0.08 : IS_REAL_BLINK ? 0.015 : 0.0,
fixStroke: IS_REAL_BLINK,
fontShadow: IS_REAL_GECKO ? 0.36 : 0.75,
shadowColor: IS_REAL_GECKO ? "#7C7C7C70" : "#7C7C7CDD",
fontCSS: `:not(i,head *):not([class*='glyph']):not([class*='icon']):not([class*='fa-']):not([class*='vjs-']):not([class*='mu-'])`,
fontEx: `progress,meter,datalist,samp,kbd,pre,pre *,code,code *`,
monospacedFont: `'Operator Mono Lig','Fira Code','Source Code Pro','DejaVu Sans Mono','Anonymous Pro','Ubuntu Mono','Roboto Mono','JetBrains Mono','Droid Sans Mono','Mono','Monaco','Menlo','Inconsolata','Liberation Mono'`,
monospacedFeature: `"liga" 0,"tnum","zero"`,
editorialSites: `vscode.dev|github.dev|github1s.com|kdocs.cn|docs.qq.com|cdn.addon.tencentsuite.com|yuque.com|xiezuocat.com|wolai.com|shimo.im|note.youdao.com|feishu.cn|docs.google.com|mail.google.com|newassets.hcaptcha.com|image.baidu.com|weread.qq.com|www.notion.so`,
};
/* INITIALIZE_SHADOWROOT_STYLE */
def.const.style = {
mainStyle: `display:inline-block;font-family:monospace,${INITIAL_VALUES.fontSelect},sans-serif`,
global: "input:is([type='text'],[type='password'],[type='search']),input:not([type]){font-family:initial!important}",
frDialogBox: String(
`:host(#${def.id.dialogbox}){position:fixed;top:0;left:0;width:100%;height:100%;background:0 0;pointer-events:none;z-index:1999999995}div.${def.class.db}{z-index:99999;box-sizing:content-box;max-width:420px;border:2px solid #efefef;color:#444444;pointer-events:auto}.${def.class.db}{position:absolute;top:calc(12% + 10px);right:15px;display:block;overflow:hidden;width:100%;border-radius:6px;background:#ffffff;box-shadow:0 0 10px 0 rgba(0, 0, 0, 0.3);transition:opacity .5s}.${def.class.db} *{text-shadow:0 0 1px #777!important;font-family:${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;line-height:1.5!important;-webkit-text-stroke:0 transparent!important}.${def.class.dbt}{margin-top:0;padding:10px 12px;width:auto;background:#efefef;text-align:left;font-weight:700;font-size:18px!important;font-family:Candara,'Times New Roman',${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}.${def.class.dbm}{margin:5px;padding:10px;color:#444444;text-align:left;font-weight:500;font-size:16px!important}.${def.class.dbb}{display:inline-block;box-sizing:content-box;margin:2px 1%;padding:8px 12px;min-width:12%;border-radius:4px;text-align:center;text-decoration:none!important;letter-spacing:0;font-weight:400;cursor:pointer}.${def.class.db} .${def.class.readonly}{background:linear-gradient(45deg,#ffe9e9,#ffe9e9 25%,transparent 0,transparent 50%,#ffe9e9 0,#ffe9e9 75%,transparent 0,transparent)!important;background-color:#fff7f7!important;background-size:50px 50px!important}.${def.class.db} .gradient-bg{background:#e7ffd9;animation:gradient 2s ease-in-out forwards}@keyframes gradient{0%{background:#e7ffd9}to{background:transparent}}` +
`.${def.class.dbb}:hover{box-sizing:content-box;color:#ffffff;text-decoration:none!important;font-weight:700;opacity:.8}.${def.class.db} .${def.class.dbt},.${def.class.dbb},.${def.class.dbb}:hover{text-shadow:none!important;-webkit-text-stroke:0 transparent!important;-webkit-user-select:none;user-select:none}.${def.class.dbbf},.${def.class.dbbf}:hover{border:1px solid #d93223!important;border-radius:6px;background:#d93223!important;color:#ffffff!important;font-size:14px!important}.${def.class.dbbf}:hover{box-shadow:0 0 3px #d93223!important}.${def.class.dbbt},.${def.class.dbbt}:hover{border:1px solid #038c5a!important;border-radius:6px;background:#038c5a!important;color:#ffffff!important;font-size:14px!important}.${def.class.dbbt}:hover{box-shadow:0 0 3px #038c5a!important}.${def.class.dbbn},.${def.class.dbbn}:hover{border:1px solid #777777!important;border-radius:6px;background:#777777!important;color:#ffffff!important;font-size:14px!important}.${def.class.dbbn}:hover{box-shadow:0 0 3px #777!important}.${def.class.dbbc}{padding:2.5%;background:#efefef;color:#ffffff;text-align:right}.${def.class.dbm} textarea{cursor:auto;scrollbar-width:thin;overscroll-behavior:contain}.${def.class.dbm} textarea::-webkit-scrollbar{width:8px;height:8px}.${def.class.dbm} textarea::-webkit-scrollbar-corner{border-radius:2px;background:#efefef;box-shadow:inset 0 0 3px #aaaaaa;}.${def.class.dbm} textarea::-webkit-scrollbar-thumb{border-radius:2px;background:#cfcfcf;box-shadow:inset 0 0 5px #999;}.${def.class.dbm} textarea::-webkit-scrollbar-track{border-radius:2px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}.${def.class.dbm} textarea::-webkit-scrollbar-track-piece{border-radius:2px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}` +
`.${def.class.dbm} button:hover{background:#f6f6f6!important;box-shadow:0 0 3px #a7a7a7!important;cursor:pointer}.${def.class.dbm} p{margin:5px 0!important;text-align:left;text-indent:0!important;font-weight:400;font-size:16px!important;line-height:1.5!important;-webkit-user-select:none;user-select:none}.${def.class.dbm} ul{margin:0 0 0 10px!important;padding:2px;color:gray;list-style:none;font:italic 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;-webkit-user-select:none;user-select:none;scrollbar-width:thin}.${def.class.dbm} ul::-webkit-scrollbar{width:10px;height:1px}.${def.class.dbm} ul::-webkit-scrollbar-thumb{border-radius:10px;background:#cfcfcf;box-shadow:inset 0 0 5px #999999;}.${def.class.dbm} ul::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}.${def.class.dbm} ul::-webkit-scrollbar-track-piece{border-radius:6px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}.${def.class.dbm} ul li{display:list-item;list-style-type:none;word-break:break-all}.${def.class.dbm} li:before{display:none}.${def.class.dbm} #${def.id.bk},.${def.class.dbm} #${def.id.pv},.${def.class.dbm} #${def.id.fs},.${def.class.dbm} #${def.id.fvp},.${def.class.dbm} #${def.id.hk},.${def.class.dbm} #${def.id.ct},.${def.class.dbm} #${def.id.mps},.${def.class.dbm} #${def.id.flc},.${def.class.dbm} #${def.id.gc},.${def.class.dbm} #${def.id.cm}{display:flex;box-sizing:content-box;margin:0;padding:2px 4px!important;width:calc(96% - 10px);height:max-content;min-width:auto;min-height:40px;list-style:none;font-style:normal;justify-content:space-between;align-items:flex-start;word-break:break-word}.${def.class.dbm} ul#${def.const.seed}_d_d_ li:hover{background-color:#fdf6eccc!important}` +
`.${def.class.checkbox}{display:none!important}.${def.class.checkbox}+label{position:relative;display:inline-block;box-sizing:content-box;margin:0 2px 0 0;padding:0;width:76px;height:32px;border-radius:7px;background:#f7836d;box-shadow:inset 0 0 20px rgba(0,0,0,.1),0 0 10px rgba(245,146,146,.4);white-space:nowrap;cursor:pointer}.${def.class.checkbox}+label::before{position:absolute;top:0;left:0;z-index:99;width:24px;height:32px;border-radius:7px;background:#ffffff;box-shadow:0 0 1px rgba(0,0,0,.6);color:#ffffff;content:' '}.${def.class.checkbox}+label::after{position:absolute;top:0;left:28px;padding:5px;border-radius:100px;color:#ffffff;content:'OFF';font-weight:700;font-style:normal;font-size:16px}.${def.class.checkbox}:checked+label{margin:0 2px 0 0;background:#67a5df!important;box-shadow:inset 0 0 20px rgba(0,0,0,.1),0 0 10px rgba(146,196,245,.4);cursor:pointer}.${def.class.checkbox}:checked+label::after{left:10px;content:'ON'}.${def.class.checkbox}:checked+label::before{position:absolute;left:52px;z-index:99;content:' '}` +
`.${def.class.dbm} .${def.const.seed}_VIP,.${def.class.dbm} .${def.const.seed}_cusmono{margin:2px 0 0 0;color:#b8860b!important;font:normal 400 16px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important}.${def.class.dbm} #${def.id.flc} button,.${def.class.dbm} #${def.id.gc} button{box-sizing:border-box!important;margin:0 5px 0 0!important;padding:2px 5px!important;border:1px solid #999!important;border-radius:4px!important;background-color:#eeeeee;color:#444444!important;letter-spacing:normal!important;font-weight:400!important;font-size:14px!important}#${def.const.seed}_monospaced_siterules:placeholder-shown{color:#555555!important;white-space:pre-line!important;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}#${def.const.seed}_monospaced_siterules::-webkit-input-placeholder,#${def.const.seed}_monospaced_siterules::-moz-placeholder,#${def.const.seed}_monospaced_font::-moz-placeholder{color:#555555!important;white-space:pre-line!important;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}.${def.class.dbm} a{color:#0969da;text-decoration:none!important;font-style:inherit}.${def.class.dbm} a:hover{color:#dc143c;text-decoration:underline}.${def.class.dbm} #${def.id.feedback}{padding:2px 10px;width:max-content;height:22px;min-width:auto}.${def.class.dbm} #${def.id.files}{display:none}.${def.class.dbm} #${def.id.feedback}:hover{color:crimson!important}` +
`.${def.class.dbm} #${def.id.feedback}:after{width:0;height:0;background:url('${def.const.loadImg}') no-repeat -400px -300px;content:""}` +
`.${def.class.dbm} #${def.const.seed}_custom_Fontlist:placeholder-shown{color:#aaaaaa!important;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}.${def.class.dbm} #${def.const.seed}_custom_Fontlist::-webkit-input-placeholder{color:#aaaaaa!important;white-space:pre-line!important;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important;word-break:break-all!important}.${def.class.dbm} #${def.const.seed}_custom_Fontlist::-moz-placeholder{color:#555555!important;white-space:pre-line;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}.${def.class.dbm} #${def.const.seed}_update li{margin:0;padding:1px 0;color:gray;font:normal 400 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important}.${def.class.dbm} .${def.const.seed}_add:before{display:inline;margin:0 4px 0 -10px;content:'+'}.${def.class.dbm} .${def.const.seed}_del:before{display:inline;margin:0 4px 0 -10px;content:'-'}.${def.class.dbm} .${def.const.seed}_fix:before{display:inline;margin:0 4px 0 -10px;content:'@'}.${def.class.dbm} .${def.const.seed}_info{color:#daa520!important}.${def.class.dbm} .${def.const.seed}_info:before{display:inline;margin:0 4px 0 -10px;content:'#'}.${def.class.dbm} .${def.const.seed}_warn{color:#e90000!important}.${def.class.dbm} .${def.const.seed}_warn:before{display:inline;margin:0 4px 0 -10px;content:'!'}.${def.class.dbm} .${def.const.seed}_init{color:#65a16a!important}.${def.class.dbm} .${def.const.seed}_init:before{display:inline;margin:0 4px 0 -10px;content:'$'}.${def.class.dbm} input:focus,.${def.class.dbm} textarea:focus{box-shadow:inset 0 1px 3px rgb(0 0 0/10%),0 0 4px rgb(110 111 112/60%)!important}`
),
frConfigure:
String(
`:host(#${def.id.configure}){position:fixed;top:0;left:0;width:100%;height:100%;background:0 0;pointer-events:none;z-index:1999999991}#${def.id.container}{position:absolute;top:10px;right:24px;z-index:99999;overflow-x:hidden;overflow-y:auto;box-sizing:content-box;padding:4px;max-height:calc(100% - 40px);min-height:10%;border-radius:12px;background:#f0f6ff!important;box-shadow:0 0 4px 0 rgb(0 0 0/30%);color:#333333;text-align:left;font-weight:700;font-size:16px!important;opacity:0;transition:opacity .5s;width:auto;overscroll-behavior:contain;scrollbar-color:rgb(51 102 153/85%) rgb(0 0 0/25%);scrollbar-width:thin;pointer-events:auto}#${def.id.container}::-webkit-scrollbar{width:10px;height:1px}#${def.id.container}::-webkit-scrollbar-thumb{border-radius:10px;background:#487baf;box-shadow:inset 0 0 5px #67a5df;}#${def.id.container}::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 5px #67a5df;}#${def.id.container}::-webkit-scrollbar-track-piece{border-radius:10px;background:#efefef;box-shadow:inset 0 0 5px #67a5df;}#${def.id.container} *{text-shadow:none!important;font-weight:700;font-size:16px;font-family:${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji,Android Emoji,EmojiSymbols!important;line-height:1.5!important;-webkit-text-stroke:0 transparent!important}` +
`#${def.id.container} fieldset{display:block;margin:2px;padding:4px 6px;width:auto;height:auto;min-height:475px;border:2px groove #67a5df!important;border-radius:10px;background:#f0f6ff!important}#${def.id.container} legend{position:relative!important;float:none!important;display:block!important;visibility:visible!important;box-sizing:content-box;margin:0;padding:0 32px 0 8px;width:auto!important;height:auto!important;border:none!important;background:#f0f6ff!important;font:normal 700 16px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important}#${def.id.container} fieldset ul{margin:0;padding:0;background:#f0f6ff!important}#${def.id.container} ul li{float:none;display:inherit;box-sizing:content-box;margin:3px 0;min-width:-webkit-fill-available;min-width:-moz-available;border:none;background:#f0f6ff!important;list-style:none;cursor:default;-webkit-user-select:none;user-select:none}#${def.id.container} ul li:before{display:none}#${def.id.container} .${def.class.rotation} svg{visibility:visible!important;overflow:hidden;width:24px;height:24px;vertical-align:initial!important;fill:#67a5df;}#${def.id.container} .${def.class.rotation} svg:hover{cursor:help}#${def.const.seed}_scriptname{display:inline-block;vertical-align:bottom;overflow:hidden;max-width:225px;text-overflow:ellipsis;white-space:nowrap;font-weight:700!important;-webkit-user-select:all;user-select:all}#${def.id.container} .${def.class.title} .${def.class.guide}{position:absolute;display:inline-block;cursor:pointer}@keyframes rotation{0%{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(1turn)}}.${def.class.title} .${def.class.rotation}{top:auto;right:auto;bottom:auto;left:auto;margin:0;padding:0;width:24px;height:24px;-webkit-transform:rotate(1turn);transform-origin:center 50% 0;animation:rotation 5s linear infinite}` +
`#${def.id.container} input:not([type='range'],[type='checkbox']):focus,#${def.id.container} textarea:focus{box-shadow:inset 0 1px 3px rgb(0 0 0/10%),0 0 6px rgb(82 168 236/60%)!important}#${def.id.fontList}{padding:2px 10px 0;min-height:73px}#${def.id.fontFace},#${def.id.fontSmooth}{display:flex!important;padding:2px 10px;width:calc(100% - 18px);height:40px;min-width:auto;align-items:center;justify-content:space-between}#${def.id.fontSize}{padding:2px 10px;height:60px}#${def.id.fontStroke}{padding:2px 10px;height:60px}#${def.id.fontShadow}{padding:2px 10px;height:60px}#${def.id.shadowColor}{display:flex;margin:4px;padding:2px 10px;width:auto;min-height:45px;align-items:center;justify-content:space-between;flex-wrap:nowrap;flex-direction:row}#${def.id.fontCss},#${def.id.fontEx}{padding:2px 10px;height:110px;min-height:110px}#${def.id.submit}{padding:2px 10px;height:40px}` +
`#${def.id.fontList} .${def.class.selector} a{text-decoration:none;font-weight:400}#${def.id.fontList} .${def.class.label}{display:inline-block;margin:0 4px 14px 0;padding:0;height:24px;line-height:24px!important}#${def.id.fontList} .${def.class.label} span{display:inline-block;overflow:hidden;box-sizing:border-box;padding:5px;width:max-content;height:max-content;max-width:200px;min-width:12px;background:#67a5df;color:#ffffff;text-overflow:ellipsis;white-space:nowrap;font-weight:400;font-size:16px!important}#${def.id.fontList} .${def.class.close}{width:12px}#${def.id.fontList} .${def.class.close}:hover{border-radius:2px;background-color:#2d7dca;color:tomato}#${def.id.selector}{width:100%;max-width:100%}#${def.id.selector} label{display:block;margin:0 0 4px;color:#333333;cursor:auto}#${def.id.selector} #${def.id.cleaner}{margin-left:5px;cursor:pointer}#${def.id.selector} #${def.id.cleaner}:hover{color:#ff0000;}#${def.id.fontList} .${def.class.selector}{overflow-x:hidden;box-sizing:border-box;margin:0 0 6px;padding:6px 6px 0;width:100%;max-width:min-content;max-width:-moz-min-content;max-height:90px;min-width:100%;min-height:45px;border:2px solid #67a5df!important;border-radius:6px;overscroll-behavior:contain;scrollbar-color:#336699 rgba(0,0,0,.25);scrollbar-width:thin}#${def.id.fontList} .${def.class.selector}::-webkit-scrollbar{width:6px;height:1px}#${def.id.fontList} .${def.class.selector}::-webkit-scrollbar-thumb{border-radius:10px;background:#487baf;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontList} .${def.class.selector}::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontList} .${def.class.selector}::-webkit-scrollbar-track-piece{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px #67a5df}#${def.id.fontList} .${def.class.selectFontId} span.${def.class.spanlabel},#${def.id.selector} span.${def.class.spanlabel}{display:block!important;margin:0!important;padding:0 0 4px;width:auto;border:0;background-color:transparent!important;color:#333333;text-align:left!important}` +
`#${def.id.fontList} .${def.class.selectFontId}{width:auto}#${def.id.fontList} .${def.class.selectFontId} input{overflow:hidden;box-sizing:border-box;margin:0;padding:1px 23px 1px 2px;width:230px;height:42px!important;max-width:100%;min-width:100%;outline:none!important;outline-color:#67a5df;border:2px solid #67a5df!important;border-radius:6px;background:#fafafa;text-indent:8px;text-overflow:ellipsis;font-weight:700;font-size:16px!important;font-family:${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important}#${def.id.fontList} .${def.class.selectFontId} input[disabled]{pointer-events:none!important}#${def.id.fontList} .${def.class.selectFontId} input::-webkit-search-cancel-button{margin:0 7px}.${def.class.placeholder}:placeholder-shown{color:#336699!important;font:normal 700 16px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;opacity:.95!important}.${def.class.placeholder}::-webkit-input-placeholder{color:#336699!important;font:normal 700 16px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;opacity:.65!important}.${def.class.placeholder}::-moz-placeholder{color:#336699!important;font:normal 700 16px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;opacity:.65!important}#${def.id.fontList} .${def.class.selectFontId} dl{position:absolute;z-index:1000;overflow-x:hidden;box-sizing:content-box;margin:4px 0 0;padding:4px 8px;width:auto;max-width:calc(100% - 68px);max-height:298px;min-width:60%;border:2px solid #67a5df!important;border-radius:6px;background-color:#ffffff;white-space:nowrap;font-size:18px!important;overscroll-behavior:contain;scrollbar-color:#487baf rgba(0,0,0,.25);scrollbar-width:thin}` +
`#${def.id.fontList} .${def.class.selectFontId} dl::-webkit-scrollbar{width:10px;height:1px}#${def.id.fontList} .${def.class.selectFontId} dl::-webkit-scrollbar-thumb{border-radius:10px;background:#487baf;box-shadow:inset 0 0 5px #67a5df;}#${def.id.fontList} .${def.class.selectFontId} dl::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 5px #67a5df;}#${def.id.fontList} .${def.class.selectFontId} dl::-webkit-scrollbar-track-piece{border-radius:10px;background:#efefef;box-shadow:inset 0 0 5px #67a5df;}#${def.id.fontList} .${def.class.selectFontId} dl dd{display:block;overflow-x:hidden;box-sizing:content-box;margin:1px 8px;padding:5px 0;width:-moz-available;width:-webkit-fill-available;max-width:100%;min-width:100%;text-overflow:ellipsis;font-weight:400;font-size:21px!important}#${def.id.fontList} .${def.class.selectFontId} dl dd:hover{overflow-x:hidden;box-sizing:content-box;min-width:-moz-available;min-width:-webkit-fill-available;background-color:#67a5df;color:#ffffff;text-overflow:ellipsis}` +
`.${def.class.checkbox}{display:none!important}.${def.class.checkbox}+label{position:relative;display:inline-block;box-sizing:content-box;margin:0 2px 0 0;padding:0;width:76px;height:32px;border-radius:7px;background:#f7836d;box-shadow:inset 0 0 20px rgba(0,0,0,.1),0 0 10px rgba(245,146,146,.4);white-space:nowrap;cursor:pointer}.${def.class.checkbox}+label::before{position:absolute;top:0;left:0;z-index:99;width:24px;height:32px;border-radius:7px;background:#ffffff;box-shadow:0 0 1px rgba(0,0,0,.6);color:#ffffff;content:" "}.${def.class.checkbox}+label::after{position:absolute;top:0;left:28px;padding:5px;border-radius:100px;color:#ffffff;content:"OFF";font-weight:700;font-style:normal;font-size:16px}.${def.class.checkbox}:checked+label{margin:0 2px 0 0;background:#67a5df!important;box-shadow:inset 0 0 20px rgba(0,0,0,.1),0 0 10px rgba(146,196,245,.4);cursor:pointer}.${def.class.checkbox}:checked+label::after{left:10px;content:"ON"}.${def.class.checkbox}:checked+label::before{position:absolute;left:52px;z-index:99;content:" "}#${def.id.fface} label,#${def.id.fface}+label::after,#${def.id.fface}+label::before,#${def.id.smooth} label,#${def.id.smooth}+label::after,#${def.id.smooth}+label::before{-webkit-transition:all .3s ease-in;transition:all .3s ease-in}` +
`#${def.id.fontShadow} div.${def.class.flex}:before,#${def.id.fontShadow} div.${def.class.flex}:after,#${def.id.fontStroke} div.${def.class.flex}:before,#${def.id.fontStroke} div.${def.class.flex}:after,#${def.id.fontSize} div.${def.class.flex}:before,#${def.id.fontSize} div.${def.class.flex}:after{display:none}#${def.id.fontShadow} #${def.id.shadowSize},#${def.id.fontStroke} #${def.id.strokeSize},#${def.id.fontSize} #${def.id.fontScale}{box-sizing:content-box;margin:0 10px 0 0!important;padding:0;width:56px!important;height:32px!important;outline:none!important;border:2px solid #67a5df!important;border-radius:4px;background:#fafafa!important;color:#111111!important;text-align:center;text-indent:0;font-weight:400!important;font-size:17px!important;font-family:Impact,Times,serif!important}#${def.id.fontSize} #${def.id.fontScale}[disabled]{background-color:rgba(228,231,237,.82)!important;color:#555555!important;filter:grayscale(.9)}#${def.id.fontSize} #${def.id.fviewport}>label,#${def.id.fontStroke} #${def.id.fstroke}>label{float:none!important;display:inline!important;margin:0!important;padding:0 0 0 2px!important;color:#666666!important;font-size:12px!important;cursor:help!important}#${def.id.fixViewport},#${def.id.fixStroke}{display:inline-block;margin:0 2px 0 0!important;width:14px!important;height:14px!important;vertical-align:text-bottom;cursor:pointer;-webkit-appearance:checkbox!important}` +
`#${def.id.fixViewport}::after,#${def.id.fixStroke}::after{position:relative;top:0;display:inline-block;margin:0;padding:0;width:14px;height:14px;border-radius:3px;background-color:#aaaaaa;color:#ffffff;content:"\u2717";vertical-align:top;text-align:center;font-weight:700;font-size:12px;line-height:14px}#${def.id.fixViewport}:checked::after,#${def.id.fixStroke}:checked::after{border:0!important;background-color:#65a0db;color:#ffffff;content:"\u2713";font-weight:700;font-size:12px;line-height:14px}.${def.class.flex}{display:flex;width:auto;min-width:100%;align-items:center;justify-content:space-between;flex-wrap:nowrap;flex-direction:row}.${def.class.slider} input{visibility:hidden}#${def.id.shadowColor} *{box-sizing:content-box}#${def.id.shadowColor} .${def.class.frColorPicker}{margin:0;padding:0;width:auto}#${def.id.shadowColor} .${def.class.frColorPicker} #${def.id.color}{box-sizing:border-box;margin:0;padding:0 8px 0 0;width:160px!important;height:35px!important;min-width:160px;outline:none!important;border:2px solid #67a5df!important;border-radius:4px;background:rgba(253,253,255,.69);color:#333333!important;text-align:center;text-indent:0;font-weight:400!important;font-size:18px!important;font-family:Impact,Times,serif!important;cursor:pointer}` +
`#${def.id.fontCss} textarea,#${def.id.fontEx} textarea{box-sizing:border-box;margin:0;padding:5px;width:calc(100% - 2px)!important;height:78px;max-width:calc(100% - 2px);max-height:78px;min-width:calc(100% - 2px);min-height:78px;outline:none!important;border:2px solid #67a5df!important;border-radius:6px;color:#0b5b9c!important;font:normal 700 14px/150% monospace,${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont!important;resize:none;cursor:auto;word-break:break-all;scrollbar-color:#487baf rgba(0,0,0,.25);scrollbar-width:thin;overscroll-behavior:contain}#${def.id.fontCss} textarea::-webkit-scrollbar{width:6px;height:1px}#${def.id.fontCss} textarea::-webkit-scrollbar-thumb{border-radius:10px;background:#487baf;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontCss} textarea::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px rgba(0,0,0,.2);}#${def.id.fontCss} textarea::-webkit-scrollbar-track-piece{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontEx} textarea{background:#fafafa!important}#${def.id.fontEx} textarea::-webkit-scrollbar{width:6px;height:1px}#${def.id.fontEx} textarea::-webkit-scrollbar-thumb{border-radius:10px;background:#487baf;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontEx} textarea::-webkit-scrollbar-track{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px #67a5df;}#${def.id.fontEx} textarea::-webkit-scrollbar-track-piece{border-radius:10px;background:#efefef;box-shadow:inset 0 0 2px #67a5df;}.${def.class.switch}{float:right;box-sizing:border-box;margin:-2px 4px 0 0;padding:0 6px;border:2px double #67a5df;border-radius:4px;color:#0a68c1;}#${def.id.cSwitch}:hover,#${def.id.eSwitch}:hover{cursor:pointer;-webkit-user-select:none;user-select:none}.${def.class.readonly}{background:linear-gradient(45deg,#ffe9e9,#ffe9e9 25%,transparent 0,transparent 50%,#ffe9e9 0,#ffe9e9 75%,transparent 0,transparent)!important;background-color:#fff7f7!important;background-size:50px 50px!important}.${def.class.notreadonly}{background:linear-gradient(45deg,#e9ffe9,#e9ffe9 25%,transparent 0,transparent 50%,#e9ffe9 0,#e9ffe9 75%,transparent 0,transparent)!important;background-color:#f7fff7!important;background-size:50px 50px}` +
`.${def.class.dbm} textarea{cursor:auto;scrollbar-width:thin;overscroll-behavior:contain}.${def.class.dbm} textarea::-webkit-scrollbar{width:8px;height:8px}.${def.class.dbm} textarea::-webkit-scrollbar-corner{border-radius:2px;background:#efefef;box-shadow:inset 0 0 3px #aaaaaa;}.${def.class.dbm} textarea::-webkit-scrollbar-thumb{border-radius:2px;background:#cfcfcf;box-shadow:inset 0 0 5px #999999;}.${def.class.dbm} textarea::-webkit-scrollbar-track{border-radius:2px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}.${def.class.dbm} textarea::-webkit-scrollbar-track-piece{border-radius:2px;background:#efefef;box-shadow:inset 0 0 5px #aaaaaa;}` +
`#${def.id.submit} button{box-sizing:border-box;margin:0;padding:5px 10px;width:auto;height:35px;min-width:min-content;min-height:35px;border:2px solid #6ba7e0;border-radius:6px;background-color:#67a5df;background-image:none;color:#ffffff!important;font:normal 600 14px/150% ${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;cursor:pointer}#${def.id.submit} button:hover{box-shadow:0 0 5px rgba(0,0,0,.4)!important}#${def.id.submit} .${def.class.cancel},#${def.id.submit} .${def.class.reset}{float:left;margin-right:10px}#${def.id.submit} .${def.class.submit}{float:right}#${def.id.submit} #${def.id.backup}{display:none;margin:0 10px 0 0}.${def.class.anim}{border:2px solid #dc143c!important;background:#dc143c!important;animation:jiggle 1.8s ease-in infinite}@keyframes jiggle{48%,62%{transform:scale(1,1)}50%{transform:scale(1.1,.9)}56%{transform:scale(.9,1.1) translate(0,-5px)}59%{transform:scale(1,1) translate(0,-3px)}}`
) +
String(
`.${def.class.tooltip}{position:relative;cursor:help;-webkit-user-select:none;user-select:none}.${def.class.tooltip} span.${def.class.emoji}{font-weight:400!important}.${def.class.tooltip}:active .${def.class.tooltip}{display:block}.${def.class.tooltip} .${def.class.tooltip}{position:absolute;z-index:999999;display:none;box-sizing:content-box;padding:10px;width:234px;max-width:234px;border:2px solid #b8c4ce;border-radius:6px;background-color:#54a2ec;color:#ffffff;font-weight:400;opacity:.9;word-break:break-all}.${def.class.tooltip} .${def.class.tooltip} *{font-size:14px!important;font-family:${INITIAL_VALUES.fontSelect},system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important}.${def.class.tooltip} .${def.class.tooltip} em{font-style:normal!important}.${def.class.tooltip} .${def.class.tooltip} strong{color:darkorange;font-size:18px!important}.${def.class.tooltip} .${def.class.tooltip} p{display:block;margin:0 0 10px;color:#ffffff;text-indent:0!important;line-height:150%}.${def.class.ps1}{position:relative;top:-33px;right:5px;float:right;margin:0;padding:0;width:24px;height:0}.${def.class.ps2}{top:35px;right:-7px}` +
`.${def.class.ps3}{top:-197px;${IS_REAL_WEBKIT ? "left:-72px" : "left:auto"}}` +
`.${def.class.ps4}{top:-197px;${IS_REAL_WEBKIT ? "right:-64px" : "left:auto"}}` +
`.${def.class.ps5}{top:-322px;${IS_REAL_WEBKIT ? "right:-54px" : "left:auto"}}`
) +
String(
`.${def.class.range}{--primary-color:#67a5df;--value-offset-y:var(--ticks-gap);--value-active-color:white;--value-background:transparent;--value-background-hover:var(--primary-color);--value-font:italic 700 14px/14px monospace,serif;--fill-color:var(--primary-color);--progress-background:rgb(223, 223, 223);--progress-radius:20px;--show-min-max:none;--track-height:calc(var(--thumb-size) / 2);--min-max-font:12px serif;--min-max-opacity:0.5;--min-max-x-offset:10%;--thumb-size:22px;--thumb-color:white;--thumb-shadow:0 0 3px rgba(0, 0, 0, 0.4),0 0 1px rgba(0, 0, 0, 0.5) inset,0 0 0 99px var(--thumb-color) inset;--thumb-shadow-active:0 0 0 calc(var(--thumb-size) / 4) inset var(--thumb-color),0 0 0 99px var(--primary-color) inset,0 0 3px rgba(0, 0, 0, 0.4);--thumb-shadow-hover:0 0 0 calc(var(--thumb-size) / 4) inset var(--thumb-color),0 0 0 99px darkorange inset,0 0 3px rgba(0, 0, 0, 0.4);--ticks-thickness:1px;--ticks-height:5px;--ticks-gap:var(--ticks-height, 0);--ticks-color:transparent;--step:1;--ticks-count:(var(--max) - var(--min))/var(--step);--maxTicksAllowed:1000;--too-many-ticks:Min(1, Max(var(--ticks-count) - var(--maxTicksAllowed), 0));--x-step:Max(var(--step), var(--too-many-ticks) * (var(--max) - var(--min)));--tickIntervalPerc_1:Calc((var(--max) - var(--min)) / var(--x-step));--tickIntervalPerc:calc((100% - var(--thumb-size)) / var(--tickIntervalPerc_1) * var(--tickEvery, 1));--value-a:Clamp(var(--min), var(--value, 0), var(--max));--value-b:var(--value, 0);--text-value-a:var(--text-value, "");--completed-a:calc((var(--value-a) - var(--min)) / (var(--max) - var(--min)) * 100);--completed-b:calc((var(--value-b) - var(--min)) / (var(--max) - var(--min)) * 100);--ca:Min(var(--completed-a), var(--completed-b));--cb:Max(var(--completed-a), var(--completed-b));--thumbs-too-close:Clamp(-1, 1000 * (Min(1, Max(var(--cb) - var(--ca) - 5, -1)) + 0.001), 1);--thumb-close-to-min:Min(1, Max(var(--ca) - 5, 0));--thumb-close-to-max:Min(1, Max(95 - var(--cb), 0))}` +
`.${def.class.range}{width:auto;min-width:105%!important;margin:-3px 0 0 -7px;box-sizing:content-box;display:inline-block;height:Max(var(--track-height),var(--thumb-size));background:linear-gradient(to right,var(--ticks-color) var(--ticks-thickness),transparent 1px) repeat-x;background-size:var(--tickIntervalPerc) var(--ticks-height);background-position-x:calc(var(--thumb-size)/ 2 - var(--ticks-thickness)/ 2);background-position-y:var(--flip-y,bottom);padding-bottom:var(--flip-y,var(--ticks-gap));padding-top:calc(var(--flip-y) * var(--ticks-gap));position:relative;z-index:1}.${def.class.range}[disabled]{filter:grayscale(0.9);}.${def.class.range}[data-ticks-position=top]{--flip-y:1}.${def.class.range}::after,.${def.class.range}::before{--offset:calc(var(--thumb-size) / 2);content:counter(x);display:var(--show-min-max,block);font:var(--min-max-font);position:absolute;bottom:var(--flip-y,-2.5ch);top:calc(-2.5ch * var(--flip-y));opacity:Clamp(0,var(--at-edge),var(--min-max-opacity));transform:translateX(calc(var(--min-max-x-offset) * var(--before,-1) * -1)) scale(var(--at-edge));pointer-events:none}.${def.class.range}::before{--before:1;--at-edge:var(--thumb-close-to-min);counter-reset:x var(--min);left:var(--offset)}.${def.class.range}::after{--at-edge:var(--thumb-close-to-max);counter-reset:x var(--max);right:var(--offset)}` +
`.${def.class.rangeProgress}{--start-end:calc(var(--thumb-size) / 2);--clip-end:calc(100% - (var(--cb)) * 1%);--clip-start:calc(var(--ca) * 1%);--clip:inset(-20px var(--clip-end) -20px var(--clip-start));position:absolute;left:var(--start-end);right:var(--start-end);top:calc(var(--ticks-gap) * var(--flip-y,0) + var(--thumb-size)/ 2 - var(--track-height)/ 2);height:calc(var(--track-height));background:var(--progress-background,#eee);pointer-events:none;z-index:-1;border-radius:var(--progress-radius)}.${def.class.rangeProgress}::before{content:"";position:absolute;left:0;right:0;clip-path:var(--clip);top:0;bottom:0;background:var(--fill-color,#000);box-shadow:var(--progress-flll-shadow);z-index:1;border-radius:inherit}.${def.class.rangeProgress}::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;box-shadow:var(--progress-shadow);pointer-events:none;border-radius:inherit}.${def.class.range}>input:only-of-type~.${def.class.rangeProgress}{--clip-start:0}` +
`.${def.class.range}>input::-webkit-slider-runnable-track{background:transparent!important;box-shadow:none!important;border:none!important}.${def.class.range}>input{-webkit-appearance:none;box-shadow:none!important;width:100%;height:var(--thumb-size)!important;margin:0!important;padding:0!important;position:absolute!important;left:0;top:calc(50% - Max(var(--track-height),var(--thumb-size))/ 2 + calc(var(--ticks-gap)/ 2 * var(--flip-y,-1)))!important;border:0!important;cursor:grab;outline:0!important;background:0 0!important;--thumb-shadow:var(--thumb-shadow-active)}.${def.class.range}>input:not(:only-of-type){pointer-events:none}.${def.class.range}>input::-webkit-slider-thumb{appearance:none;border:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color);box-shadow:var(--thumb-shadow);pointer-events:auto;transition:.1s}.${def.class.range}>input::-moz-range-thumb{appearance:none;border:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color);box-shadow:var(--thumb-shadow);pointer-events:auto;transition:.1s}.${def.class.range}>input::-ms-thumb{appearance:none;border:none;height:var(--thumb-size);width:var(--thumb-size);transform:var(--thumb-transform);border-radius:var(--thumb-radius,50%);background:var(--thumb-color);box-shadow:var(--thumb-shadow);pointer-events:auto;transition:.1s}` +
`.${def.class.range}>input:hover{--thumb-shadow:var(--thumb-shadow-active)}.${def.class.range}>input:hover+output{--value-background:var(--value-background-hover);--y-offset:-1px;color:var(--value-active-color);box-shadow:0 0 0 3px var(--value-background)}.${def.class.range}>input:active{--thumb-shadow:var(--thumb-shadow-hover);cursor:grabbing;z-index:2}.${def.class.range}>input:active+output{transition:0s;opacity:0.9;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-pack:center;-webkit-box-align:center;-moz-box-orient:horizontal;-moz-box-pack:center;-moz-box-align:center}.${def.class.range}>input:nth-of-type(1){--is-left-most:Clamp(0, (var(--value-a) - var(--value-b)) * 99999, 1)}.${def.class.range}>input:nth-of-type(1)+output{--value:var(--value-a);--x-offset:calc(var(--completed-a) * -1%)}.${def.class.range}>input:nth-of-type(1)+output:not(:only-of-type){--flip:calc(var(--thumbs-too-close) * -1)}.${def.class.range}>input:nth-of-type(1)+output::after{content:var(--prefix, "") var(--text-value-a) var(--suffix, "")}.${def.class.range}>input:nth-of-type(2){--is-left-most:Clamp(0, (var(--value-b) - var(--value-a)) * 99999, 1)}.${def.class.range}>input:nth-of-type(2)+output{--value:var(--value-b)}.${def.class.range}>input+output{--flip:-1;--x-offset:calc(var(--completed-b) * -1%);--pos:calc(((var(--value) - var(--min)) / (var(--max) - var(--min))) * 100%);pointer-events:none;width:auto;min-width:40px;height:24px;min-height:24px;text-align:center;position:absolute;z-index:5;background:var(--value-background);border-radius:4px;padding:0 6px;left:var(--pos);transform:translate(var(--x-offset),calc(150% * var(--flip) - (var(--y-offset,0) + var(--value-offset-y)) * var(--flip)));transition:all .12s ease-out,left 0s;opacity:0;box-sizing:content-box}.${def.class.range}>input+output::after{content:var(--prefix, "") var(--text-value-b) var(--suffix, "");font:var(--value-font)}`
),
};
const fullStyle = (b, c) => `${def.const.style.mainStyle};background-color:${b};color:${c};border-radius:4px;padding:4px 8px`;
const leftStyle = b => `${def.const.style.mainStyle};background-color:${b};color:snow;border-radius:4px 0 0 4px;padding:4px 2px 4px 8px`;
const rightStyle = b => `${def.const.style.mainStyle};background-color:${b};color:snow;font-style:italic;border-radius:0 4px 4px 0;padding:4px 8px 4px 4px;margin:0 0 0 -2px`;
const remarkStyle = c => `${def.const.style.mainStyle};color:${c};padding:4px 0;line-height:120%`;
/* REGISTER_LOAD_EVENT_CLASS */
class RegisterEvents {
constructor() {
this.fns = [];
this.finalfns = [];
this.done = false;
this.__register();
document.addEventListener("readystatechange", () => this.__checkReadyState());
}
__runFns(fns, background) {
let run = 0;
let err = 0;
for (let fn of fns) {
try {
fn();
run++;
} catch (e) {
ERROR("RegisterEvents.runFns:", e.message);
err++;
}
}
this.__onReady(background, run, err, document.readyState);
}
__register() {
if (this.done) return;
if (IS_GREASEMONKEY) {
w.onload = () => this.runFns(this.fns, "darkorange");
this.done = true;
return;
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => this.__runFns(this.fns, "slateblue"));
} else {
w.addEventListener("load", () => this.__runFns(this.fns, "darkorange"));
}
this.done = true;
}
__checkReadyState() {
if (!this.done || document.readyState !== "complete") return;
this.__runFns(this.finalfns, "green");
}
__onReady(background, ...logs) {
const args = [leftStyle(background), rightStyle(background), "display:block;height:0", remarkStyle("0"), remarkStyle("grey")];
INFO(`%c[DOM.STATE]:%c${logs}!%c\r\n%c \u3000\u27A6${IS_IN_FRAMES} ${CUR_HOST_NAME} %c${CUR_HOST_PATH}`, ...args);
}
addFn(fn) {
if (typeof fn !== "function") return;
this.fns.push(fn);
}
addFinalFn(fn) {
if (typeof fn !== "function") return;
this.finalfns.push(fn);
}
}
/* FR_DIALOGBOX_CLASS */
class FrDialogBox {
constructor({ titleText = "Test", messageText = "Test message.", trueButtonText = "OK", falseButtonText = null, neutralButtonText = null } = {}) {
this.css = def.const.zoomCssText("fr-dialogbox") + def.const.style.frDialogBox;
this.titleText = titleText;
this.messageText = messageText;
this.trueButtonText = trueButtonText;
this.falseButtonText = falseButtonText;
this.neutralButtonText = neutralButtonText;
this.hasFalse = falseButtonText !== null;
this.hasNeutral = neutralButtonText !== null;
this.frDialog = undefined;
this.trueButton = undefined;
this.falseButton = undefined;
this.neutralButton = undefined;
this.parent = document.body;
this.__create(this);
this.__append();
}