-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path469878-youtube-chat.js
12269 lines (9365 loc) · 438 KB
/
469878-youtube-chat.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 YouTube Super Fast Chat
// @version 0.68.2
// @license MIT
// @name:ja YouTube スーパーファーストチャット
// @name:zh-TW YouTube 超快聊天
// @name:zh-CN YouTube 超快聊天
// @icon https://raw.githubusercontent.com/cyfung1031/userscript-supports/main/icons/super-fast-chat.png
// @namespace UserScript
// @match https://www.youtube.com/live_chat*
// @match https://www.youtube.com/live_chat_replay*
// @author CY Fung
// @run-at document-start
// @grant none
// @unwrap
// @allFrames true
// @inject-into page
// @require https://update.greasyfork.org/scripts/475632/1361351/ytConfigHacks.js
//
// @compatible firefox Violentmonkey
// @compatible firefox Tampermonkey
// @compatible firefox FireMonkey
// @compatible chrome Violentmonkey
// @compatible chrome Tampermonkey
// @compatible opera Violentmonkey
// @compatible opera Tampermonkey
// @compatible safari Stay
// @compatible edge Violentmonkey
// @compatible edge Tampermonkey
// @compatible brave Violentmonkey
// @compatible brave Tampermonkey
//
// @description Ultimate Performance Boost for YouTube Live Chats
// @description:ja YouTubeのライブチャットの究極のパフォーマンスブースト
// @description:zh-TW YouTube直播聊天的終極性能提升
// @description:zh-CN YouTube直播聊天的终极性能提升
//
// ==/UserScript==
((__CONTEXT__) => {
'use strict';
/** @type {WeakMapConstructor} */
const WeakMap = window.WeakMapOriginal || window.WeakMap;
const DEBUG_LOG_GROUP_EXPAND = +localStorage.__debugSuperFastChat__ > 0;
const DEBUG_LOG_HIDE_OK = true;
const DEBUG_skipLog001 = true;
const DEBUG_preprocessChatLiveActions = false;
const DEBUG_customCreateComponent = false;
// const SHOW_DEVTOOL_DEBUG = true; // for debug use
const SHOW_DEVTOOL_DEBUG = typeof ResizeObserver === 'function' && CSS.supports('position-area:center');
// *********** DON'T REPORT NOT WORKING DUE TO THE CHANGED SETTINGS ********************
// The settings are FIXED! You might change them to try but if the script does not work due to your change, please, don't report them as issues
const ENABLE_REDUCED_MAXITEMS_FOR_FLUSH = true; // TRUE to enable trimming down to MAX_ITEMS_FOR_FULL_FLUSH (25) messages when there are too many unrendered messages
const MAX_ITEMS_FOR_TOTAL_DISPLAY = 90; // By default, 250 latest messages will be displayed, but displaying MAX_ITEMS_FOR_TOTAL_DISPLAY (90) messages is already sufficient. (not exceeding 900)
const MAX_ITEMS_FOR_FULL_FLUSH = 25; // If there are too many new (stacked) messages not yet rendered, clean all and flush MAX_ITEMS_FOR_FULL_FLUSH (25) latest messages then incrementally added back to MAX_ITEMS_FOR_TOTAL_DISPLAY (90) messages. (not exceeding 900)
const ENABLE_NO_SMOOTH_TRANSFORM = true; // Depends on whether you want the animation effect for new chat messages <<< DON'T CHANGE >>>
const USE_OPTIMIZED_ON_SCROLL_ITEMS = true; // TRUE for the majority
const ENABLE_OVERFLOW_ANCHOR_PREFERRED = true; // Enable `overflow-anchor: auto` to lock the scroll list at the bottom for no smooth transform.
const FIX_SHOW_MORE_BUTTON_LOCATION = true; // When there are voting options (bottom panel), move the "show more" button to the top.
const FIX_INPUT_PANEL_OVERFLOW_ISSUE = true; // When the super chat button is flicking with color, the scrollbar might come out.
const FIX_INPUT_PANEL_BORDER_ISSUE = true; // No border should be allowed if there is an empty input panel.
const SET_CONTAIN_FOR_CHATROOM = true; // Rendering hacks (`contain`) for chatroom elements. [ General ]
const FORCE_CONTENT_VISIBILITY_UNSET = true; // Content-visibility should be always VISIBLE for high performance and great rendering.
const FORCE_WILL_CHANGE_UNSET = true; // Will-change should be always UNSET (auto) for high performance and low energy impact.
// Replace requestAnimationFrame timers with custom implementation
const ENABLE_RAF_HACK_TICKERS = true; // When there is a ticker
const ENABLE_RAF_HACK_DOCKED_MESSAGE = true; // To be confirmed
const ENABLE_RAF_HACK_INPUT_RENDERER = true; // To be confirmed
const ENABLE_RAF_HACK_EMOJI_PICKER = true; // When changing the page of the emoji picker
// Force rendering all the character subsets of the designated font(s) before messages come (Pre-Rendering of Text)
const ENABLE_FONT_PRE_RENDERING_PREFERRED = 1 | 2 | 4 | 8 | 16;
// Backdrop `filter: blur(4px)` inside the iframe can extend to the whole page, causing a negative visual impact on the video you are watching.
const NO_BACKDROP_FILTER_WHEN_MENU_SHOWN = true;
// Data Manipulation for Participants (Participant List)
// << if DO_PARTICIPANT_LIST_HACKS >>
const DO_PARTICIPANT_LIST_HACKS = true; // TRUE for the majority
const SHOW_PARTICIPANT_CHANGES_IN_CONSOLE = false; // Just too annoying to show them all in popular chat
const CHECK_CHANGE_TO_PARTICIPANT_RENDERER_CONTENT = true; // Only consider changes in renderable content (not concerned with the last chat message of the participants)
const PARTICIPANT_UPDATE_ONLY_ONLY_IF_MODIFICATION_DETECTED = true;
// << end >>
// show more button
const ENABLE_SHOW_MORE_BLINKER = true; // BLINK WHEN NEW MESSAGES COME
// faster stampDomArray_ for participants list creation
const ENABLE_FLAGS_MAINTAIN_STABLE_LIST_VAL = 1; // 0 - OFF; 1 - ON; 2 - ON(PARTICIPANTS_LIST ONLY)
const USE_MAINTAIN_STABLE_LIST_ONLY_WHEN_KS_FLAG_IS_SET = false;
// reuse yt components
const ENABLE_FLAGS_REUSE_COMPONENTS = true;
// ShadyDom Free is buggy
const DISABLE_FLAGS_SHADYDOM_FREE = true;
// images <Group#I01>
const AUTHOR_PHOTO_SINGLE_THUMBNAIL = 1; // 0 - disable; 1- smallest; 2- largest
const EMOJI_IMAGE_SINGLE_THUMBNAIL = 1; // 0 - disable; 1- smallest; 2- largest
const LEAST_IMAGE_SIZE = 48; // minium size = 48px
const DO_LINK_PREFETCH = true; // DO NOT CHANGE
// << if DO_LINK_PREFETCH >>
const ENABLE_BASE_PREFETCHING = true; // (SUB-)DOMAIN | dns-prefetch & preconnect
const ENABLE_PRELOAD_THUMBNAIL = true; // subresource (prefetch) [LINK for Images]
const SKIP_PRELOAD_EMOJI = true;
const PREFETCH_LIMITED_SIZE_EMOJI = 512; // DO NOT CHANGE THIS
const PREFETCH_LIMITED_SIZE_AUTHOR_PHOTO = 68; // DO NOT CHANGE THIS
// << end >>
const FIX_SETSRC_AND_THUMBNAILCHANGE_ = true; // Function Replacement for yt-img-shadow....
const FIX_THUMBNAIL_DATACHANGED = true; // Function Replacement for yt-live-chat-author-badge-renderer..dataChanged
// const REMOVE_PRELOADAVATARFORADDACTION = false; // Function Replacement for yt-live-chat-renderer..preloadAvatarForAddAction
const FIX_THUMBNAIL_SIZE_ON_ITEM_ADDITION = true; // important [depends on <Group#I01>]
const FIX_THUMBNAIL_SIZE_ON_ITEM_REPLACEMENT = true; // [depends on <Group#I01>]
// BROWSER SUPPORT: Chrome 75+, Edge 79+, Safari 13.1+, Firefox 63+, Opera 62+
const TICKER_MAX_STEPS_LIMIT = 500; // NOT LESS THAN 5 STEPS!!
// (( KEEP AS ALTERNATIVE IF USE_ADVANCED_TICKING NOT WORKING ))
// [limiting 500 max steps] is recommended for "confortable visual change"
// min. step increment 0.2% => max steps: 500 => 800ms per each update
// min. step increment 0.5% => max steps: 200 => 1000ms per each update
// min. step increment 1.0% => max steps: 100 => 1000ms per each update
// min. step increment 2.5% => max steps: 40 => 1000ms per each update
// min. step increment 5.0% => max steps: 20 => 1250ms per each update
const ENABLE_VIDEO_PLAYBACK_PROGRESS_STATE_FIX = true; // for video playback's ticker issue. [ Playback Replay - Pause at Middle - Backwards Seeking ]
const SKIP_VIDEO_PLAYBACK_PROGRESS_STATE_FIX_FOR_NO_TIMEFX = false; // debug use; yt-live-chat-ticker-renderer might not require ENABLE_VIDEO_PLAYBACK_PROGRESS_STATE_FIX
// << end >>
const FIX_TOOLTIP_DISPLAY = true; // changed in 2024.05.02; updated in 2025.01.10
const USE_VANILLA_DEREF = true;
const FIX_DROPDOWN_DERAF = true; // DONT CHANGE
const CACHE_SHOW_CONTEXT_MENU_FOR_REOPEN = true; // cache the menu data and used for the next reopen
const ADVANCED_NOT_ALLOW_SCROLL_FOR_SHOW_CONTEXT_MENU = false; // pause auto scroll faster when the context menu is about to show
const ENABLE_MUTEX_FOR_SHOW_CONTEXT_MENU = true; // avoid multiple requests on the same time
const BOOST_MENU_OPENCHANGED_RENDERING = true;
const FIX_CLICKING_MESSAGE_MENU_DISPLAY_ON_MOUSE_CLICK = true; // click again = close
const NO_ITEM_TAP_FOR_NON_STATIONARY_TAP = true; // dont open the menu (e.g. text message) if cursor is moved or long press
const TAP_ACTION_DURATION = 280; // exceeding 280ms would not consider as a tap action
const PREREQUEST_CONTEXT_MENU_ON_MOUSE_DOWN = true; // require CACHE_SHOW_CONTEXT_MENU_FOR_REOPEN = true
// const FIX_MENU_CAPTURE_SCROLL = true;
const CHAT_MENU_REFIT_ALONG_SCROLLING = 0; // 0 for locking / default; 1 for unlocking only; 2 for unlocking and refit
const RAF_FIX_keepScrollClamped = true;
const RAF_FIX_scrollIncrementally = 2; // 0: no action; 1: basic fix; 2: also fix scroll position
// << if BOOST_MENU_OPENCHANGED_RENDERING >>
const FIX_MENU_POSITION_N_SIZING_ON_SHOWN = 1; // correct size and position when the menu dropdown opens
const CHECK_JSONPRUNE = true; // This is a bug in Brave
// << end >>
// const LIVE_CHAT_FLUSH_ON_FOREGROUND_ONLY = false;
const CHANGE_MANAGER_UNSUBSCRIBE = true;
const INTERACTIVITY_BACKGROUND_ANIMATION = 1; // mostly for pinned message
// 0 = default Yt animation background [= no fix];
// 1 = disable default animation background [= keep special animation];
// 2 = disable all animation backgrounds [= no animation backbround]
const CLOSE_TICKER_PINNED_MESSAGE_WHEN_HEADER_CLICKED = true;
const MAX_TOOLTIP_NO_WRAP_WIDTH = '72vw'; // '' for disable; accept values like '60px', '25vw'
const USE_ADVANCED_TICKING = true; // added in Dec 2024 v0.66.0; need to ensure it would not affect the function if ticker design changed. to be reviewed
// << if USE_ADVANCED_TICKING >>
const FIX_TIMESTAMP_FOR_REPLAY = true;
const ATTEMPT_TICKER_ANIMATION_START_TIME_DETECTION = true; // MUST BE true
const REUSE_TICKER = true; // for better memory control; currently it is only available in ADVANCED_TICKING; to be further reviewed
// << end >>
const DISABLE_Translation_By_Google = true;
const FASTER_ICON_RENDERING = true;
const DELAY_FOCUSEDCHANGED = true;
const skipErrorForhandleAddChatItemAction_ = true; // currently depends on ENABLE_NO_SMOOTH_TRANSFORM
const fixChildrenIssue801 = true; // if __children801__ is set [fix polymer controller method extration for `.set()`]
const SUPPRESS_refreshOffsetContainerHeight_ = true; // added in FEB 2024; true for default layout options; no effect if ENABLE_NO_SMOOTH_TRANSFORM is false
const NO_FILTER_DROPDOWN_BORDER = true; // added in 2024.03.02
const FIX_ANIMATION_TICKER_TEXT_POSITION = true; // CSS fix; experimental; added in 2024.04.07
const FIX_AUTHOR_CHIP_BADGE_POSITION = true;
const FIX_ToggleRenderPolymerControllerExtractionBug = false; // to be reviewed
const REACTION_ANIMATION_PANEL_CSS_FIX = true;
const FIX_UNKNOWN_BUG_FOR_OVERLAY = true; // no .prepare() in backdrop element. reason is unknown.
const FIX_MOUSEOVER_FN = true; // avoid onMouseOver_ being triggerd quite a lot
// -------------------------------
const USE_OBTAIN_LCR_BY_BOTH_METHODS = false; // true for play safe
const FIX_MEMORY_LEAKAGE_TICKER_ACTIONMAP = true; // To fix Memory Leakage in yt-live-chat-ticker-...-item-renderer
const FIX_MEMORY_LEAKAGE_TICKER_STATSBAR = true; // To fix Memory Leakage in updateStatsBarAndMaybeShowAnimation
const FIX_MEMORY_LEAKAGE_TICKER_TIMER = true; // To fix Memory Leakage in setContainerWidth, slideDown, collapse // Dec 2024 fix in advance tickering
const FIX_MEMORY_LEAKAGE_TICKER_DATACHANGED_setContainerWidth = true; // To fix Memory Leakage due to _.ytLiveChatTickerItemBehavior.setContainerWidth()
const USE_RM_ON_FOUNTAIN_MODEL = true;
const DEBUG_RM_ON_FOUNTAIN_MODEL = false;
const FOUNTAIN_MODEL_TIME_CONFIRM = 1600; // 800 not sufficient; re-adding?
const MODIFY_EMIT_MESSAGES_FOR_BOOST_CHAT = true; // enabled for boost chat only; instant emit & no background flush
/**
*
*
*
*
*
rendererStamperObserver_: function(a, b, c) {
if (c.path == a) {
if (c.value === void 0 && !this.hasDataPath_[a])
return;
this.hasDataPath_[a] = c.value !== void 0
}
this.rendererStamperApplyChangeRecord_(a, b, c)
},
addStampDomObserverFns_: function() {
for (var a in this.stampDom) {
var b = this.stampDom[a];
b.id ? (this[SQa(b.id)] = this.rendererStamperObserver_.bind(this, a, b.id),
this.hasDataPath_[a] = !1) : Er(new Dn("Bad rendererstamper config",this.is + ":" + a))
}
},
*
*
*
*
*
*/
// <<<<< FOR MEMORY LEAKAGE >>>>
// ========= EXPLANTION FOR 0.2% @ step timing [min. 0.2%] ===========
/*
### Time Approach
// all below values can make the time interval > 250ms
// 250ms (practical value) refers to the minimum frequency for timeupdate in most browsers (typically, shorter timeupdate interval in modern browsers)
if (totalDuration > 400000) stepInterval = 0.2; // 400000ms with 0.2% increment => 800ms
else if (totalDuration > 200000) stepInterval = 0.5; // 200000ms with 0.5% increment => 1000ms
else if (totalDuration > 100000) stepInterval = 1; // 100000ms with 1% increment => 1000ms
else if (totalDuration > 50000) stepInterval = 2; // 50000ms with 2% increment => 1000ms
else if (totalDuration > 25000) stepInterval = 5; // 25000ms with 5% increment => 1250ms
### Pixel Check
// Target Max Pixel Increment < 5px for Short Period Ticker (Rapid Background Change)
// Assume total width <= 99px for short period ticker, like small donation & member welcome
99px * 5% = 4.95px < 5px [Condition Fulfilled]
### Example - totalDuration = 280000
totalDuration 280000
stepInterval 0.5
numOfSteps = Math.round(100 / stepInterval) = 200
time interval = 280000 / 200 = 1400ms <acceptable>
### Example - totalDuration = 18000
totalDuration 18000
stepInterval 5
numOfSteps = Math.round(100 / stepInterval) = 20
time interval = 18000 / 20 = 900ms <acceptable>
### Example - totalDuration = 5000
totalDuration 5000
stepInterval 5
numOfSteps = Math.round(100 / stepInterval) = 20
time interval = 5000 / 20 = 250ms <threshold value>
### Example - totalDuration = 3600
totalDuration 3600
stepInterval 5
numOfSteps = Math.round(100 / stepInterval) = 20
time interval = 3600 / 20 = 180ms <reasonable for 3600ms ticker>
*/
// =======================================================================================================
// AUTOMAICALLY DETERMINED
const ENABLE_FLAGS_MAINTAIN_STABLE_LIST = ENABLE_FLAGS_MAINTAIN_STABLE_LIST_VAL === 1;
const ENABLE_FLAGS_MAINTAIN_STABLE_LIST_FOR_PARTICIPANTS_LIST = ENABLE_FLAGS_MAINTAIN_STABLE_LIST_VAL >= 1;
const CHAT_MENU_SCROLL_UNLOCKING = CHAT_MENU_REFIT_ALONG_SCROLLING >= 1;
// image sizing code
// (d = (d = KC(a.customThumbnail.thumbnails, 16)) ? lc(oc(d)) : null)
// function KC(a, b, c, d) {
// d = void 0 === d ? "width" : d;
// if (!a || !a.length)
// return null;
// if (z("kevlar_tuner_should_always_use_device_pixel_ratio")) {
// var e = window.devicePixelRatio;
// z("kevlar_tuner_should_clamp_device_pixel_ratio") ? e = Math.min(e, zl("kevlar_tuner_clamp_device_pixel_ratio")) : z("kevlar_tuner_should_use_thumbnail_factor") && (e = zl("kevlar_tuner_thumbnail_factor"));
// HC = e
// } else
// HC || (HC = window.devicePixelRatio);
// e = HC;
// z("kevlar_tuner_should_always_use_device_pixel_ratio") ? b *= e : 1 < e && (b *= e);
// if (z("kevlar_tuner_min_thumbnail_quality"))
// return a[0].url || null;
// e = a.length;
// if (z("kevlar_tuner_max_thumbnail_quality"))
// return a[e - 1].url || null;
// if (c)
// for (var h = 0; h < e; h++)
// if (0 <= a[h].url.indexOf(c))
// return a[h].url || null;
// for (c = 0; c < e; c++)
// if (a[c][d] >= b)
// return a[c].url || null;
// for (b = e - 1; 0 < b; b--)
// if (a[b][d])
// return a[b].url || null;
// return a[0].url || null
// }
/// ------
// https://www.youtube.com/watch?v=byyvH5t0hKc
// yt-live-chat-ticker-creator-goal-view-model
// no ticker effect on timing
/*
{
"id": "ChwKGkNQS0pyNV9NdG9vREZVYlB6Z2FkRHWFUv2E",
"initialTickerText": {
"content": "Goal",
"styleRuns": [
{
"startIndex": 0,
"length": 4
}
]
},
"tickerIcon": {
"sources": [
{
"clientResource": {
"imageName": "TARGET_ADD"
}
}
]
},
"showGoalStatusCommand": {
"innertubeCommand": {
"clickTrackingParams": "CCQQ7NANIhMI58DT_ef5rhMVxMW1Cx4qBzTz",
"showEngagementPanelEndpoint": {
"engagementPanel": {
"engagementPanelSectionListRenderer": {
"header": {
"engagementPanelTitleHeaderRenderer": {
"actionButton": {
"buttonRenderer": {
"icon": {
"iconType": "QUESTION_CIRCLE"
},
"trackingParams": "CCgQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"command": {
"clickTrackingParams": "CCgQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"commandExecutorCommand": {
"commands": [
{
"clickTrackingParams": "CCgQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"liveChatDialogEndpoint": {
"content": {
"liveChatDialogRenderer": {
"trackingParams": "CCkQzS8iEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"title": {
"runs": [
{
"text": "Super Chat Goal"
}
]
},
"dialogMessages": [
{
"runs": [
{
"text": "Join the fun by participating in the goal! "
},
{
"text": "Learn more.\n",
"navigationEndpoint": {
"clickTrackingParams": "CCkQzS8iEwjm0Iz72rbKBxXT1EQBJekHNQM="
}
}
]
},
{
"runs": [
{
"text": "How to participate",
"bold": true,
"textColor": 4294967295
},
{
"text": "\n"
},
{
"text": "1. Press \"Continue\"\n2. Purchase a Super Chat \n3. Watch the progress towards the goal\n4. Celebrate achieving it with the community!",
"textColor": 4294967295
}
]
}
],
"confirmButton": {
"buttonRenderer": {
"style": "STYLE_MONO_FILLED",
"size": "SIZE_DEFAULT",
"isDisabled": false,
"text": {
"simpleText": "Got it"
},
"trackingParams": "CCoQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"accessibilityData": {
"accessibilityData": {
"label": "Got it"
}
}
}
}
}
}
}
},
{
"clickTrackingParams": "CCgQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"hideEngagementPanelEndpoint": {
"identifier": {
"surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
"tag": "creator_goal_progress_engagement_panel"
}
}
}
]
}
}
}
},
"trackingParams": "CCUQ040EIhMI58DT_ef5rhMVxMW1Cx4qBzTz"
}
},
"content": {
"sectionListRenderer": {
"contents": [
{
"creatorGoalProgressFlowViewModel": {
"creatorGoalEntityKey": "EgtieXl2SDV0MGhLYyG7BzhF",
"progressFlowButton": {
"buttonViewModel": {
"onTap": {
"innertubeCommand": {
"clickTrackingParams": "CCcQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"commandMetadata": {
"webCommandMetadata": {
"ignoreNavigation": true
}
},
"liveChatPurchaseMessageEndpoint": {
"params": "Q2lrcUp3b1lWVU14ZFdObmIwTmZjMGQzZDE5RmRYVTFhVTF4Y0ZGM0VndGllWGwyU0RWME1HaExZeEFCSUFFNEFFSUNDQUUlM0Q="
}
}
},
"style": "BUTTON_VIEW_MODEL_STYLE_MONO",
"trackingParams": "CCcQ8FsiEwjm0Iz72rbKBxXT1EQBJekHNQM=",
"type": "BUTTON_VIEW_MODEL_TYPE_FILLED",
"titleFormatted": {
"content": "Continue",
"styleRuns": [
{
"startIndex": 0,
"length": 8
}
]
}
}
},
"progressCountA11yLabel": "Super Chat goal progress: $0 out of $1"
}
}
],
"trackingParams": "CCYQui8iEwjm0Iz72rbKBxXT1EQBJekHNQM="
}
},
"identifier": {
"surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
"tag": "creator_goal_progress_engagement_panel"
}
}
},
"identifier": {
"surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
"tag": "creator_goal_progress_engagement_panel"
},
"engagementPanelPresentationConfigs": {
"engagementPanelPopupPresentationConfig": {
"popupType": "PANEL_POPUP_TYPE_DIALOG"
}
}
}
}
},
"creatorGoalEntityKey": "EgtieXl2SDV0MGhLYyG7BzhF",
"shouldShowSetUpFlowOnMobile": true,
"a11yLabel": "See Super Chat goal",
"loggingDirectives": {
"trackingParams": "CCQQ7NANIhMI58DT_ef5rhMVxMW1Cx4qBzTz",
"visibility": {
"types": "12"
}
}
}
*/
// ------
const { IntersectionObserver } = __CONTEXT__;
let _x69;
try {
_x69 = document.createAttributeNS("http://www.w3.org/2000/svg", "nil").addEventListener;
} catch (e) { }
const pureAddEventListener = _x69;
if (!pureAddEventListener) return console.warn("pureAddEventListener cannot be obtained.");
/** @type {globalThis.PromiseConstructor} */
const Promise = (async () => { })().constructor; // YouTube hacks Promise in WaterFox Classic and "Promise.resolve(0)" nevers resolve.
const [setTimeout_] = [setTimeout];
// let jsonParseFix = null;
if (!IntersectionObserver) return console.warn("Your browser does not support IntersectionObserver.\nPlease upgrade to the latest version.");
if (typeof WebAssembly !== 'object') return console.warn("Your browser is too old.\nPlease upgrade to the latest version."); // for passive and once
if (typeof CSS === 'undefined' || typeof (CSS || 0).supports !== 'function' || !CSS.supports('left', 'clamp(-100%, calc( -100% * 0.5 ), 0%)')) {
return console.warn("Your browser is too old.\nPlease upgrade to the latest version."); // for advanced tickering
}
// necessity of cssText3_smooth_transform_position to be checked.
const cssText3_smooth_transform_position = ENABLE_NO_SMOOTH_TRANSFORM ? `
#item-offset.style-scope.yt-live-chat-item-list-renderer > #items.style-scope.yt-live-chat-item-list-renderer {
position: static !important;
}
`: '';
// fallback if dummy style fn fails
const cssText4_smooth_transform_forced_props = ENABLE_NO_SMOOTH_TRANSFORM ? `
/* optional */
#item-offset.style-scope.yt-live-chat-item-list-renderer {
height: auto !important;
min-height: unset !important;
}
#items.style-scope.yt-live-chat-item-list-renderer {
transform: translateY(0px) !important;
}
/* optional */
`: '';
const cssText5 = SET_CONTAIN_FOR_CHATROOM ? `
/* ------------------------------------------------------------------------------------------------------------- */
yt-live-chat-author-chip #chat-badges.yt-live-chat-author-chip, yt-live-chat-author-chip #chat-badges.yt-live-chat-author-chip yt-live-chat-author-badge-renderer, yt-live-chat-author-chip #chat-badges.yt-live-chat-author-chip yt-live-chat-author-badge-renderer #image, yt-live-chat-author-chip #chat-badges.yt-live-chat-author-chip yt-live-chat-author-badge-renderer #image img {
contain: layout style;
}
#items.style-scope.yt-live-chat-item-list-renderer {
contain: layout paint style;
}
#item-offset.style-scope.yt-live-chat-item-list-renderer {
contain: style;
}
#item-scroller.style-scope.yt-live-chat-item-list-renderer {
contain: size style;
}
#contents.style-scope.yt-live-chat-item-list-renderer, #chat.style-scope.yt-live-chat-renderer, img.style-scope.yt-img-shadow[width][height] {
contain: size layout paint style;
}
.style-scope.yt-live-chat-ticker-renderer[role="button"][aria-label], .style-scope.yt-live-chat-ticker-renderer[role="button"][aria-label] > #container {
contain: layout paint style;
}
yt-live-chat-text-message-renderer.style-scope.yt-live-chat-item-list-renderer, yt-live-chat-membership-item-renderer.style-scope.yt-live-chat-item-list-renderer, yt-live-chat-paid-message-renderer.style-scope.yt-live-chat-item-list-renderer, yt-live-chat-banner-manager.style-scope.yt-live-chat-item-list-renderer {
contain: layout style;
}
tp-yt-paper-tooltip[style*="inset"][role="tooltip"] {
contain: layout paint style;
}
/* ------------------------------------------------------------------------------------------------------------- */
` : '';
const cssText6b_show_more_button = FIX_SHOW_MORE_BUTTON_LOCATION ? `
yt-live-chat-renderer[has-action-panel-renderer] #show-more.yt-live-chat-item-list-renderer{
top: 4px;
transition-property: top;
bottom: unset;
}
yt-live-chat-renderer[has-action-panel-renderer] #show-more.yt-live-chat-item-list-renderer[disabled]{
top: -42px;
}
`: '';
const cssText6c_input_panel_overflow = FIX_INPUT_PANEL_OVERFLOW_ISSUE ? `
#input-panel #picker-buttons yt-live-chat-icon-toggle-button-renderer#product-picker {
contain: layout style;
}
#chat.yt-live-chat-renderer ~ #panel-pages.yt-live-chat-renderer {
overflow: visible;
}
`: '';
const cssText6d_input_panel_border = FIX_INPUT_PANEL_BORDER_ISSUE ? `
html #panel-pages.yt-live-chat-renderer > #input-panel.yt-live-chat-renderer:not(:empty) {
--yt-live-chat-action-panel-top-border: none;
}
html #panel-pages.yt-live-chat-renderer > #input-panel.yt-live-chat-renderer.iron-selected > *:first-child {
border-top: 1px solid var(--yt-live-chat-panel-pages-border-color);
}
html #panel-pages.yt-live-chat-renderer {
border-top: 0;
border-bottom: 0;
}
`: '';
const cssText7b_content_visibility_unset = FORCE_CONTENT_VISIBILITY_UNSET ? `
img,
yt-img-shadow[height][width],
yt-img-shadow {
content-visibility: visible !important;
}
` : '';
const cssText7c_will_change_unset = FORCE_WILL_CHANGE_UNSET ? `
/* remove YouTube constant will-change */
/* constant value will slow down the performance; default auto */
/* www-player.css */
html .ytp-contextmenu,
html .ytp-settings-menu {
will-change: unset;
}
/* frequently matched elements */
html .fill.yt-interaction,
html .stroke.yt-interaction,
html .yt-spec-touch-feedback-shape__fill,
html .yt-spec-touch-feedback-shape__stroke {
will-change: unset;
}
/* live_chat_polymer.js */
/*
html .toggle-button.tp-yt-paper-toggle-button,
html #primaryProgress.tp-yt-paper-progress,
html #secondaryProgress.tp-yt-paper-progress,
html #onRadio.tp-yt-paper-radio-button,
html .fill.yt-interaction,
html .stroke.yt-interaction,
html .yt-spec-touch-feedback-shape__fill,
html .yt-spec-touch-feedback-shape__stroke {
will-change: unset;
}
*/
/* desktop_polymer_enable_wil_icons.js */
/* html .fill.yt-interaction,
html .stroke.yt-interaction, */
html tp-yt-app-header::before,
html tp-yt-iron-list,
html #items.tp-yt-iron-list > *,
html #onRadio.tp-yt-paper-radio-button,
html .toggle-button.tp-yt-paper-toggle-button,
html ytd-thumbnail-overlay-toggle-button-renderer[use-expandable-tooltip] #label.ytd-thumbnail-overlay-toggle-button-renderer,
html #items.ytd-post-multi-image-renderer,
html #items.ytd-horizontal-card-list-renderer,
html #items.yt-horizontal-list-renderer,
html #left-arrow.yt-horizontal-list-renderer,
html #right-arrow.yt-horizontal-list-renderer,
html #items.ytd-video-description-infocards-section-renderer,
html #items.ytd-video-description-music-section-renderer,
html #chips.ytd-feed-filter-chip-bar-renderer,
html #chips.yt-chip-cloud-renderer,
html #items.ytd-merch-shelf-renderer,
html #items.ytd-product-details-image-carousel-renderer,
html ytd-video-preview,
html #player-container.ytd-video-preview,
html #primaryProgress.tp-yt-paper-progress,
html #secondaryProgress.tp-yt-paper-progress,
html ytd-miniplayer[enabled] /* ,
html .yt-spec-touch-feedback-shape__fill,
html .yt-spec-touch-feedback-shape__stroke */ {
will-change: unset;
}
/* other */
.ytp-videowall-still-info-content[class],
.ytp-suggestion-image[class] {
will-change: unset !important;
}
` : '';
const ENABLE_FONT_PRE_RENDERING = typeof HTMLElement.prototype.append === 'function' ? (ENABLE_FONT_PRE_RENDERING_PREFERRED || 0) : 0;
const cssText8_fonts_pre_render = ENABLE_FONT_PRE_RENDERING ? `
elzm-fonts {
visibility: collapse;
position: fixed;
top: -10px;
left: -10px;
font-size: 10pt;
line-height: 100%;
width: 100px;
height: 100px;
transform: scale(0.1);
transform: scale(0.01);
transform: scale(0.001);
transform-origin: 0 0;
contain: strict;
display: block;
pointer-events: none !important;
user-select: none !important;
}
elzm-fonts[id]#elzm-fonts-yk75g {
user-select: none !important;
pointer-events: none !important;
}
elzm-font {
visibility: collapse;
position: absolute;
line-height: 100%;
width: 100px;
height: 100px;
contain: strict;
display: block;
user-select: none !important;
pointer-events: none !important;
}
elzm-font::before {
visibility: collapse;
position: absolute;
line-height: 100%;
width: 100px;
height: 100px;
contain: strict;
display: block;
content: '0aZ!@#$~^&*()_-+[]{}|;:><?\\0460\\0301\\0900\\1F00\\0370\\0102\\0100\\28EB2\\28189\\26DA0\\25A9C\\249BB\\23F61\\22E8B\\21927\\21076\\2048E\\1F6F5\\FF37\\F94F\\F0B2\\9F27\\9D9A\\9BEA\\9A6B\\98EC\\9798\\9602\\949D\\9370\\926B\\913A\\8FA9\\8E39\\8CC1\\8B26\\8983\\8804\\8696\\8511\\83BC\\828D\\8115\\7F9A\\7E5B\\7D07\\7B91\\7A2C\\78D2\\776C\\7601\\74AA\\73B9\\7265\\70FE\\6FBC\\6E88\\6D64\\6C3F\\6A9C\\6957\\67FE\\66B3\\6535\\63F2\\628E\\612F\\5FE7\\5E6C\\5CEE\\5B6D\\5A33\\58BC\\575B\\5611\\54BF\\536E\\51D0\\505D\\4F22\\4AD1\\41DB\\3B95\\3572\\2F3F\\26FD\\25A1\\2477\\208D\\1D0A\\1FB\\A1\\A3\\B4\\2CB\\60\\10C\\E22\\A5\\4E08\\B0\\627\\2500\\5E\\201C\\3C\\B7\\23\\26\\3E\\D\\20\\25EE8\\1F235\\FFD7\\FA10\\F92D\\9E8B\\9C3E\\9AE5\\98EB\\971D\\944A\\92BC\\9143\\8F52\\8DC0\\8B2D\\8973\\87E2\\8655\\84B4\\82E8\\814A\\7F77\\7D57\\7BC8\\7A17\\7851\\768C\\7511\\736C\\7166\\6F58\\6D7C\\6B85\\69DD\\6855\\667E\\64D2\\62CF\\6117\\5F6C\\5D9B\\5BBC\\598B\\57B3\\5616\\543F\\528D\\50DD\\4F57\\4093\\3395\\32B5\\31C8\\3028\\2F14\\25E4\\24D1\\2105\\2227\\A8\\2D9\\2CA\\2467\\B1\\2020\\2466\\251C\\266B\\AF\\4E91\\221E\\2464\\2266\\2207\\4E32\\25B3\\2463\\2010\\2103\\3014\\25C7\\24\\25BD\\4E18\\2460\\21D2\\2015\\2193\\4E03\\7E\\25CB\\2191\\25BC\\3D\\500D\\4E01\\25\\30F6\\2605\\266A\\40\\2B\\4E16\\7C\\A9\\4E\\21\\1F1E9\\FEE3\\F0A7\\9F3D\\9DFA\\9C3B\\9A5F\\98C8\\972A\\95B9\\94E7\\9410\\92B7\\914C\\8FE2\\8E2D\\8CAF\\8B5E\\8A02\\8869\\86E4\\8532\\83B4\\82A9\\814D\\7FFA\\7ED7\\7DC4\\7CCC\\7BC3\\7ACA\\797C\\783E\\770F\\760A\\74EF\\73E7\\72DD\\719C\\7005\\6ED8\\6DC3\\6CB2\\6A01\\68E1\\6792\\663A\\64F8\\63BC\\623B\\60FA\\5FD1\\5EA3\\5D32\\5BF5\\5AB2\\5981\\5831\\570A\\5605\\5519\\53FB\\52A2\\5110\\4FE3\\4EB8\\3127\\279C\\2650\\254B\\23E9\\207B\\1D34\\2AE\\176\\221A\\161\\200B\\300C\\4E4C\\1F921\\FF78\\FA0A\\F78A\\9EB9\\9D34\\9BD3\\9A6F\\9912\\97C6\\964E\\950C\\93E4\\92E5\\91F0\\90BB\\8F68\\8E18\\8B6C\\89F6\\889B\\874C\\8602\\84B1\\8378\\826E\\8113\\7FB1\\7EAF\\7D89\\7C20\\7AFB\\7988\\7840\\7705\\75CC\\749A\\73B3\\727F\\7113\\6FE8\\6ED6\\6DD3\\6CDA\\6BBB\\6A31\\6900\\67D9\\66A7\\655D\\6427\\630D\\61C6\\60AC\\5F78\\5E34\\5CE0\\5B80\\5A51\\590B\\57A1\\566F\\5551\\543D\\52DB\\518F\\5032\\3A17\\305C\\2749\\264A\\2567\\2476\\2139\\1EC0\\11AF\\2C8\\1AF\\E17\\2190\\2022\\2502\\2312\\2025\\50';
user-select: none !important;
pointer-events: none !important;
}
`: '';
const cssText9_no_backdrop_filter_when_menu_shown = NO_BACKDROP_FILTER_WHEN_MENU_SHOWN ? `
tp-yt-iron-dropdown.yt-live-chat-app ytd-menu-popup-renderer {
-webkit-backdrop-filter: none;
backdrop-filter: none;
}
`: '';
const cssText10_show_more_blinker = ENABLE_SHOW_MORE_BLINKER ? `
@keyframes blinker-miuzp {
0%, 60%, 100% {
opacity: 1;
}
30% {
opacity: 0.6;
}
}
yt-icon-button#show-more.has-new-messages-miuzp {
animation: blinker-miuzp 1.74s linear infinite;
}
`: '';
const cssText11_entire_message_clickable = FIX_CLICKING_MESSAGE_MENU_DISPLAY_ON_MOUSE_CLICK ? `
yt-live-chat-paid-message-renderer.yt-live-chat-item-list-renderer[whole-message-clickable] #menu.style-scope[class] {
pointer-events: none !important;
}
yt-live-chat-membership-item-renderer.yt-live-chat-item-list-renderer[whole-message-clickable] #menu.style-scope[class] {
pointer-events: none !important;
}
yt-live-chat-paid-sticker-renderer.yt-live-chat-item-list-renderer[whole-message-clickable] #menu.style-scope[class] {
pointer-events: none !important;
}
yt-live-chat-text-message-renderer.yt-live-chat-item-list-renderer[whole-message-clickable] #menu.style-scope[class] {
pointer-events: none !important; /* TO_BE_REVIEWED */
}
yt-live-chat-auto-mod-message-renderer.yt-live-chat-item-list-renderer[whole-message-clickable] #menu.style-scope[class] {
pointer-events: none !important;
}
`: '';
const cssText12_nowrap_tooltip = MAX_TOOLTIP_NO_WRAP_WIDTH && typeof MAX_TOOLTIP_NO_WRAP_WIDTH === 'string' ? `
tp-yt-paper-tooltip[role="tooltip"] {
box-sizing: content-box !important;
margin: 0px !important;
padding: 0px !important;
contain: none !important;
}
tp-yt-paper-tooltip[role="tooltip"] #tooltip[style-target="tooltip"] {
box-sizing: content-box !important;
display: inline-block;
contain: none !important;
}
tp-yt-paper-tooltip[role="tooltip"] #tooltip[style-target="tooltip"]{
max-width: ${MAX_TOOLTIP_NO_WRAP_WIDTH};
width: max-content;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
`: '';
const cssText13_no_text_select_when_menu_visible = `
[menu-visible] {
--sfc47-text-select: none;
}
[menu-visible] #header[id][class],
[menu-visible] #content[id][class],
[menu-visible] #header[id][class] *,
[menu-visible] #content[id][class] * {
user-select: var(--sfc47-text-select) !important;
}
[menu-visible] #menu {
--sfc47-text-select: inherit;
}
`;
const cssText14_NO_FILTER_DROPDOWN_BORDER = NO_FILTER_DROPDOWN_BORDER ? `
yt-live-chat-header-renderer.yt-live-chat-renderer #label.yt-dropdown-menu::before {
border:0;
}
` : '';
const cssText15_FIX_ANIMATION_TICKER_TEXT_POSITION = FIX_ANIMATION_TICKER_TEXT_POSITION ? `
.style-scope.yt-live-chat-ticker-renderer #animation-container[id][class] {
position: relative;
display: grid;
grid-auto-columns: 1fr;
grid-auto-rows: 1fr;
grid-template-columns: repeat(1, 1fr);
gap: 7px;
padding-bottom: 0;
margin-bottom: 0;
padding-top: 0;
align-self: flex-start;
flex-wrap: nowrap;
margin-top: 1px;
}
.style-scope.yt-live-chat-ticker-renderer #animation-container > [id][class] {
margin-top: 0px;
margin-bottom: 0px;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
}
.style-scope.yt-live-chat-ticker-renderer #animation-container > [id][class]:first-child::after {
content: '補';
visibility: collapse;
display: inline-block;
position: relative;
width: 0;
line-height: 22px;
}
` : '';
const cssText16_FIX_AUTHOR_CHIP_BADGE_POSITION = FIX_AUTHOR_CHIP_BADGE_POSITION ? `
#card #author-name-chip > yt-live-chat-author-chip[single-line] {
flex-wrap: nowrap;
white-space: nowrap;
display: inline-flex;
flex-direction: row;
text-wrap: nowrap;
flex-shrink: 0;
align-items: center;
}
#card #author-name-chip {
display: inline-flex;
flex-direction: row;
align-items: flex-start;
}
`: '';
// Example: https://www.youtube.com/watch?v=Xfytz-igsuc
const cssText17_FIX_overwidth_banner_message = `
yt-live-chat-banner-manager#live-chat-banner.style-scope.yt-live-chat-item-list-renderer {
max-width: 100%;
box-sizing: border-box;
}
`;
const cssText18_REACTION_ANIMATION_PANEL_CSS_FIX = REACTION_ANIMATION_PANEL_CSS_FIX ? `
#reaction-control-panel-overlay[class] {
contain: strict;
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box;
will-change: initial;
}
#reaction-control-panel-overlay[class] *[class] {
will-change: initial;
}
`: '';