-
Notifications
You must be signed in to change notification settings - Fork 3
/
a-universal-script-to-re-enable-the-selection-and-copying.user.js
1885 lines (1540 loc) · 95.5 KB
/
a-universal-script-to-re-enable-the-selection-and-copying.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 Selection and Copying Restorer (Universal)
// @name:zh-TW Selection and Copying Restorer (Universal)
// @name:zh-CN 选择和复制还原器(通用)
// @version 1.21.0.2
// @description Unlock right-click, remove restrictions on copy, cut, select text, right-click menu, text copying, text selection, image right-click, and enhance functionality: Alt key hyperlink text selection.
// @namespace https://greasyfork.org/users/371179
// @author CY Fung
// @supportURL https://github.com/cyfung1031/userscript-supports
// @run-at document-start
// @match http://*/*
// @match https://*/*
// @exclude /^https?://\S+\.(txt|png|jpg|jpeg|gif|xml|svg|manifest|log|ini)[^\/]*$/
// @exclude https://github.dev/*
// @exclude https://vscode.dev/*
// @exclude https://www.photopea.com/*
// @exclude https://www.google.com/maps/*
// @exclude https://docs.google.com/*
// @exclude https://drive.google.com/*
// @exclude https://mail.google.com/*
// @exclude https://www.dropbox.com/*
// @exclude https://outlook.live.com/mail/*
// @exclude https://www.terabox.com/*
// @exclude https://leetcode.cn/*
// @icon https://raw.githubusercontent.com/cyfung1031/userscript-supports/main/icons/selection-copier.png
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @grant GM.setValue
// @grant GM.getValue
// @grant GM_addValueChangeListener
// @grant unsafeWindow
// @inject-into page
// @compatible firefox Violentmonkey
// @compatible firefox Tampermonkey
// @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:zh-TW 破解鎖右鍵,解除禁止復制、剪切、選擇文本、右鍵菜單、文字複製、文字選取、圖片右鍵等限制。增強功能:Alt鍵超連結文字選取。
// @description:zh-CN 破解锁右键,解除禁止复制、剪切、选择文本、右键菜单、文字复制、文字选取、图片右键等限制。增强功能:Alt键超连结文字选取。
// @description:ja 右クリックを解除し、コピー、切り取り、テキスト選択、コンテキストメニュー、テキストのコピー、テキストの選択、画像の右クリックなどの制限を解除します。機能の強化:Altキーでハイパーリンクテキストの選択ができます。
// @description:ko 우클릭 잠금 해제, 복사, 잘라내기, 텍스트 선택, 컨텍스트 메뉴, 텍스트 복사, 텍스트 선택, 이미지 우클릭 등의 제한을 해제합니다. 기능 강화: Alt 키로 하이퍼링크 텍스트 선택.
// @description:ru Взломать запрет правой кнопкой мыши, снять ограничения на копирование, вырезание, выбор текста, контекстное меню, копирование текста, выбор текста, правая кнопка мыши на изображении и т.д. Усиление функций: выбор текста гиперссылки с помощью клавиши Alt.
// @description:af Ontsloot regskliek, verwyder beperkings op kopieer, uitknip, teks selekteer, konteks-menu, teks kopieer, teks selekteer, prentjie regskliek, ensovoorts. Versterk funksie: Alt-sleutel vir skakelteks seleksie.
// @description:az Sağ klikkiləri açın, kopyala, kəs, mətn seçin, kontekst menyusu, mətni kopyalayın, mətni seçin, şəkil sağ klikk, kimi məhdudiyyətlərdən azad olun. Gücləndirilmiş funksiya: Alt düyməsi ilə hiperlink mətn seçimi.
// @description:id Buka blokir klik kanan, hapus pembatasan penyalinan, pemotongan, memilih teks, menu klik kanan, menyalin teks, memilih teks, klik kanan gambar, dan sebagainya. Peningkatan fitur: Pilih teks tautan dengan tombol Alt.
// @description:ms Buka kunci klik kanan, hapuskan sekatan salin, potong, pilih teks, menu klik kanan, salin teks, pilih teks, klik kanan imej, dan lain-lain. Tingkatkan ciri: Pilih teks pautan dengan tombol Alt.
// @description:bs Otključaj desni klik, ukloni ograničenja kopiranja, izrezivanja, odabira teksta, desni klik menija, kopiranja teksta, odabira teksta, desni klik na slici i tako dalje. Poboljšane funkcije: Odabir teksta hiperveze pomoću tipke Alt.
// @description:ca Desbloqueja el clic dret, elimina les restriccions de còpia, talla, selecció de text, menú contextual, còpia de text, selecció de text, clic dret a la imatge, i així successivament. Millora de funcionalitats: selecció de text d'enllaç amb la tecla Alt.
// @description:cs Odemkněte pravé tlačítko myši, odstraňte omezení kopírování, výstřižek, výběru textu, kontextového menu, kopírování textu, výběru textu, pravého tlačítka myši na obrázku atd. Vylepšené funkce: Výběr textu hypertextového odkazu pomocí klávesy Alt.
// @description:da Lås højreklik op, fjern begrænsninger for kopiering, klipning, tekstvalg, højreklikmenu, tekstkopiering, tekstvalg, højreklik på billede osv. Forbedrede funktioner: Vælg teksten af hyperlink ved hjælp af Alt-tasten.
// @description:de Entsperren Sie den Rechtsklick, entfernen Sie Einschränkungen für Kopieren, Ausschneiden, Textauswahl, Rechtsklickmenü, Textkopieren, Textauswahl, Rechtsklick auf ein Bild usw. Verbesserte Funktionen: Auswahl des Textes eines Hyperlinks mit der Alt-Taste.
// @description:et Vabastage paremklõps, eemaldage piirangud kopeerimisel, lõikamisel, teksti valimisel, paremklõpsumenüüs, teksti kopeerimisel, teksti valimisel, pildi paremklõpsamisel jne. Täiustatud funktsioonid: valige hüperlingi tekst Alt-klahviga.
// @description:es Desbloquear clic derecho, eliminar restricciones de copia, corte, selección de texto, menú contextual, copia de texto, selección de texto, clic derecho en imagen, etc. Mejora de funciones: selección de texto de hipervínculo con la tecla Alt.
// @description:eu Eskubiko klika desblokeatu, kopiatzearen murrizketak kentzen, ebakiak, testua hautatu, klik ezkerreko menua, testuaren kopia, testuaren hautapena, irudiko eskubiko klika, eta abar. Hobetu funtzioak: Hiperestekaren testu hautapena Alt tekla bidez.
// @description:fr Débloquez le clic droit, supprimez les restrictions de copie, de découpe, de sélection de texte, de menu clic droit, de copie de texte, de sélection de texte, de clic droit sur l'image, etc. Améliorez les fonctionnalités : Sélectionnez le texte du lien hypertexte avec la touche Alt.
// @description:gl Desbloquear o clic dereito, eliminar as restricións de copia, recorte, selección de texto, menú contextual, copia de texto, selección de texto, clic dereito na imaxe, etc. Mellora das funcións: Seleccione o texto do hipervínculo coa tecla Alt.
// @description:hr Otključajte desni klik, uklonite ograničenja kopiranja, izrezivanja, odabira teksta, desni klik izbornika, kopiranja teksta, odabira teksta, desni klik na slici itd. Poboljšane funkcije: Odaberite tekst hiperlinka pomoću tipke Alt.
// @description:zu Sushintsha isikhuthazo sangokucindezela, lungisa imilayezo yokuqhutshwa, ukuketha umfundi, imenyu yokuqhutshwa, ukukopisha umlayezo, ukukhetha umlayezo, uqhube ikhasi lokucindezelwa kwesithombe, noma kanye. Enhla kwezinhlelo: Khetha umbhalo wohlelo lokuqhubekisa ngekhodi ye-Alt.
// @description:is Opna hægri smell, fjarlægðu takmörk á afriti, klippingu, textavalinu, hægrismelltu valmynd, textaafriti, textavalinu, hægri smelltu á mynd o.fl. Styrktarstig: Veldu texta tengils með Alt-takk
// @description:it Sblocca il clic destro, rimuovi le restrizioni di copia, taglia, selezione del testo, menu contestuale, copia del testo, selezione del testo, clic destro su un'immagine, ecc. Migliora le funzionalità: seleziona il testo del collegamento ipertestuale con il tasto Alt.
// @description:sw Fungua Bonyeza-Kulia, Ondoa Vizuizi vya Kunakili, Kukata, Kuteua Maandishi, Menyu ya Bonyeza-Kulia, Kunakili Maandishi, Kuteua Maandishi, Bonyeza-Kulia kwenye Picha, na kadhalika. Boresha Kazi: Teua Nakala ya Kiunganishi cha Maandishi kwa Kutumia Kitufe cha Alt.
// @description:lv Atbloķēt labo peles pogu, noņemt ierobežojumus attēla kopēšanā, izgriešanā, teksta izvēlē, labā peles kliķa izvēlnē, teksta kopēšanā, teksta izvēlē, un tā tālāk. Uzlabotas funkcijas: Atlaseshiperhipersaites teksts ar Alt taustiņu.
// @description:lt Atrakinti dešinįjį pelės klavišą, pašalinti apribojimus kopijavimui, iškirpimui, teksto pasirinkimui, dešiniojo pelės klavišo meniu, teksto kopijavimui, teksto pasirinkimui, dešinysis pelės klavišas ant paveikslėlio ir tt. Pakeistos funkcijos: Pasirinkite hiperkryžiaus teksto su Alt klavišu.
// @description:hu Feloldja a jobb egérgomb tiltását, megszünteti a másolás, kivágás, szövegkijelölés, jobb egérgomb menü, szövegmásolás, szövegválasztás, kép jobb egérgombjának stb. korlátozásait. Fejlesztett funkciók: Hiperhivatkozás szöveg kijelölése az Alt billentyű segítségével.
// @description:nl Ontgrendel rechtsklikken, verwijder beperkingen op kopiëren, knippen, tekst selecteren, rechtsklikmenu, tekst kopiëren, tekst selecteren, rechtsklikken op afbeelding, enzovoort. Versterk functies: Selecteer tekst van hyperlink met Alt-toets.
// @description:uz O'ng tugmani oching, nusxalash, kesish, matn tanlash, o'ng tugmasi menyusi, matn nusxalash, matn tanlash, tasvirda o'ng tugmani va hokazo chegaralarni bekor qiling. Qo'shimcha imkoniyatlar: Hyperlink matnini Alt tugmasi bilan tanlang.
// @description:pl Odblokuj prawy przycisk myszy, usuń ograniczenia kopiowania, wycinania, zaznaczania tekstu, menu kontekstowego, kopiowania tekstu, zaznaczania tekstu, prawego przycisku myszy na obrazie, itp. Wzmocnione funkcje: Wybierz tekst hiperłącza za pomocą klawisza Alt.
// @description:pt Desbloquear o clique direito, remover restrições de cópia, recorte, seleção de texto, menu de clique direito, cópia de texto, seleção de texto, clique direito em imagem, etc. Melhorar recursos: Selecionar texto do link com a tecla Alt.
// @description:pt-BR Desbloquear o clique direito, remover restrições de cópia, recorte, seleção de texto, menu de clique direito, cópia de texto, seleção de texto, clique direito em imagem, etc. Melhorar recursos: Selecionar texto de hiperlink com a tecla Alt.
// @description:ro Deblocați clic dreapta, eliminați restricțiile de copiere, tăiere, selectare text, meniu clic dreapta, copiere text, selectare text, clic dreapta pe imagine, etc. Îmbunătățirea funcționalității: Selectați textul unui hyperlink cu tasta Alt.
// @description:sq Zbulo klikimin e djathtë, hiqni kufizimet për kopjimin, prerjen, zgjedhjen e tekstit, menynë e klikimit të djathtë, kopjimin e tekstit, zgjedhjen e tekstit, klikimin e djathtë në imazh, dhe të tjera. Përmirësim i funksioneve: Zgjidhni tekstin e lidhjes me tastinë Alt.
// @description:sk Odomknite pravé tlačidlo myši, odstráňte obmedzenia kopírovania, výrezu, výberu textu, kontextového menu, kopírovania textu, výberu textu, pravého tlačidla myši na obrázku atď. Vylepšené funkcie: Výber textu hypertextového odkazu pomocou klávesy Alt.
// @description:sl Odklenite desni klik, odstranite omejitve kopiranja, izrezovanja, izbire besedila, desni klik menija, kopiranja besedila, izbire besedila, desni klik na sliki itd. Izboljšane funkcije: Izberite besedilo hiperpovezave s tipko Alt.
// @description:sr Одкључајте десни клик, уклоните ограничења за копирање, исецање, избор текста, десни клик мени, копирање текста, избор текста, десни клик на слици итд. Побољшане функције: Изаберите текст хипервезе притиском на тастер Alt.
// @description:fi Poista oikean hiiren painikkeen esto, poista rajoitukset kopioinnilta, leikkaamiselta, tekstin valinnalta, oikean hiiren painikkeen valikolta, tekstin kopiointilta, tekstin valinnalta, kuvan oikealta hiiren painikkeelta jne. Paranna toimintoja: Valitse hyperlinkin teksti Alt-näppäimellä.
// @description:sv Lås upp högerklick, ta bort begränsningar för kopiering, klippning, textval, högerklickmeny, textkopiering, textval, högerklick på bild, etc. Förbättra funktioner: Välj text av hyperlänk med Alt-tangenten.
// @description:vi Mở khóa chuột phải, loại bỏ hạn chế sao chép, cắt, chọn văn bản, menu chuột phải, sao chép văn bản, chọn văn bản, chuột phải trên hình ảnh, vv. Tăng cường tính năng: Chọn văn bản liên kết với phím Alt.
// @description:tr Sağ tıklamayı açın, kopyalama, kesme, metin seçme, sağ tık menüsü, metin kopyalama, metin seçme, resimde sağ tıklama vb. kısıtlamaları kaldırın. İyileştirilmiş işlevler: Alt tuşuyla bağlantı metni seçin.
// @description:be Разблакаваць правы клік, скасаваць абмежаванні па капіраванні, выразі, выбару тэксту, кантэкстнага меню, капіравання тэксту, выбару тэксту, правага кліку на малюнку і г. д. Пашыраныя функцыі: Выберыце тэкст гіперспасылкі з дапамогай клавішы Alt.
// @description:bg Разкодирайте десен бутон, премахнете ограниченията за копиране, изрязване, избор на текст, контекстно меню, копиране на текст, избор на текст, десен бутон върху изображение и т.н. Подобрени функции: Избор на текст на хипервръзка с бутона Alt.
// @description:ky Оң жаңыкты ачыңыз, көчүрмө, тандоо тексти, оң кликтык меню, текстти көчүрүү, тексти тандаңыз, сүрөттө оң кликтүү боюнча чеделерди алыңыз ж.б. Коюлу функциялар: Alt түймөсү боюнча желек текстти тандаңыз.
// @description:kk Оң басқару түймесін ашыңыз, көшіру, мәтінді таңдау, оң баспас меню, мәтінді көшіру, мәтінді таңдау, суретте оң баспас еткізу ж.б. шектіліктерді алыңыз. Дайындауларды жеткізіңіз: Alt түймесімен қосымша түймен текстті таңдаңыз.
// @description:mk Отклучете го десниот клик, отстрани ограничувања за копирање, исечење, избор на текст, десни клик мени, копирање на текст, избор на текст, десен клик на слика итн. Подобрување на функциите: Изберете текст на хиперлинк со копчето Alt.
// @description:mn Зүүн дараалжаа сэргээх, хуулах, текст сонгох, зүүн дараалжын цэс, текст хуулах, текст сонгох, зураг дээр зүүн дараахыг сонгох гэх мэт хязгаарыг цуцлах. Үйлдэл нэмэх: Alt товчлуур ашиглан холбоосын текстээ сонгоно уу.
// @description:uk Розблокуйте правий клік, видаліть обмеження щодо копіювання, вирізання, вибору тексту, контекстного меню, копіювання тексту, вибору тексту, правий клік на зображенні тощо. Покращені функції: Вибір тексту гіперпосилання за допомогою клавіші Alt.
// @description:el Ξεκλειδώστε το δεξί κλικ, καταργήστε τους περιορισμούς αντιγραφής, αποκοπής, επιλογής κειμένου, μενού δεξιού κλικ, αντιγραφής κειμένου, επιλογής κειμένου, δεξί κλικ σε εικόνα κ.λπ. Βελτιωμένες λειτουργίες: Επιλογή κειμένου υπερσυνδέσμου με το πλήκτρο Alt.
// @description:hy Բացեք աջ կոճակը, հանեք պահեստավորումները ֆայլի պատճենում, նշումը, տեքստի ընտրությունը, աջ կոճակի մենյուում, տեքստի պատճենումը, տեքստի ընտրությունը, աջ կոճակ պատկերի վրա և այլն: Մասնակցային ֆունկցիաների ընդհանուրավորում. Նշեք հիպերհղման տեքստը Alt ստեղնով:
// @description:ur دائیں کلک کھولیں، کاپی، کٹ، متن منتخب کریں، دائیں کلک مینو، متن کاپی، متن منتخب کریں، تصویر پر دائیں کلک وغیرہ کی پابندیوں کو ختم کریں۔ تازہ کاری شدہ خصوصیات: Alt کلید کے ساتھ ہائپر لنک متن کا انتخاب کریں۔
// @description:ar فتح النقرة اليمنى ، إزالة قيود النسخ ، القص ، اختيار النص ، قائمة النقرة اليمنى ، نسخ النص ، اختيار النص ، نقرة يمنى على الصورة ، وما إلى ذلك. تعزيز الوظائف: حدد نص الارتباط باستخدام مفتاح Alt.
// @description:fa باز کردن کلیک راست ، برداشتن محدودیت های کپی ، برش ، انتخاب متن ، منوی کلیک راست ، کپی متن ، انتخاب متن ، کلیک راست بر روی تصویر و غیره. تقویت ویژگی ها: انتخاب متن پیوند با کلید Alt.
// @description:ne दायाँ क्लिक खोल्नुहोस्, प्रतिलिपि, काट, पाठ चयन गर्नुहोस्, दायाँ क्लिक मेनु, पाठ प्रतिलिपि, पाठ चयन, तस्वीरमा दायाँ क्लिक, आदिको सीमाहरू हटाउनुहोस्। सुधारिएका सुविधाहरू: एल्ट बटनसहित हायपरलिंक पाठ छान्नुहोस्।
// @description:mr उजवा क्लिक अनलॉक करा, प्रतिलिपि, कट, मजकूर निवडा, उजवा क्लिक मेनू, मजकूर प्रतिलिपि, मजकूर निवडा, प्रतिमेवर उजवा क्लिक इत्यादी सीमांकन काढा. सुधारित क्षमता: आल्ट की बटणाच्या मदतीने हायपरलिंकमधील मजकूर निवडा.
// @description:hi दायीं क्लिक अनलॉक करें, प्रतिलिपि, कट, पाठ चयन करें, दायीं क्लिक मेन्यू, पाठ प्रतिलिपि, पाठ चयन, छवि पर दायीं क्लिक इत्यादि प्रतिबंधों को हटाएँ। सुधारित सुविधाएं: एल्ट कुंजी के साथ हाइपरलिंक पाठ चयन करें।
// @description:as সোণা ক্লিক আনলক কৰক, প্ৰতিলিপি কৰক, কেটা কৰক, পাঠ বাছনি কৰক, সোণা ক্লিক মেনু, পাঠৰ প্ৰতিলিপি কৰক, পাঠ বাছনি কৰক, ছবিৰ সোণা ক্লিক আদিক। উন্নত সুবিধাসমূহ: আল্ট বুটামটো সহ হাইপাৰলিংকৰ পাঠ বাছনি কৰক।
// @description:bn ডান ক্লিক আনলক করুন, কপি, কাট, পাঠ নির্বাচন করুন, ডান ক্লিক মেনু, পাঠ কপি, পাঠ নির্বাচন, চিত্রে ডান ক্লিক ইত্যাদি সীমাবদ্ধতা অপসারণ করুন। উন্নত বৈশিষ্ট্যগুলি: এল্ট বাটন সহ হাইপারলিংক পাঠ নির্বাচন করুন।
// @description:pa ਸੱਜਾ ਕਲਿੱਕ ਖੋਲੋ, ਪਾਉਣੀ, ਕੱਟੋ, ਲਿਖਤ ਚੁਣੋ, ਸੱਜਾ ਕਲਿੱਕ ਮੀਨੂ, ਲਿਖਤ ਪਾਉਣੀ, ਲਿਖਤ ਚੁਣੋ, ਚਿੱਤਰ 'ਤੇ ਸੱਜਾ ਕਲਿੱਕ ਵਗੈਰਹ ਪਾਬੰਦੀਆਂ ਹਟਾਓ। ਸੁਧਾਰਿਤ ਫੀਚਰਾਂ: ਐਲਟ ਬਟਨ ਨਾਲ ਹਾਇਪਰਲਿੰਕ ਦੀ ਲਿਖਤ ਚੋਣ ਕਰੋ।
// @description:gu જમણી ક્લિક ખોલો, કૉપિ, કાપો, ટેક્સ્ટ પસંદ કરો, જમણી ક્લિક મેનૂ, ટેક્સ્ટ કૉપિ, ટેક્સ્ટ પસંદ, ચિત્ર પર જમણી ક્લિક વગેરે પાબંધીઓ કાઢો. સુધારેલી વૈશિષ્ટ્યો: એલ્ટ બટન સાથે હાયપરલિંકના ટેક્સ્ટ પસંદ કરો.
// @description:or ଡାହାଣହାତରେ ଖୋଲନ୍ତୁ, କପି କରିବା, କଟି କରିବା, ପାଠବାରେ ଚୟନ କରିବା, ଡାହାଣହାତ ମେନୁ, ପାଠବା ଏବଂ ଚିତ୍ର ଡାହାଣହାତ ପାଠ ଚୟନର ମର୍ମ୍ମ କେତେଟେ ପାରିବେ ବିବରଣୀ ମିଳିବା: ଅଲ୍ଟ କୀ ହେଇଲା ହାଇପରଲିଙ୍କ ପାଠ ଚୟନ।
// @description:ta வலப்பதிவு மூலம் தடைகளை நீக்குங்கள், நகலைப் பட்டைக்கு மாற்றுங்கள், உரையை தேர்வு செய்யுங்கள், வலப்பதிவு மெனு, உரை நகலைப் படக்குகள், உரை தேர்வுகளைப் படக்குகள், பட வலப்பதிவுகள் போன்ற வரைபடங்களின் வரைபடத்தை அதிகரித்துக்கொள்ளுங்கள். அதிகப்படியான செயல்பாடு: அல்ட் விசை அடைவு உரை தேர்வு.
// @description:te డౌన్లోడ్ చేయడానికి రైట్ క్లిక్ ని అనుమతించండి, నకలు, కట్, వచ్చేయి, కుడిచేయండి, టెక్స్ట్ నకలుచేయండి, చిత్రం రైట్ క్లిక్ చేయండి, అదనపు కొంత క్షేత్రాలను మెరుగుపరచండి: అల్ట్ కీ హైపర్లింక్ టెక్స్ట్ ఎంపికను పెంచుతుంది.
// @description:kn ಬಲ ಕ್ಲಿಕ್ ಬಿರುದುಗಳನ್ನು ತೆರೆಯಲು ಅನುಮತಿಸುವುದು, ನಕಲು, ಕಟ್ಟು, ಆಯ್ಕೆ ಮಾಡುವುದು, ಬಲ ಕ್ಲಿಕ್ ಮೆನು, ಪಠ್ಯ ನಕಲು, ಪಠ್ಯ ಆಯ್ಕೆ, ಚಿತ್ರ ಬಲ ಕ್ಲಿಕ್ ಮುಂತಾದ ಮಿತಿಗಳನ್ನು ತೆಗೆದುಹಾಕಿ. ಪ್ರಭಾವವನ್ನು ಹೆಚ್ಚಿಸುವುದು: Alt ಕೀ ಹೈಪರ್ಲಿಂಕ್ ಪಠ್ಯ ಆಯ್ಕೆ.
// @description:ml വലത് ക്ലിക്ക് അനുവദനീയമാക്കുക, പകരം പകർത്തുക, ടെക്സ്റ്റ് തിരിച്ചുവയ്ക്കുക, റൈറ്റ്-ക്ലിക്ക് മെനു, ടെക്സ്റ്റ് പകർത്തൽ, ടെക്സ്റ്റ് തിരിച്ചൽ, ചിത്രം റൈറ്റ്-ക്ലിക്ക് എന്നിവ നീക്കംചെയ്യുക. പ്രവർത്തനം വരുത്തുക: Alt കീ ഹൈപർലിങ്ക് ടെക്സ്റ്റ് തിരിച്ചൽ.
// @description:si දකුණු ක්ලික් කරන්න ඉඩ දෙන්න, පිටුව පිරවීම, පෙළ තෝරාගන්නවා, දකුණු ක්ලික් මෙනුව, පෙළ පිරවීම, පෙළ තෝරාගන්න, පින්තුර දකුණු ක්ලික් කරන්න ඇති සීමාවෙන් සහාය ලෙස වැහියාව ඇති ක්ලික් විශේෂිත: Alt යතුර හයිපර්ලින්ක් පෙළ තෝරාගන්න.
// @description:th ปลดล็อกคลิกขวาเพื่อย้าย, ย้าย, เลือกข้อความ, เมนูคลิกขวา, คัดลอกข้อความ, เลือกข้อความ, คลิกขวาภาพ และเพิ่มฟังก์ชัน: คีย์ Alt เพื่อเลือกข้อความลิงก์
// @description:lo ປິດການຄວບຄຸມຂອງຄລິບບີກມາ, ລືມ, ປ້ອງກັນຂໍ້ມູນ, ບໍ່ສາມາດປິດຄໍາເວລາການຄວບຄຸມ, ຄຳສັ່ງຂໍ້ມູນ, ຄຳເລືອກຂໍ້ມູນ, ຂອບເຂດປະສານຂອງຮູບພາບ, ການຮຽກຮູບຂອງຂ້ອຍແລ້ວ. ປີ້ນດີໃຫ້: Alt ເຄື່ອນຍຸກສະແດງຂ້ອຍກຳລັງເລືອກຂ້ອຍຂອງລິ້ງສຽງ.
// @description:my ရိုးရှင်းမည့်နေရာများကို ဖျောက်ပြောင်းရန် ရှိနိုင်ပါသည်။ ကျေးဇူးပြု၍ စာသား ကို ကော်ပီအောင် ရှင်းမည်မဟုတ်ပါ။
// @description:ka მარჯვნივ დააკლიკეთ უფლებებს, დააკოპირეთ, არჩევანის ტექსტი, მარჯვნივ კლიკის მენიუ, ტექსტის კოპირება, ტექსტის არჩევა, სურათის მარჯვნივ კლიკი და გამოწერა, დაამატეთ ფუნქციები: Alt ღილაკის დაჭერით ტექსტის არჩევა.
// @description:am የቀኝ ጠቋሚውን ምቀይረህ ለማውረድ ያደረጉትን ማንኛውንም ማግኛት ሊያሳይ ይችላሉ, ቅጥ ወይም የጽሁፍ መጻፊያውን ለመርዝ ያደረጉትን ማንኛውንም ማግኛት ሊያሳይ ይችላሉ. መልክዎ ከፍተኛ ስለሆነ: Alt አውታርክ ጽሁፍ መርዝ መርጃዎን.
// @description:km ដាក់អនុញ្ញាតឱ្យចុចត្រូវលើរបារអង្គចុចស្ដាប់, បិទ, ជ្រើសរើសអត្ថបទ, ម៉ឺនុយចុចស្ដាប់, ការចម្អិនអត្ថបទ, ការជ្រើសរើសអត្ថបទ, ចុចត្រូវលើរបាររូបភាព និងបន្ថែមមនុស្សពីអត្ថបទ: Alt កិច្ចការតម្រូវការចម្អិនអត្ថបទ។
// ==/UserScript==
(async function (context) {
'use strict';
const { console: console_ } = context
const console = new Proxy({}, {
get(target, prop) {
return target[prop] || console_[prop];
},
set(target, prop, value) {
target[prop] = value.bind(console_);
return true;
}
});
for (const k of ['log', 'debug', 'dir']) {
console[k] = console_[k];
}
const uWin = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window;
if (!(uWin instanceof Window)) return;
/** @type {globalThis.PromiseConstructor} */
const Promise = (async () => { })().constructor;// YouTube hacks Promise in WaterFox Classic and "Promise.resolve(0)" nevers resolve.
/** @type {() => Selection | null} */
const getSelection = uWin.getSelection.bind(uWin) || Error()();
/** @type {(callback: FrameRequestCallback) => number} */
const requestAnimationFrame = uWin.requestAnimationFrame.bind(uWin) || Error()();
/** @type {(elt: Element, pseudoElt?: string | null) => CSSStyleDeclaration} */
const getComputedStyle = uWin.getComputedStyle.bind(uWin) || Error()();
const wmComputedStyle = new WeakMap();
const getComputedStyleCached = (elem) => {
let cs = wmComputedStyle.get(elem);
if (!cs) {
cs = getComputedStyle(elem);
wmComputedStyle.set(elem, cs);
}
return cs;
}
const originalFocusFn = HTMLElement.prototype.focus;
let maxTrial = 16;
while (!document || !document.documentElement) {
await new Promise(requestAnimationFrame);
if (--maxTrial < 0) return;
}
const SCRIPT_TAG = "Selection and Copying Restorer (Universal)";
const $nil = () => { };
const getStorageSiteByPass = async () => {
await Promise.resolve(); // TODO
return {};
}
const siteByPassStored = (await getStorageSiteByPass()) || {};
const siteByPassDefault = {
"gm_remain_focus_on_mousedown": [
'https://codi.link'
],
"gm_no_custom_context_menu": [
"https://www.youtube.com", "https://m.youtube.com", "https://accounts.youtube.com",
"https://github.dev", "https://vscode.dev",
"https://www.photopea.com",
"https://www.google.com", "https://docs.google.com", "https://drive.google.com",
"https://www.dropbox.com", "https://www.terabox.com",
"https://outlook.live.com", "https://mail.yahoo.co.jp",
"https://gmail.com", "https://www.gmail.com",
"https://chat.openai.com", "https://openai.com",
"https://github.com", "https://www.github.com",
],
"gm_highlight_color_check": [
"https://www.youtube.com", "https://m.youtube.com", "https://accounts.youtube.com",
"https://github.dev", "https://vscode.dev",
"https://www.photopea.com",
"https://www.google.com", "https://docs.google.com", "https://drive.google.com",
"https://www.dropbox.com", "https://www.terabox.com",
"https://outlook.live.com", "https://mail.yahoo.co.jp",
"https://gmail.com", "https://www.gmail.com",
"https://chat.openai.com", "https://openai.com",
"https://github.com", "https://www.github.com",
"https://facebook.com", "https://www.facebook.com",
"https://twitter.com", "https://www.twitter.com",
"https://x.com",
]
};
// https://stackoverflow.com/questions/68488017/
let combine = function* (...iterators) {
for (let it of iterators) yield* it;
};
const $settings = (() => {
const siteByPassMem = {};
const keys = combine(Object.keys(siteByPassStored), Object.keys(siteByPassDefault))
for (const gmKey of keys) {
if (siteByPassMem[gmKey]) continue;
const store = siteByPassMem[gmKey] = new Set();
const defaultByPass = siteByPassDefault[gmKey];
if (defaultByPass && defaultByPass.length >= 1) {
for (const site of defaultByPass) {
store.add(site);
}
}
const storage = siteByPassStored[gmKey];
if (storage && storage.length >= 1) {
for (const value of storage) {
if (value.charAt(0) === '~') store.delete(value.substring(1));
else store.add(value);
}
}
}
return new Proxy(siteByPassMem, {
get(target, prop) {
if (!$[prop]) return false;
const v = target[prop];
if (v) {
if (v.has(location.origin)) return false;
}
return true;
},
set(target, prop, value) {
return false;
}
});
})(siteByPassStored);
let focusNotAllowedUntil = 0;
function isLatestBrowser() {
let res;
try {
let o = { $nil };
o?.$nil();
o = null;
o?.$nil();
res = true;
} catch (e) { }
return !!res;
}
if (!isLatestBrowser()) console.warn(`${SCRIPT_TAG}: Browser version before 2020-01-01 is not recommended. Please update to the latest version.`);
function getEventListenerSupport() {
if ('_b1850' in $) return $._b1850
let prop = 0;
document.createAttribute('z').addEventListener('nil', $nil, {
get passive() {
prop |= 1;
},
get once() {
prop |= 2;
}
});
return ($._b1850 = prop);
}
function isSupportAdvancedEventListener() {
return (getEventListenerSupport() & 3) === 3;
}
function isSupportPassiveEventListener() {
return (getEventListenerSupport() & 1) === 1;
}
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
function cloneRange() {
const selection = window.getSelection();
if (!selection.rangeCount) return false;
const range = selection.getRangeAt(0);
return range.cloneRange();
}
/* globals WeakRef:false */
/** @type {(o: Object | null) => WeakRef | null} */
const mWeakRef = typeof WeakRef === 'function' ? (o => o ? new WeakRef(o) : null) : (o => o || null);
/** @type {(wr: Object | null) => Object | null} */
const kRef = (wr => (wr && wr.deref) ? wr.deref() : wr);
/*
const whiteListForCustomContextMenu = [
'https://drive.google.com/',
'https://mail.google.com/',
'https://www.google.com/maps/',
'https://www.dropbox.com/',
'https://outlook.live.com/mail/'
];
const isCustomContextMenuAllowedFn = () => {
const href = location.href;
for (h of whiteListForCustomContextMenu) {
if (href.startsWith(h)) return true;
}
return false;
}
*/
const isCustomContextMenuAllowedFn = () => { return false; }
let isCustomContextMenuAllowed = null;
const $ = {
utSelectionColorHack: 'msmtwejkzrqa',
utTapHighlight: 'xfcklblvkjsj',
utLpSelection: 'gykqyzwufxpz',
utHoverBlock: 'meefgeibrtqx', // scc_emptyblock
// utNonEmptyElm: 'ilkpvtsnwmjb',
utNonEmptyElmPrevElm: 'jttkfplemwzo',
utHoverTextWrap: 'oseksntfvucn',
utAltPage: 'vzhwnfgxnool',
ksFuncReplacerCounter: '___dqzadwpujtct___',
ksEventReturnValue: ' ___ndjfujndrlsx___',
ksSetData: '___rgqclrdllmhr___',
ksNonEmptyPlainText: '___grpvyosdjhuk___',
eh_capture_passive: () => isSupportPassiveEventListener() ? ($._eh_capture_passive = ($._eh_capture_passive || {
capture: true,
passive: true
})) : true,
eh_capture_active: () => isSupportPassiveEventListener() ? ($._eh_capture_passive = ($._eh_capture_passive || {
capture: true,
passive: false
})) : true,
mAlert_DOWN: $nil, // dummy function in case alert replacement is not valid
mAlert_UP: $nil, // dummy function in case alert replacement is not valid
gm_no_custom_context_menu: true,
gm_highlight_color_check: true,
lpKeyPressing: false,
lpKeyPressingPromise: Promise.resolve(),
/** @readonly */
weakMapFuncReplaced: new WeakMap(),
ksFuncReplacerCounterId: 0,
isStackCheckForFuncReplacer: false, // multi-line stack in FireFox
isGlobalEventCheckForFuncReplacer: false,
enableReturnValueReplacment: false, // set true by code
rangeOnKeyDown: null,
// rangeOnKeyUp: null,
/** @readonly */
eyEvts: ['keydown', 'keyup', 'copy', 'contextmenu', 'select', 'selectstart', 'dragstart', 'beforecopy'], // slope: throughout
delayMouseUpTasks: 0,
isNum: (d) => (d > 0 || d < 0 || d === 0),
getNodeType: (n) => ((n instanceof Node) ? n.nodeType : -1),
isAnySelection: function () {
const sel = getSelection();
return !sel ? null : (typeof sel.isCollapsed === 'boolean') ? !sel.isCollapsed : (sel.toString().length > 0);
},
updateIsWindowEventSupported: function () {
// https://developer.mozilla.org/en-US/docs/Web/API/Window/event
// FireFox >= 66
let p = document.createElement('noscript');
p.onclick = function (ev) { $.isGlobalEventCheckForFuncReplacer = (window.event === ev) };
p.dispatchEvent(new Event('click'));
p = null;
},
/**
*
* @param {string} cssStyle
* @param {Node?} container
* @returns
*/
createCSSElement: function (cssStyle, container) {
const css = document.createElement('style'); // slope: DOM throughout
css.textContent = cssStyle;
if (container) container.appendChild(css);
return css;
},
createFakeAlert: function (_alert) {
if (typeof _alert !== 'function') return null;
function alert(msg) {
alert.__isDisabled__() ? console.log("alert msg disabled: ", msg) : _alert.apply(this, arguments);
};
alert.toString = _alert.toString.bind(_alert);
return alert;
},
/**
*
* @param {Function} originalFunc
* @param {string} pName
* @returns
*/
createFuncReplacer: function (originalFunc) {
const id = ++$.ksFuncReplacerCounterId;
const resFX = function (ev) {
const res = originalFunc.apply(this, arguments);
if (res === false) {
if (!this || !ev) return false;
const pName = 'on' + ev.type;
const selfFunc = this[pName];
if (typeof selfFunc !== 'function') return false;
if (selfFunc[$.ksFuncReplacerCounter] !== id) return false;
// if this is null or undefined, or this.onXXX is not this function
if (ev.cancelable !== false && $.shouldDenyPreventDefault(ev)) {
if ($.isGlobalEventCheckForFuncReplacer === true) {
if (window.event !== ev) return false; // eslint-disable-line
}
if ($.isStackCheckForFuncReplacer === true) {
let stack = (new Error()).stack;
let onlyOneLineStack = stack.indexOf('\n') === stack.lastIndexOf('\n');
if (onlyOneLineStack === false) return false;
}
return true;
}
}
return res;
}
resFX[$.ksFuncReplacerCounter] = id;
resFX.toString = originalFunc.toString.bind(originalFunc);
$.weakMapFuncReplaced.set(originalFunc, resFX);
return resFX;
},
// listenerDisableAll: async (evt) => {
// },
onceCssHighlightSelection: async () => {
if (document.documentElement.hasAttribute($.utLpSelection)) return;
$.onceCssHighlightSelection = null
await Promise.resolve();
const s = [...document.querySelectorAll('a,p,div,span,b,i,strong,li')].filter(elm => elm.childElementCount === 0); // randomly pick an element containing text only to avoid css style bug
const elm = !s.length ? document.body : s[s.length >> 1];
await Promise.resolve();
const selectionStyle = getComputedStyle(elm, '::selection');
let selectionBackgroundColor = selectionStyle.getPropertyValue('background-color') || '';
if (selectionBackgroundColor.length > 9 && /^rgba\(\d+,\s*\d+,\s*\d+,\s*0\)$/.test(selectionBackgroundColor)) {
document.documentElement.setAttribute($.utSelectionColorHack, "");
} else {
let bodyBackgroundColor = getComputedStyleCached(document.body).getPropertyValue('background-color') || '';
if (bodyBackgroundColor === selectionBackgroundColor) {
document.documentElement.setAttribute($.utSelectionColorHack, "");
}
}
await Promise.resolve();
const elmStyle = getComputedStyleCached(elm);
let highlightColor = elmStyle.getPropertyValue('-webkit-tap-highlight-color') || '';
if (highlightColor.length > 9 && /^rgba\(\d+,\s*\d+,\s*\d+,\s*0\)$/.test(highlightColor)) document.documentElement.setAttribute($.utTapHighlight, "");
document.documentElement.setAttribute($.utTapHighlight, "");
},
clipDataProcess: function (clipboardData) {
if (!clipboardData) return;
const evt = kRef(clipboardData[$.ksSetData]); // NOT NULL when preventDefault is called
if (!evt || evt.clipboardData !== clipboardData) return;
const plainText = clipboardData[$.ksNonEmptyPlainText]; // NOT NULL when setData is called with non empty input
if (!plainText) return;
// BOTH preventDefault and setData are called.
if (evt.cancelable === false || evt.defaultPrevented === true) return;
// ---- disable text replacement on plain text node(s) ----
const rangeOnKeyDown = $.rangeOnKeyDown || 0;
let isEditorLikeText = false; // TBC
if (typeof rangeOnKeyDown.compareBoundaryPoints === 'function') {
const range = cloneRange();
if (range) {
// checking whether selection range remains the same (vs Ctrl-C)
const isRangeUnchanged = rangeOnKeyDown.compareBoundaryPoints(Range.START_TO_END, range) === 0;
if(isRangeUnchanged && range.collapsed){
isEditorLikeText = true;
}
}
}
let log = null;
let callEventDefault = true;
if (isEditorLikeText) {
} else {
let cSelection = getSelection();
if (!cSelection) return; // ?
let exactSelectionText = cSelection.toString();
let trimedSelectionText = exactSelectionText.trim();
if (exactSelectionText.length > 0 && exactSelectionText.length < plainText.length) {
let pSelection = trimedSelectionText.replace(/[\r\n\t\b\x20\xA0\u200b\uFEFF\u3000]+/g, '');
let pRequest = plainText.replace(/[\r\n\t\b\x20\xA0\u200b\uFEFF\u3000]+/g, '');
// a newline char (\n) could be generated between nodes.
let search = pRequest.indexOf(pSelection);
let bool05 = search >= 0 && search < (plainText.length / 2) + 1;
if (bool05) {
let nodeType1 = $.getNodeType(cSelection.anchorNode);
let nodeType2 = $.getNodeType(cSelection.focusNode);
let test1 = nodeType1 === 3 && nodeType2 === 3;
if (!test1) test1 = cSelection.anchorNode === cSelection.focusNode && nodeType1 === 1;
bool05 = bool05 && test1;
}
if (bool05) {
callEventDefault = false;
log = ({
msg: "copy event - clipboardData replacement is NOT allowed as the text node(s) is/are selected.",
oldText: trimedSelectionText,
newText: plainText,
});
callEventDefault = false;
}
}
if(!callEventDefault){
}else if (trimedSelectionText) {
// there is replacement data and the selection is not empty
log = ({
msg: "copy event - clipboardData replacement is allowed and the selection is not empty",
oldText: trimedSelectionText,
newText: plainText,
});
} else {
// there is replacement data and the selection is empty
log = ({
msg: "copy event - clipboardData replacement is allowed and the selection is empty",
oldText: trimedSelectionText,
newText: plainText,
});
}
}
if (callEventDefault) {
// --- allow preventDefault for text replacement ---
$.bypass = true;
evt.preventDefault();
$.bypass = false;
}
// ---- message log ----
log && console.log(log);
},
shouldDenyPreventDefault: function (evt) {
if (!evt || $.bypass) return false;
let j = $.eyEvts.indexOf(evt.type);
const target = evt.target;
switch (j) {
case 6: // dragstart
if (isCustomContextMenuAllowed === null) isCustomContextMenuAllowed = isCustomContextMenuAllowedFn();
if (isCustomContextMenuAllowed) return false;
if ($.enableDragging) return false;
if (target instanceof Element && target.hasAttribute('draggable')) {
$.enableDragging = true;
return false;
}
// if(evt.target.hasAttribute('draggable')&&evt.target!=window.getSelection().anchorNode)return false;
return true;
case 3: // contextmenu
if (!$settings.gm_no_custom_context_menu) return false;
if (isCustomContextMenuAllowed === null) isCustomContextMenuAllowed = isCustomContextMenuAllowedFn();
if (isCustomContextMenuAllowed) return false;
if (target instanceof Element) {
switch (target.nodeName) {
case 'IMG':
case 'SPAN':
case 'P':
case 'BODY':
case 'HTML':
case 'A':
case 'B':
case 'I':
case 'PRE':
case 'CODE':
case 'CENTER':
case 'SMALL':
case 'SUB':
case 'SAMP':
return true;
case 'VIDEO':
case 'AUDIO':
return $.gm_native_video_audio_contextmenu ? true : false;
}
// if (target.closest('ytd-player#ytd-player')) return false;
if ((target.textContent || "").trim().length === 0 && target.querySelector('video, audio')) {
return false; // exclude elements like video
}
}
return true;
case -1:
return false;
case 0: // keydown
case 1: // keyup
if (isCustomContextMenuAllowed === null) isCustomContextMenuAllowed = isCustomContextMenuAllowedFn();
if (isCustomContextMenuAllowed) return false;
return (evt.keyCode === 67 && (evt.ctrlKey || evt.metaKey) && !evt.altKey && !evt.shiftKey && $.isAnySelection() === true);
case 2: // copy
if (isCustomContextMenuAllowed === null) isCustomContextMenuAllowed = isCustomContextMenuAllowedFn();
if (isCustomContextMenuAllowed) return false;
if (!(target instanceof Node) && !(target instanceof Window) && !(target instanceof Document)) return false; // bypass unrecognized eventTargets
if (target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement) return false; // bypass input/textarea elements
if (target instanceof HTMLElement && (target.closest('[contenteditable]'))) return false; // bypass [contenteditable] and its descendants
if (target.parentNode instanceof HTMLElement && (target.parentNode.closest('[contenteditable]'))) return false; // bypass textNode under [contenteditable] and its descendants
if (!('clipboardData' in evt && 'setData' in DataTransfer.prototype)) return true; // Event oncopy not supporting clipboardData
if (evt.cancelable === false || evt.defaultPrevented === true) return true;
const cd = kRef(evt.clipboardData[$.ksSetData]);
if (cd && cd !== evt) return true; // in case there is a bug
evt.clipboardData[$.ksSetData] = mWeakRef(evt);
$.clipDataProcess(evt.clipboardData);
return true; // preventDefault in clipDataProcess
default:
return true;
}
},
enableSelectClickCopy: function () {
!(function ($setData) {
DataTransfer.prototype.setData = (function setData() {
if (arguments[0] === 'text/plain' && typeof arguments[1] === 'string') {
if (arguments[1].trim().length > 0) {
this[$.ksNonEmptyPlainText] = arguments[1]
} else if (this[$.ksNonEmptyPlainText]) {
arguments[1] = this[$.ksNonEmptyPlainText]
}
}
$.clipDataProcess(this)
let res = $setData.apply(this, arguments)
return res;
})
})(DataTransfer.prototype.setData);
Object.defineProperties(DataTransfer.prototype, {
[$.ksSetData]: { // store the event
value: null,
writable: true,
enumerable: false,
configurable: true
},
[$.ksNonEmptyPlainText]: { // store the text
value: null,
writable: true,
enumerable: false,
configurable: true
}
})
Event.prototype.preventDefault = (function (f) {
function preventDefault() {
if (this.cancelable !== false && !$.shouldDenyPreventDefault(this)) f.call(this);
}
preventDefault.toString = f.toString.bind(f);
return preventDefault;
})(Event.prototype.preventDefault);
(() => {
const pd = Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(Event.prototype, 'returnValue') : {};
const { get, set } = pd;
if (get && set) {
const filterTypes = new Set($.eyEvts);
Object.defineProperty(Event.prototype, "returnValue", {
get() {
const type = this.type;
if (!filterTypes.has(type)) return get.call(this);
return $.ksEventReturnValue in this ? this[$.ksEventReturnValue] : true;
},
set(newValue) {
const type = this.type;
if (!filterTypes.has(type)) return set.call(this, newValue);
const convertedNV = !!newValue;
if (convertedNV === false) this.preventDefault();
if (this[$.ksEventReturnValue] !== false) {
this[$.ksEventReturnValue] = convertedNV;
}
},
enumerable: true,
configurable: true
});
} else {
Object.defineProperty(Event.prototype, "returnValue", {
get() {
return $.ksEventReturnValue in this ? this[$.ksEventReturnValue] : true;
},
set(newValue) {
if (newValue === false) this.preventDefault();
this[$.ksEventReturnValue] = newValue;
},
enumerable: true,
configurable: true
});
}
})();
$.enableReturnValueReplacment = true;
// for (const eyEvt of $.eyEvts) {
// document.addEventListener(eyEvt, $.listenerDisableAll, true); // Capture Event; passive:false; expected occurrence COMPLETELY before Target Capture and Target Bubble
// }
// userscript bug ? window.alert not working
/** @type {Window | null} */
let window_ = uWin;
if (window_) {
let _alert = window_.alert; // slope: temporary
if (typeof _alert === 'function') {
let _mAlert = $.createFakeAlert(_alert);
if (_mAlert) {
let clickBlockingTo = 0;
_mAlert.__isDisabled__ = () => clickBlockingTo > +new Date;
$.mAlert_DOWN = () => (clickBlockingTo = +new Date + 50);
$.mAlert_UP = () => (clickBlockingTo = +new Date + 20);
window_.alert = _mAlert
}
_mAlert = null;
}
_alert = null;
}
window_ = null;
},
lpCheckPointer: function (targetElm) {
if (targetElm instanceof Element && targetElm.matches('*:hover')) {
if (getComputedStyleCached(targetElm).getPropertyValue('cursor') === 'pointer' && targetElm.textContent) return true;
}
return false;
},
/**
*
* @param {Event} evt
* @param {boolean} toPreventDefault
*/
eventCancel: function (evt, toPreventDefault) {
$.bypass = true;
!toPreventDefault || evt.preventDefault()
evt.stopPropagation();
evt.stopImmediatePropagation();
$.bypass = false;
},
lpHoverBlocks: [],
lpKeyAltLastPressAt: 0,
lpKeyAltPressInterval: 0,
noPlayingVideo: function () {
// prevent poor video preformance
let noPlaying = true;
for (const video of document.querySelectorAll('video[src]')) {
if (video.paused === false) {
noPlaying = false;
break;
}
}
return noPlaying;
},
/** @type {EventListener} */
lpKeyDown: (evt) => {
if (!$.gm_lp_enable) return;
const isAltPress = (evt.key === "Alt" && evt.altKey && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey);
if (isAltPress) {
$.lpKeyAltLastPressAt = +new Date;
let element = evt.target;
if ($.lpKeyPressing === false && (element instanceof Node) && element.parentNode && !evt.repeat && $.noPlayingVideo()) {
$.lpKeyPressing = true;
document.documentElement.setAttribute($.utAltPage, '');
// $.cid_lpKeyPressing = setInterval(() => {
// if ($.lpKeyAltLastPressAt + 500 < +new Date) {
// $.lpCancelKeyPressAlt();
// }
// }, 137);
const rootNode = $.rootHTML(element);
if (rootNode) {
let tmp_wmEty = null;
let wmTextWrap = new WeakMap();
$.lpKeyPressingPromise = $.lpKeyPressingPromise.then(() => {
for (const elm of $.lpHoverBlocks) {
elm.removeAttribute($.utNonEmptyElmPrevElm)
elm.removeAttribute($.utHoverTextWrap)
}
$.lpHoverBlocks.length = 0;
}).then(() => {
tmp_wmEty = new WeakMap(); // 1,2,3.....: non-empty elm, -1:empty elm
const s = [...rootNode.querySelectorAll('*:not(button, textarea, input, script, noscript, style, link, img, br)')].filter((elm) => elm.childElementCount === 0 && (elm.textContent || '').trim().length > 0)
for (const elm of s) tmp_wmEty.set(elm, 1);
return s;
}).then((s) => {
let laterArr = [];
let promises = [];
let promiseCallback = parentNode => {
if (wmTextWrap.get(parentNode) !== null) return;
const m = [...parentNode.children].some(elm => {
const value = getComputedStyleCached(elm).getPropertyValue('z-index') || '';
if (value.length > 0) return $.isNum(+value)
return false
})
wmTextWrap.set(parentNode, m)
if (m) {
$.lpHoverBlocks.push(parentNode);
parentNode.setAttribute($.utHoverTextWrap, '')
}
};
for (const elm of s) {
let qElm = elm;
let qi = 1;
while (true) {
let pElm = qElm.previousElementSibling;
let anyEmptyHover = false;
while (pElm) {
if (tmp_wmEty.get(pElm) > 0) break;
if (!pElm.matches(`button, textarea, input, script, noscript, style, link, img, br`) && (pElm.textContent || '').length === 0 && pElm.clientWidth * pElm.clientHeight > 0) {
laterArr.push(pElm);
anyEmptyHover = true;
}
pElm = pElm.previousElementSibling;
}
if (anyEmptyHover && !wmTextWrap.has(qElm.parentNode)) {
wmTextWrap.set(qElm.parentNode, null)
promises.push(Promise.resolve(qElm.parentNode).then(promiseCallback))
}
qElm = qElm.parentNode;
if (!qElm || qElm === rootNode) break;
qi++
if (tmp_wmEty.get(qElm) > 0) break;
tmp_wmEty.set(qElm, qi)
}
}
tmp_wmEty = null;
Promise.all(promises).then(() => {
promises.length = 0;
promises = null;
promiseCallback = null;
for (const pElm of laterArr) {
let parentNode = pElm.parentNode
if (wmTextWrap.get(parentNode) === true) {
$.lpHoverBlocks.push(pElm);
pElm.setAttribute($.utNonEmptyElmPrevElm, '');
}
}
laterArr.length = 0;
laterArr = null;
wmTextWrap = null;
})
})
}
}
} else if ($.lpKeyPressing === true) {
$.lpCancelKeyPressAlt();
}
},
lpCancelKeyPressAlt: () => {
$.lpKeyPressing = false;
document.documentElement.removeAttribute($.utAltPage);
// if ($.cid_lpKeyPressing > 0) $.cid_lpKeyPressing = clearInterval($.cid_lpKeyPressing);
$.lpKeyPressingPromise = $.lpKeyPressingPromise.then(() => {
for (const elm of $.lpHoverBlocks) {
elm.removeAttribute($.utNonEmptyElmPrevElm);
elm.removeAttribute($.utHoverTextWrap);
}
$.lpHoverBlocks.length = 0;
})
setTimeout(function () {
if ($.lpMouseActive === 1) {
$.lpMouseUpClear();
$.lpMouseActive = 0;
}
}, 32);
},
/** @type {EventListener} */
lpKeyUp: (evt) => {
if (!$.gm_lp_enable) return;
if ($.lpKeyPressing === true) {
$.lpCancelKeyPressAlt();
}
},
lpAltRoots: [],
/** @type {EventListener} */
lpMouseDown: (evt) => {
if (!$.gm_lp_enable) return;
$.lpMouseActive = 0;
if (evt.altKey && !evt.ctrlKey && !evt.metaKey && !evt.shiftKey && evt.button === 0 && (evt.target instanceof Node) && $.noPlayingVideo()) {
$.lpMouseActive = 1;
$.eventCancel(evt, false);
const rootNode = $.rootHTML(evt.target);
$.lpAltRoots.push(rootNode);
rootNode.setAttribute($.utLpSelection, '');
}
},
lpMouseUpClear: function () {
for (const rootNode of $.lpAltRoots) rootNode.removeAttribute($.utLpSelection);
$.lpAltRoots.length = 0;
if (typeof $.onceCssHighlightSelection === 'function') {
if ($settings.gm_highlight_color_check) requestAnimationFrame($.onceCssHighlightSelection);
}
},
/** @type {EventListener} */
lpMouseUp: (evt) => {
if (!$.gm_lp_enable) return;
if ($.lpMouseActive === 1) {
$.lpMouseActive = 2;