-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhfr_smart_auto_r_mod_r21.user.js
More file actions
1466 lines (1389 loc) · 91.4 KB
/
Copy pathhfr_smart_auto_r_mod_r21.user.js
File metadata and controls
1466 lines (1389 loc) · 91.4 KB
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 [HFR] Smart Auto Rehost mod_r21
// @version 6.2.1
// @namespace roger21.free.fr
// @description Réhost automatiquement les images et les liens vers les images provenant d'une liste modifiable de noms de domaine.
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEX%2F%2F%2F8AAADxjxvylSrzmzf5wYLzmjb%2F9er%2F%2Fv70nj32q1b5woT70qT82rT827b%2F%2B%2FjxkSHykybykyfylCjylCnzmDDzmjX0nTv1o0b1qFH2qVL2qlT3tGn4tmz4uHD4uXL5vHf83Lf83Lj937394MH%2B587%2B69f%2F8%2BX%2F8%2Bf%2F9On%2F9uz%2F%2BPH%2F%2BvT%2F%2FPmRE1AgAAAAwElEQVR42s1SyRbCIAysA7W2tdZ93%2Ff1%2F39PEtqDEt6rXnQOEMhAMkmC4E9QY9j9da1OkP%2BtTiBo1caOjGisDLRDANCk%2FVIHwwkBZGReh9avnGj2%2FWFg%2Feg5hD1bLZTwqdgU%2FlTSdrqZJWN%2FKImPOnGjiBJKhYqMvikxtlhLNTuz%2FgkxjmJRRza5mbcXpbz4zldLJ0lVEBY5nRL4CJx%2FMEfXE4L9j4Qr%2BZakpiandMpX6FO7%2FaPxxUTJI%2FsJ4cd4AoSOBgZnPvgtAAAAAElFTkSuQmCC
// @include https://forum.hardware.fr/*
// @author roger21
// @authororig mycrub
// @modifications Réécriture, compatibilité gm4, gestion des liens vers les images en plus des images, ajout du choix entre reho.st, ses aliases ou un rehost perso, intégration de la fonctionnalité stealth rehost, ajout d'options pour les formats gif, gifv, webp et svg et gestion du choix des noms de domaine à réhoster sur la fenêtre d'ajout des noms de domaine.
// @modtype réécriture et évolutions
// @updateURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_smart_auto_r_mod_r21.user.js
// @installURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_smart_auto_r_mod_r21.user.js
// @downloadURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_smart_auto_r_mod_r21.user.js
// @supportURL https://forum.hardware.fr/hfr/Discussions/Viepratique/sujet_116015_1.htm
// @homepageURL http://roger21.free.fr/hfr/
// @noframes
// @grant GM.getValue
// @grant GM_getValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM.registerMenuCommand
// @grant GM_registerMenuCommand
// ==/UserScript==
/*
Copyright © 2012-2022, 2025 roger21@free.fr
This program is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/agpl.txt>.
*/
// $Rev: 4264 $
// historique :
// 6.2.1 (16/06/2025) :
// - ajout de l'extension .avif dans la detection des liens image
// 6.2.0 (15/04/2025) :
// - possibilité de dé-réhoster / re-réhoster un post en double-cliquant sur le burger
// - changement du texte pour signaler les erreurs de rehostage de UnRehost à NotRehost
// - recodage des .className en .setAttribute("class", ) (parce que)
// 6.1.3 (11/06/2022) :
// - amélioration de la taille de la div pour l'image de test
// - redécoupage de certaines lignes longues dans le code
// 6.1.2 (02/02/2021) :
// - ajout du support pour GM.registerMenuCommand() (pour gm4)
// 6.1.1 (11/01/2021) :
// - réactivation par défaut des options "à ne pas réhoster"
// 6.1.0 (11/01/2021) :
// - retour à reho.st par défaut
// 6.0.9 (25/09/2020) :
// - ajout de reho.st à la liste des noms de domaine à ne pas réhoster ->
// (le service ne permettant pas d'être interrogé autrement que directement depuis une page du forum)
// 6.0.8 (25/09/2020) :
// - correction du code de conversion des urls et passage à images.weserv.nl par défaut
// 6.0.7 (16/07/2020) :
// - homogénéisation de la taille des champs sur la fenêtre de configuration
// 6.0.6 (17/03/2020) :
// - conversion des click -> select() en focus -> select() sur les champs de saisie
// 6.0.5 (13/02/2020) :
// - utilisation d'une url en data pour l'icône du script et changement d'hébergeur ->
// (free.fr -> github.com)
// 6.0.4 (11/01/2020) :
// - mise à jour des images des boutons de la fenêtre de configuration
// 6.0.3 (22/12/2019) :
// - gestion du déréhostage lorsque le chargement de l'image réhostée échoue
// 6.0.2 (05/11/2019) :
// - correction des regexp de détection des extensions
// 6.0.1 (05/11/2019) :
// - ajout du type de fichier svg dans les options des formats à ne pas réhoster
// 6.0.0 (03/11/2019) :
// - gestion de la compatibilité gm4
// - ajout du choix entre reho.st, ses aliases ou un rehost perso sur la fenêtre de configuration
// - intégration de la fonctionnalité stealth rehost
// - ajout d'options pour les formats gif, gifv et webp
// - gestion du choix des noms de domaine à réhoster sur la fenêtre d'ajout des noms de domaine
// - changement de l'image du burger par défaut
// - mise à jour de la liste des noms de domaine par défaut
// - passage au clic droit pour ouvrir la fenêtre de configuration au lieu du double clic
// - nouveau nom : [HFR] smart auto rehost mod_r21 -> [HFR] Smart Auto Rehost mod_r21
// - ajout de l'avis de licence AGPL v3+ *si mycrub est d'accord*
// - appropriation des metadata @namespace et @author (passage en roger21)
// - ajout de la metadata @authororig (mycrub)
// - réécriture des metadata @description, @modifications et @modtype
// 5.4.8 (02/10/2019) :
// - suppression de la directive "@inject-into" (mauvaise solution, changer solution)
// 5.4.7 (30/09/2019) :
// - suppression de la directive @connect inutile (oublie sur la dernière maj)
// 5.4.6 (20/09/2019) :
// - autorisation du rehost des gif (2Mo -> 5Mo)
// - correction de la gestion des liens (sans requête HEAD)
// - ajout de la directive "@inject-into content" pour isoler le script sous violentmonkey
// 5.4.5 (15/08/2018) :
// - correction de l'ajout du burger pour éviter d'en avoir deux, signalé par minipouss :jap:
// - et suppression des getElementByXpath remplacés par des querySelector si besoin
// 5.4.4 (13/08/2018) :
// - correction d'une fôte, signalée par minipouss :jap:
// 5.4.3 (10/06/2018) :
// - amélioration de la regexp de détection des gif
// - exclusion des gif de la détection du content-type
// 5.4.2 (13/05/2018) :
// - ajout de la metadata @connect pour tm
// - ajout d'une protection suplémentaire sur les liens en forum.hardware.fr
// - petites optimisations et améliorations (oui encore) du code
// - maj de la metadata @homepageURL
// 5.4.1 (28/04/2018) :
// - petites améliorations du code et check du code dans tm
// - suppression des @grant inutiles
// 5.4.0 (06/12/2017) :
// - passage au https pour reho.st avec conversion auto du site de reho.st
// 5.3.2 (28/11/2017) :
// - passage au https
// 5.3.1 (11/02/2017) :
// - correction du style font-fammily à Verdana,Arial,Sans-serif,Helvetica (HFR Style)
// 5.3.0 (16/12/2016) :
// - désactivation du rehostage des .gif (trop gros passera pas)
// 5.2.0 (15/12/2016) :
// - tri des listes d'hosts dans la fenêtre de configuration
// - meilleure gestion de l'affichage des données dans la fenêtre de configuration
// - correction des polices et de leur tailles dans la fenêtre de configuration
// - légère remise en forme de la fenêtre de configuration
// 5.1.3 (15/08/2016) :
// - correction du string.contains en string.includes (par cytrouille pour firefox 48+)
// 5.1.2 (19/04/2016) :
// - ajout du mode anonyme de GM_xmlhttpRequest (GM 3.8)
// 5.1.1 (24/11/2015) :
// - correction de la regexp du content-type pour matcher image/jpg (qui n'existe pas !)
// - légère modification de la regexp du content-type (plus robuste ?)
// 5.1.0 (22/11/2015) :
// - correction d'une connerie (bravo!) dans la detection du content-type
// - amélioration du code pour marquer que le lien est reho.sté
// - nouveau nom : [HFR] Smart Auto Rehost mod_r21 -> [HFR] smart auto rehost mod_r21
// 5.0.0 (21/11/2015) :
// - desactivation des spellcheck dans la fenetre de conf
// - ajout de l'ouverture de la fenetre de conf en double cliquant sur le burger
// - modification du title sur le burger
// - légères modification de code et des noms des fonctions
// - suppression d'une ligne vide
// - reformatage du code (Online JavaScript beautifier : ->
// "2 spaces, unlimited newlines, do not wrap, braces with" et rien coché)
// - remplacement des ' par des " (pasque !)
// - ajout du traitement des liens vers des images ->
// permet notamment à [HFR] Image quote preview de prendre l'url de rehost au lieu de l'url ->
// source (quand le rehost est apliqué à cet host)
// - ajout d'un test sur la detection des nouveaux hosts a réhoster pour eviter de laisser ->
// passer un bug avec les url en data:image
// - lors de l'ajout d'un host à rehoster, retraitetement de la page entière, pas seulment ->
// du post concerné, le même host peut être utilisé dans d'autres posts, autant tout traiter
// - nouveau numéro de version : 4.0.7 -> 5.0.0
// - nouveau nom : [HFR] Smart Auto Rehost -> [HFR] Smart Auto Rehost mod_r21
// - modification de l'année dans les dates de l'historique : passage de 2 a 4 chiffres
// 4.0.7 (17/10/2015) :
// - génocide de code non utilisé et de commentaires
// - uniformisation du nom du script : "Auto Rehost" -> "Smart Auto Rehost"
// 4.0.6.14 (07/03/2015) :
// - ajout de la metadata @noframes (interdit l'execution du script dans une frame pour ->
// plus de sécurité)
// 4.0.6.13 (20/01/15) :
// - suppression du support de hfr-rehost.net
// 4.0.6.12 (19/01/2015) :
// - compactage du css
// - reencodage des images en base64
// - decoupage des lignes de code trop longue
// - reformatage du code (Online JavaScript beautifier : ->
// "2 spaces, unlimited newlines, do not wrap, braces with" et rien coché)
// - suppression de certains commentaires inutiles
// - suppression de bouts de code mort
// - suppression de code commenté (log et dé-rehostage)
// - suppression du module d'auto-update (code mort)
// 4.0.6.11 (06/04/2014) :
// - suppression du systeme de dé-rehostage qui sert (plus) à rien et qui pue
// 4.0.6.10 (04/04/2014) :
// - ajout de metadata pour la publication (@author, @modifications, @modtype)
// - ajout d'une icone au script
// - ajout des dates dans l'historique
// 4.0.6.9 (18/03/2014) :
// - maj des metadata @grant et indentation des metadata
// 4.0.6.8 (25/10/2013) :
// - ajout d'un . dans Rehosted (Reho.sted) dans les titles et alt
// 4.0.6.7 (10/10/2013) :
// - passage de http://hfr-rehost.net/ à http://reho.st/ pour le rehost
// 4.0.6.6 (22/11/2012) :
// - ajout du support pour le https
// 4.0.6.5 (22/11/2012) :
// - nouveau code pour le dé-rehostage (check avant rehost au lieu de corriger après rehost) ->
// c'est plus léger
// 4.0.6.4 (21/11/2012) :
// - ajout d'un test de dé-rehostage (quand hfr-rehost ne renvoie rien) ->
// en attente d'une nouvelle image "trop gros, passera pas"
// 4.0.6.3 (14/09/2012) :
// - ajout des metadata @grant
// 4.0.6.2 (30/08/2012) :
// - modification des attributs alt et title en cas de un-rehostage
// - ajout de l'historique
// - gestion des atttributs avec les methodes accesseurs
// 4.0.6.1 (05/08/2012) :
// - ajout d'un caca pour un-rehoster les images trop grosses (selon hfr-rehost.net)
// - commentage du log (on s'en branle :o )
// - ajout d'un .1 sur le numero de version
// - désactivation de l'auto-update pour conserver les modifs
/* ---------------------------- */
/* gestion de compatibilité gm4 */
/* ---------------------------- */
if(typeof GM === "undefined") {
this.GM = {};
}
if(typeof GM_getValue !== "undefined" && typeof GM.getValue === "undefined") {
GM.getValue = function(...args) {
return new Promise((resolve, reject) => {
try {
resolve(GM_getValue.apply(null, args));
} catch (e) {
reject(e);
}
});
};
}
if(typeof GM_setValue !== "undefined" && typeof GM.setValue === "undefined") {
GM.setValue = function(...args) {
return new Promise((resolve, reject) => {
try {
resolve(GM_setValue.apply(null, args));
} catch (e) {
reject(e);
}
});
};
}
var gmMenu = GM.registerMenuCommand || GM_registerMenuCommand;
/* ---------- */
/* les images */
/* ---------- */
var img_burger_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAACs0lEQVR42qSTz2tcVRzFP99773vz3ryZZDpNQ2J%2BNF00sQouqmhJCgVxURFd6Kp%2FgK6z6Mq1u9aVIO4EpbpRcCf4C1RcKFgapTjWxEIwQ5wx7YzTmXnvvvvudRERXPeszuYczuFwJITAw8CU7wtRex5OrkM2D3GziTKPocyTNBZXcdaS%2F9UBdvDuF%2BzYM%2BnhurexwyPM%2F%2BxUfIkou0IyewExZ5GojjGB5soRle2Q3%2FsCV9wAdv9LIAAiLUTeJlRXCAHsFJSCYgRKCyqaQ%2BQiUXYRl2%2Bj4zdA3gQwDmKTjz6kf%2F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zln5AAAAAElFTkSuQmCC";
var img_close = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAABzElEQVR42p2Sz0sCURDHH%2BbiU9ToB4LiD8Iu8ihQKBI0WEEUwYMdOkiXLp0i69CpDkERUVBQRBAUHTp0MCEKCipJi37QD%2Bj%2FWZlmXhpKu0UNPHaWt5%2BZ73xnGftjXPn9NsPLh3g8gEcY3V%2F6%2FeLM6y0cu93DuvBTIgGPqgp3g4NCD74OBKASCsGhy3W0390d%2Bga%2FZrPy3A8NQbWv76vIuc8nsADcRiLwkskA5dudnYU1p9PUKMDvo9HaczoN7%2Fk8UDEsANiRJEu4Gg4D3ddhbdXhUFok3g4M8Gp%2Fv%2FYQi8FbLgf0LPf0AHaXxZ6SSZlvtrcTzHVNwvk4QhpJpVGoI4GkCJXABsIrRnCTWfzU6609p1JwgR0xBxwR1p3O2q8wxYnHQ3PLbWAOJTzoD80N81ar%2BBHGjwV1vOntlR4QiCuV7hfdbliy22FaUYQhTB3LwaAEqTOapS3a7TXcOVSEgAOXC2YtFhhnrLUI%2Flmi1ATjO6x8wnzOauUziqJtdXRIZTs4ymRbG4w2F8E%2FSyWI1laswws225dhCPAJk4nWB7tdXTBlNsMIY2qLCjRJ3UOpyygZzfrm9hhjPM%2BYpgs3Ak1S9eBGoGxuCP83PgCikeJyFDsSMAAAAABJRU5ErkJggg%3D%3D";
var img_select = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAIAQMAAAAY6OeMAAAABlBMVEV1bGWIiIhRreupAAAAAXRSTlMAQObYZgAAAB9JREFUeNpjYGBgqP%2FAYP%2BAQf4AA38DAzsDAxNQiAEAP1wEBmEVxtQAAAAASUVORK5CYII%3D";
var img_reset = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs%2B9AAABhklEQVQY0wXBT0iTcRjA8e%2Fz%2FN537%2FvamjVa7lSUhUbsEiQRQf%2BoQ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vRo0dCQA0tILxu3TphoKYQoObbQP5NIJ6N4QKQzSDNIMzPzx%2BMLg%2FU7AjEl6GGNGLzBQfQkCyoZiZ0SZAroYaEnjlzhhUuYW9vz6Grq1sNxN3e3t6ChMIK6BU%2BUJgAcTowdtgYjIyM5mpra%2F%2FV0dH5DzRkLiEDQGEC8gY0huopNwDJCz0yMjJCJHsBKeWxBQUFJQCxFyjAsAXiokWLnBYvXhxWX1%2FPhmFyQEDAJD8%2Fv2%2F%2B%2Fv7vAgMDvdHlgRqdlyxZcg2I7wHZzRgGADVuABrwGWpIAtAWkbKysj4Qzs3NFQXZDNV8B4jnYRgAtNUUZAjUJbwVFRW15eXlr0EYaEgtKCmDbAZpBnpFn2DeAGrMB2p8BsIgNsm5EegFrsrKym4QBrFxqQMANXn6HYPJ7D8AAAAaZmNUTAAAAC0AAAAQAAAAEAAAAAAAAAAAAB8D6AEB8ypIyAAAAWtmZEFUAAAALnjaY2DAAVatWsW5efPmBhAGsRlIBZs2bUrfsmXLdRAGsQlqkJKSshITE9snISExH8jl37ZtWwnQ9jsgDDSkBGgIF5DdCGTPBsrpoWj%2B%2F%2F8%2FI1DzflFR0f9A%2Br%2BwsHDmo0ePhIAaWkB43bp1wkBNIUDNt4H8m0A8G8MFIJtBBoAwkB2ELg%2FU7AjEl6GGNGLzBQdQY6akpGQgkM2ELglyJdSQ0DNnzrDCJTw8PNgtLCwqLS0tO6OiogQJhRXQK3ygMAHidGDssDHY2trOMjc3%2FwnE%2F4AGzSJkAChMQN6AxlA95QbAvAA0oFNLS0uIZC8gpTy22NjY%2BLi4OE9QgBEdiDAA1NgfExPzCYhfgQwhORqBGtcCXfAOakhcT0%2BPSGtrazcI19fXixBMSEDNJkCb14JcEhoaytPW1lYN1PwchFtaWqqBzsadlLEBoMZcoMbHIAxik5wbgc7mam9v7wBhEBuXOgDZvgVwR0IA4QAAAABJRU5ErkJggg%3D%3D";
/* -------------- */
/* les constantes */
/* -------------- */
const reho = {
st: {
http: "http://reho.st/",
https: "https://reho.st/",
}
};
const hostname_re = /^https?:\/\/(?:[^;\/?:@=&]*\.)?([^.;\/?:@=&]+\.[^.;\/?:@=&]+)\/.*$/i;
const image_re = /^.*\.(?:gif|jpe?g|png|webp|avif|svg)(?:[&?].*)?$/i;
const gif_re = /^.*\.gif(?:[&?].*)?$/i;
const gifv_re = /^.*\.gifv(?:[&?].*)?$/i;
const webp_re = /^.*\.webp(?:[&?].*)?$/i;
const svg_re = /^.*\.svg(?:[&?].*)?$/i;
const rehost_list = [
reho.st.https,
"https://rehost.a-suivre.com/",
"https://rehost.a-suivre.org/",
"https://rehost.netlib.re/",
"https://rehost.codelib.re/",
"https://rehost.changeip.org/",
"https://rehost.mynumber.org/",
];
const char_list = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const test_rehost_img_src = "http://roger21.free.fr/test/test-sar-";
const test_rehost_img_src_ext = ".png";
const textarea_width_default = "225px";
const textarea_height_default = "145px";
const click_burger_time = 300;
/* ---------------------- */
/* les options par défaut */
/* ---------------------- */
var rehost_type_default = "auto"; // auto ou perso
var rehost_auto_default = reho.st.https;
var rehost_perso_default = "https://images.weserv.nl/?n=-1&url=";
var stealth_rehost_default = false;
var no_rehost_gif_default = true;
var no_rehost_gifv_default = true;
var no_rehost_webp_default = true;
var no_rehost_svg_default = true;
var host_list_default = "2shared.com\n4cdn.org\n4chan.org\n4gifs.com\n4plebs.org\n9cache.com\nabm-enterprises.net\nabricocotier.fr\nac.uk\nafrojacks.com\nagoravox.fr\nakamaihd.net\nakamaized.net\nalkaspace.com\nall-that-is-interesting.com\nallmoviephoto.com\nalternatehistory.com\namazonaws.com\nambinet.pl\nangelfire.com\nanimeclick.it\nanub.ru\narchive-host.com\narwen-undomiel.com\nassiettesgourmandes.fr\naufeminin.com\nauto-moto.com\nazurs.net\nb3ta.com\nb3tards.com\nbangkokpost.com\nbdfci.com\nbighugelabs.com\nbleedingcool.net\nblogger.com\nblogomaniac.fr\nblogspot.com\nboomsbeat.com\nboredpanda.com\nbouletcorp.com\nbrsimg.com\nburrardstreetjournal.com\nbusinessinsider.com\ncanardpc.com\ncannaweed.com\ncasimages.com\ncavemancircus.com\ncdn.li\ncdninstagram.com\ncelebritysizes.com\nchickencrap.com\nchillmag.fr\nchzbgr.com\ncinefaniac.fr\ncinemapassion.com\ncinemotions.com\nclien.net\ncloudfront.net\nco.nz\nco.uk\ncomicartcommunity.com\ncomplex.com\nconcordefly.com\ncoolfunpics.com\ncoolmemes.net\ncopypast.ru\ncosmovisions.com\ncrif.org\ncsf-sonorisation.fr\ndailyscene.com\ndailysilvernews.com\ndandies.fr\ndavisenterprise.com\ndefensereview.com\ndemotivateur.fr\ndeviantart.com\ndeviantart.net\ndosgamesarchive.com\ndrole.net\ndrugs-plaza.com\ndukascopy.com\ndvdactive.com\ndvdbeaver.com\ndvdrama.com\ndynamictic.info\neatmedaily.com\nebaumsworld.com\necho.cx\necranlarge.com\nedgecastcdn.net\nedtruthan.com\negaliteetreconciliation.fr\negloos.com\negotastic.com\nehowa.com\nelbakin.net\nencyclopediadramatica.com\nenglishrussia.com\netsystatic.com\nevilox.com\nexaminer.com\nexplosm.net\neyetricks.com\nezgif.com\nfacebook.com\nfairfaxunderground.com\nfanpop.com\nfbcdn.net\nfilmschoolrejects.com\nfjcdn.com\nflickr.com\nfohguild.org\nfond-ecran-image.com\nfond-ecran-image.fr\nfoodbev.com\nfoundshit.com\nfree.fr\nfreeimagehosting.net\nfunkyimg.com\nfunlol.ru\nfunnyjunk.com\nfuntasticus.com\ngamefabrique.com\ngamefaqs.net\ngannett-cdn.com\ngarageclothing.com\ngentside.com\nggpht.com\ngidilounge.com\ngiftube.com\nglitterphoto.net\ngoldenmoustache.com\ngopix.fr\ngreluche.info\ngrospixels.com\ngtsstatic.com\ngurumed.org\nh6img.com\nhaltbrac-defense.fr\nhaluze.sk\nhiboox.com\nhkgn.info\nhomotron.net\nhorrortalk.com\nhostelworld.com\nhostingpics.net\nhotchyx.com\nhotflick.net\nhumour.com\nhypeful.com\ni.pbase.com\niapdesign.com\nicdn.pro\niespana.es\nifengimg.com\nimagehaven.net\nimages-droles.com\nimagescream.com\nimageshack.us\nimagevenue.com\nimagup.com\nimportantwebsite.com\nindustrytap.com\ninexes.com\ninstagram.com\nizismile.com\njeuxmangas.net\njeuxvideo.com\njj.am\njkbeauty.com\njoelecorbeau.com\njournalofmusic.com\njoystiq.com\njudgehype.com\nkapook.com\nkoreus.com\nleboncoin.fr\nledeguisement.com\nleenks.com\nlelombrik.net\nlequipe.fr\nlesblaguesdroles.com\nley925.com\nlicdn.com\nliveinternet.ru\nlivejournal.com\nlivejournal.net\nliveleak.com\nlivenationinternational.com\nlolpix.com\nloveroms.com\nmac.com\nmalgusto.com\nmarmucommerce.com\nmask9.com\nmaxisciences.com\nmedia-imdb.com\nmegaportail.com\nmemearchive.net\nmemecenter.com\nmetalorgie.com\nmil.ru\nmission0ps.com\nmmo-champion.com\nmonde-diplomatique.fr\nmondespersistants.com\nmotherlessmedia.com\nmoviecovers.com\nmovieia.info\nmoviesmedia.ign.com\nmu.nu\nmuchosucko.com\nmxstatic.com\nmyblog.de\nmypixelz.fr\nmyspace.com\nmyspacecdn.com\nnatgeo.fi\nnaver.net\nnet.co\nnewmuse.com\nnews-de-stars.com\nniketalk.com\nnnm.ru\nno-ip.org\nnocookie.net\nnoelshack.com\nnofrag.com\nnonexiste.net\nnudebabes.ws\noddee.com\nompldr.org\norg.uk\noritive.com\nossiane.net\nover-blog.com\novh.net\nparanoias.es\npeniche-demoiselle.com\npete.com\nphautom.com\nphotobucket.com\nphotographyblog.com\nphotomonde.fr\nphotorumors.com\npigroll.com\npinimg.com\npiximus.net\nplayfire.com\npluizuit.be\npostimage.org\npostimg.org\nprogourmet.fr\nquartermoonsaloon.com\nquenelplus.com\nquizz.biz\nradikal.ru\nratemyeverything.net\nreddit.com\nreplikultes.net\nreversegif.com\nrockingfacts.com\ns2ki.com\nsaintseiyapedia.com\nsankakustatic.com\nse7en.ru\nseries-80.net\nservimg.com\nsfsignal.com\nsharenator.com\nshowlinephoto.com\nskipsfotografen.no\nskoftenmedia.com\nskyrock.com\nslightlywarped.com\nsmog.pl\nsmugmug.com\nsoupcdn.com\nspam.com\nspi0n.com\nsplitscreenpodcast.com\nsports.fr\nstarer.ru\nstereomaker.net\nsts116.com\nsyn.fr\nt-nation.com\ntattoo-tatouages.com\ntechno-science.net\ntheexpressionist.com\nthehighdefinite.com\ntheladbible.com\ntheplanetstoday.com\ntheshadefiles.com\nthg.ru\nthisnext.com\nthreadbombing.com\ntickld.com\ntinypic.com\ntonmo.com\ntoyzoo.com\ntqn.com\ntribalfusion.com\ntruffaut.com\ntryxy.net\ntu-dresden.de\ntumblr.com\ntuxboard.com\ntvmuse.com\ntwimg.com\ntwitpic.com\nucoz.com\nucrazy.ru\nufl.edu\nufunk.net\nuncyc.org\nuppix.net\nupsimple.com\nuserapi.com\nuuuploads.com\nvatican.va\nvermontdailynews.com\nveroniqueetlachouquetterie.fr\nviepratique.fr\nvox-cdn.com\nwallbase.cc\nwallbase2.net\nwallpaper-s.org\nweb-libre.org\nweb-mobile.net\nwhatthemovie.com\nwhitesites.com\nwordpress.com\nworldofwarcraft.com\nwp.com\nxin70.info\nxkcd.com\nxs.to\nyahoo.com\nyandex.ru\nyimg.com\nyionel.fr\nyoupimobile.com\nytmnd.com\nzegagnant.com\nzepload.com\nzgeek.com\nzicabloc.com\nzigonet.com\nzimagez.com\nzimbio.com\nzooplus.de\nzupimages.net";
var white_list_default = "hardware.fr\nreho.st";
/* ---------------------- */
/* les variables globales */
/* ---------------------- */
var img_burger;
var rehost_type;
var rehost_auto;
var rehost_perso;
var stealth_rehost;
var no_rehost_gif;
var no_rehost_gifv;
var no_rehost_webp;
var no_rehost_svg;
var host_list;
var white_list;
var the_rehost;
var real_white_list;
var test_result;
var input_timer;
var rehost_close;
var click_burger_last_call = 0;
var click_burger_timer;
/* ---------------------- */
/* les fonctions globales */
/* ---------------------- */
// fonction d'extraction du nom de domaine d'une url
function get_hostname(p_url) {
let l_matches = hostname_re.exec(p_url);
return (l_matches && l_matches.length > 0) ? l_matches[1] : null;
}
// fonction de transformation d'une liste (chaine) en liste (tableau) avec nettoyage et de tri
function get_list_from_string(p_string) {
return p_string.trim().split("\n").map(function(p_elmt) {
return p_elmt.trim();
}).sort();
}
// fonction de transformation d'une liste (tableau) en liste (chaine)
function get_string_from_list(p_list) {
return p_list.join("\n");
}
// fonction de récupération du rehost en fonction des paramètres
function get_rehost() {
return rehost_type === "auto" ? rehost_auto : rehost_perso;
}
// fonction de désactivation de l'action par défaut sur un événement
function prevent_default(p_event) {
p_event.preventDefault();
}
/* -------------------------- */
/* les fonctions de réhostage */
/* -------------------------- */
// fonction de la gestion du stealth rehost
function do_stealth_rehost() {
let l_alt_title = "Stealth rehost: ";
for(let l_prefix of [reho.st.http, reho.st.https]) {
let l_imgs = document.querySelectorAll("img[src^=\"" + l_prefix + "\"]");
for(let l_img of l_imgs) {
let l_new_src = the_rehost + l_img.getAttribute("src").substr(l_prefix.length);
l_img.setAttribute("src", l_new_src);
l_img.setAttribute("alt", l_alt_title + l_new_src);
l_img.setAttribute("title", l_alt_title + l_new_src);
}
let l_links = document.querySelectorAll("a[href^=\"" + l_prefix + "\"]");
for(let l_link of l_links) {
let l_href = l_link.getAttribute("href");
let l_new_href = the_rehost + l_href.substr(l_prefix.length);
l_link.setAttribute("href", l_new_href);
l_link.setAttribute("title", l_alt_title + l_new_href);
if(l_link.firstChild && l_link.firstChild.nodeType === 3 &&
l_link.firstChild.nodeValue.trim() !== ""
/*&& l_link.firstChild.nodeValue.indexOf(l_href.substr(0, 34)) === 0*/
) {
l_link.insertBefore(document.createTextNode(l_alt_title), l_link.firstChild);
}
}
}
}
// fonction de gestion d'un rehostage raté, on revient à la version non réhosté
function rehost_error(p_event) {
let l_alt_title_error = "NotRehost: ";
let l_orig_src = this.dataset.gmhfrsarr21src;
if(this.getAttribute("src") === l_orig_src) {
//console.log("SAR NotRehost FAIL " + l_orig_src);
return;
}
//console.log("SAR NotRehost " + l_orig_src);
this.setAttribute("src", l_orig_src);
this.setAttribute("alt", l_alt_title_error + l_orig_src);
this.setAttribute("title", l_alt_title_error + l_orig_src);
}
// fonction de réhostage des images et des liens
function do_rehost(p_para = null) {
let l_alt_title = "Rehost: ";
let l_root = p_para ? p_para : document;
let l_query = p_para ? ":scope " :
"div#mesdiscussions.mesdiscussions table.messagetable " +
"tbody tr.message td.messCase1 + td.messCase2 > div[id^=\"para\"] ";
let l_imgs = l_root.querySelectorAll(l_query + "img[src]:not([src^=\"data:image\"])");
for(let l_img of l_imgs) {
let l_src = l_img.getAttribute("src");
if((!no_rehost_gif || !gif_re.test(l_src)) &&
(!no_rehost_gifv || !gifv_re.test(l_src)) &&
(!no_rehost_webp || !webp_re.test(l_src)) &&
(!no_rehost_svg || !svg_re.test(l_src))) {
let l_host = get_hostname(l_src);
if(l_host && !real_white_list.includes(l_host) && host_list.includes(l_host)) {
let l_new_src = the_rehost + l_src;
if(rehost_type === "perso") {
l_new_src = the_rehost + encodeURIComponent(l_src);
}
l_img.dataset.gmhfrsarr21host = l_host;
l_img.dataset.gmhfrsarr21src = l_src;
// gestion du déréhostage en cas d'échec
l_img.addEventListener("error", rehost_error, false);
// réhostage
l_img.setAttribute("src", l_new_src);
l_img.setAttribute("alt", l_alt_title + l_new_src);
l_img.setAttribute("title", l_alt_title + l_new_src);
}
}
}
let l_links = l_root.querySelectorAll(
l_query + "> span:not(.signature) a.cLink[href], " +
l_query + "> div:not(.edited) a.cLink[href], " +
l_query + "> *:not(span):not(div) a.cLink[href]");
for(let l_link of l_links) {
let l_href = l_link.getAttribute("href");
if((!no_rehost_gif || !gif_re.test(l_href)) &&
//(!no_rehost_gifv || !gifv_re.test(l_href)) &&
(!no_rehost_webp || !webp_re.test(l_href)) &&
(!no_rehost_svg || !svg_re.test(l_href))) {
let l_host = get_hostname(l_href);
if(l_host && image_re.test(l_href) &&
!real_white_list.includes(l_host) && host_list.includes(l_host)) {
let l_new_href = the_rehost + l_href;
if(rehost_type === "perso") {
l_new_href = the_rehost + encodeURIComponent(l_href);
}
l_link.dataset.gmhfrsarr21href = l_href;
l_link.setAttribute("href", l_new_href);
l_link.setAttribute("title", l_alt_title + l_new_href);
if(l_link.firstChild &&
l_link.firstChild.nodeType === 3 && l_link.firstChild.nodeValue.trim() !== ""
/*&& l_link.firstChild.nodeValue.indexOf(l_href.substr(0, 34)) === 0*/
) {
let l_new_text_node = document.createElement("span");
l_new_text_node.appendChild(document.createTextNode(l_alt_title));
l_new_text_node.setAttribute("class", "gm_hfr_sar_r21_new_text_node");
l_link.insertBefore(l_new_text_node, l_link.firstChild);
}
}
}
}
}
// fonction de dé-réhostage des images et des liens
function un_rehost(p_para) {
let l_found_some = false;
let l_imgs = p_para.querySelectorAll(":scope img[src][data-gmhfrsarr21src]");
for(let l_img of l_imgs) {
l_found_some = true;
let l_orig_src = l_img.dataset.gmhfrsarr21src;
l_img.removeEventListener("error", rehost_error, false);
l_img.setAttribute("src", l_orig_src);
l_img.setAttribute("alt", l_orig_src);
l_img.setAttribute("title", l_orig_src);
}
let l_links = p_para.querySelectorAll(":scope a.cLink[href][data-gmhfrsarr21href]");
for(let l_link of l_links) {
l_found_some = true;
let l_orig_href = l_link.dataset.gmhfrsarr21href;
l_link.setAttribute("href", l_orig_href);
l_link.removeAttribute("title");
}
let l_new_text_nodes = p_para.querySelectorAll(":scope span.gm_hfr_sar_r21_new_text_node");
for(let l_new_text_node of l_new_text_nodes) {
l_found_some = true;
l_new_text_node.parentNode.removeChild(l_new_text_node);
}
return l_found_some;
}
/* -------------- */
/* les styles css */
/* -------------- */
var style = document.createElement("style");
style.setAttribute("type", "text/css");
style.textContent =
// style pour les boutons (burger)
"img.gm_hfr_sar_r21_button{cursor:pointer;width:16px;height:16px;}" +
"img.gm_hfr_sar_r21_button.gm_hfr_sar_r21_unrehosted{filter:saturate(0);}" +
"@keyframes gm_hfr_sar_r21_none_unrehosted_animation{0%{filter:opacity(0);}50%{filter:opacity(1);}100%{filter:opacity(0);}}" +
"img.gm_hfr_sar_r21_button.gm_hfr_sar_r21_none_unrehosted{animation:" +
"gm_hfr_sar_r21_none_unrehosted_animation 0.25s step-end 0s 4 normal none running;}" +
// styles pour la fenêtre d'aide
"#gm_hfr_sar_r21_help_window{position:fixed;width:200px;height:auto;background-color:#e3ebf5;" +
"visibility:hidden;border:2px solid #6995c3;border-radius:8px;padding:4px 7px 5px;" +
"font-family:Verdana,Arial,Sans-serif,Helvetica;font-weight:bold;text-align:justify;" +
"font-size:11px;z-index:1003;}" +
"img.gm_hfr_sar_r21_help_button{cursor:help;vertical-align:text-bottom;}" +
// styles pour la fenêtre de configuration
"#gm_hfr_sar_r21_config_background{position:fixed;left:0;top:0;background-color:#242424;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;z-index:1001;}" +
"#gm_hfr_sar_r21_config_window{position:fixed;min-width:400px;height:auto;background:#ffffff;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;font-size:12px;padding:16px;" +
"font-family:Verdana,Arial,Sans-serif,Helvetica;border:1px solid #242424;z-index:1002;}" +
"#gm_hfr_sar_r21_config_window div.gm_hfr_sar_r21_main_title{font-size:16px;text-align:center;" +
"font-weight:bold;margin:0 0 10px;}" +
"#gm_hfr_sar_r21_config_window fieldset{margin:0 0 8px;border:1px solid #888888;" +
"padding:6px 10px 10px;}" +
"#gm_hfr_sar_r21_config_window legend{font-size:14px;}" +
// styles pour les elements des formulaires
"#gm_hfr_sar_r21_config_window input[type=\"radio\"]{margin:0 0 2px;vertical-align:text-bottom;}" +
"#gm_hfr_sar_r21_config_window input[type=\"text\"]{padding:1px 4px;border:1px solid #c0c0c0;" +
"font-size:12px;font-family:Verdana,Arial,Sans-serif,Helvetica;box-sizing:border-box;" +
"height:20px;}" +
"#gm_hfr_sar_r21_config_window input[type=\"checkbox\"]" +
"{margin:0 0 1px;vertical-align:text-bottom;}" +
"#gm_hfr_sar_r21_config_window select{padding:0;margin:0;border:1px solid #c0c0c0;width:250px;" +
"font-size:12px;font-family:Verdana,Arial,Sans-serif,Helvetica;appearance:none;height:20px;" +
"-moz-appearance:none;-webkit-appearance:none;background-image:url(\"" + img_select + "\");" +
"background-repeat:no-repeat;background-position:right 5px center;box-sizing:border-box;}" +
"#gm_hfr_sar_r21_config_window select option{appearance:none;-moz-appearance:none;" +
"-webkit-appearance:none;font-size:12px;font-family:Verdana,Arial,Sans-serif,Helvetica;}" +
"#gm_hfr_sar_r21_config_window textarea{margin:0;padding:0 2px;border:1px solid #c0c0c0;" +
"font-size:12px;font-family:Verdana,Arial,Sans-serif,Helvetica;display:block;" +
"min-width:" + textarea_width_default + ";min-height:" + textarea_height_default + ";}" +
// styles pour les p et les div
"#gm_hfr_sar_r21_config_window p{margin:0 0 0 4px;}" +
"#gm_hfr_sar_r21_config_window p.gm_hfr_sar_r21_no_margin{margin-left:0;}" +
"#gm_hfr_sar_r21_config_window p:not(:last-child){margin-bottom:4px;}" +
"#gm_hfr_sar_r21_config_window p.gm_hfr_sar_r21_button_p_flex{display:flex;" +
"justify-content:center;align-items:center;}" +
"#gm_hfr_sar_r21_config_window p.gm_hfr_sar_r21_button_p_flex > *{display:block;}" +
"#gm_hfr_sar_r21_config_window img.gm_hfr_sar_r21_test_img{margin:0 4px 0 0;" +
"width:16px;height:16px;}" +
"#gm_hfr_sar_r21_config_window img.gm_hfr_sar_r21_reset_img{cursor:pointer;margin:0 0 0 4px;}" +
"#gm_hfr_sar_r21_config_window div.gm_hfr_sar_r21_rehost_choice_div_flex{display:flex;" +
"align-items:center;}" +
"#gm_hfr_sar_r21_config_window div.gm_hfr_sar_r21_rehost_choice_div_img_flex{display:flex;" +
"align-self:stretch;justify-content:center;align-items:center;flex-grow:1;order:-1;" +
"margin:0 10px 0 0;border:1px solid #c0c0c0;}" +
"#gm_hfr_sar_r21_config_window img.gm_hfr_sar_r21_test_rehost_img{display:block;height:auto;}" +
"#gm_hfr_sar_r21_config_window div.gm_hfr_sar_r21_test_rehost_img_alt{font-weight:bold;" +
"color:#df5f5f;display:none;height:auto;cursor:default;}" +
"#gm_hfr_sar_r21_config_window p.gm_hfr_sar_r21_stealth_rehost_p{margin-top:5px;}" +
"#gm_hfr_sar_r21_config_window " +
"div.gm_hfr_sar_r21_lists_div_flex{display:flex;justify-content:space-between;}" +
"#gm_hfr_sar_r21_config_window div.gm_hfr_sar_r21_no_rehost_div_flex" +
"{display:flex;justify-content:space-around;}" +
"div.gm_hfr_sar_r21_save_close_div{text-align:right;margin:16px 0 0;}" +
"div.gm_hfr_sar_r21_save_close_div div.gm_hfr_sar_r21_info_reload_div{float:left;}" +
"div.gm_hfr_sar_r21_save_close_div div.gm_hfr_sar_r21_info_reload_div " +
"img{vertical-align:text-bottom;}" +
"div.gm_hfr_sar_r21_save_close_div > img{margin-left:8px;cursor:pointer;}" +
// styles pour la fenêtre de rehost
"#gm_hfr_sar_r21_rehost_background{position:fixed;left:0;top:0;background-color:#242424;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;z-index:1001;}" +
"#gm_hfr_sar_r21_rehost_window{position:fixed;min-width:200px;height:auto;background:#ffffff;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;font-size:12px;padding:16px;" +
"font-family:Verdana,Arial,Sans-serif,Helvetica;border:1px solid #242424;z-index:1002;}" +
"#gm_hfr_sar_r21_rehost_window.gm_hfr_sar_r21_no_choice, " +
"#gm_hfr_sar_r21_rehost_window.gm_hfr_sar_r21_no_choice *{cursor:default;}" +
"#gm_hfr_sar_r21_rehost_window div.gm_hfr_sar_r21_rehost_main_title{font-size:14px;" +
"text-align:center;font-weight:bold;}" +
"#gm_hfr_sar_r21_rehost_window div.gm_hfr_sar_r21_rehost_title{font-size:12px;font-weight:bold;" +
"margin:12px 0 6px;}" +
"#gm_hfr_sar_r21_rehost_window p{margin:0 0 2px 4px;}" +
"#gm_hfr_sar_r21_rehost_window input[type=\"checkbox\"]{margin:0 0 1px;" +
"vertical-align:text-bottom;}";
document.getElementsByTagName("head")[0].appendChild(style);
/* --------------------------------------- */
/* création de la fenêtre de configuration */
/* --------------------------------------- */
// création de la fenêtre d'aide
var help_window = document.createElement("div");
help_window.setAttribute("id", "gm_hfr_sar_r21_help_window");
document.body.appendChild(help_window);
// fonction de création du bouton d'aide
function create_help_button(p_width, p_text) {
let help_button = document.createElement("img");
help_button.setAttribute("src", img_help);
help_button.setAttribute("class", "gm_hfr_sar_r21_help_button");
help_button.addEventListener("mouseover", function(e) {
help_window.style.width = p_width + "px";
help_window.textContent = p_text;
help_window.style.left = (e.clientX + 32) + "px";
help_window.style.top = (e.clientY - 16) + "px";
help_window.style.visibility = "visible";
}, false);
help_button.addEventListener("mouseout", function(e) {
help_window.style.visibility = "hidden";
}, false);
return help_button;
}
// création du voile de fond pour la fenêtre de configuration
var config_background = document.createElement("div");
config_background.setAttribute("id", "gm_hfr_sar_r21_config_background");
config_background.addEventListener("click", hide_config_window, false);
config_background.addEventListener("transitionend", background_transitionend, false);
config_background.addEventListener("contextmenu", prevent_default, false);
document.body.appendChild(config_background);
// création de la fenêtre de configuration
var config_window = document.createElement("div");
config_window.setAttribute("id", "gm_hfr_sar_r21_config_window");
config_window.addEventListener("contextmenu", prevent_default, false);
document.body.appendChild(config_window);
// titre de la fenêtre de configuration
var main_title = document.createElement("div");
main_title.setAttribute("class", "gm_hfr_sar_r21_main_title");
main_title.textContent = "Conf du script [HFR] Smart Auto Rehost";
config_window.appendChild(main_title);
// section button
var button_fieldset = document.createElement("fieldset");
var button_legend = document.createElement("legend");
button_legend.textContent = "Icône du bouton";
button_fieldset.appendChild(button_legend);
config_window.appendChild(button_fieldset);
var button_p = document.createElement("p");
button_p.setAttribute("class", "gm_hfr_sar_r21_button_p_flex");
var button_test_img = document.createElement("img");
button_test_img.setAttribute("class", "gm_hfr_sar_r21_test_img");
button_p.appendChild(button_test_img);
var button_input = document.createElement("input");
button_input.setAttribute("id", "gm_hfr_sar_r21_button_input");
button_input.setAttribute("type", "text");
button_input.setAttribute("spellcheck", "false");
button_input.setAttribute("size", "50");
button_input.setAttribute("title", "url de l'icône (http ou data)");
button_input.addEventListener("focus", function() {
button_input.select();
}, false);
function button_do_test_img() {
button_test_img.setAttribute("src", button_input.value.trim());
button_input.setSelectionRange(0, 0);
button_input.blur();
}
button_input.addEventListener("input", button_do_test_img, false);
button_p.appendChild(button_input);
var button_reset_img = document.createElement("img");
button_reset_img.setAttribute("src", img_reset);
button_reset_img.setAttribute("class", "gm_hfr_sar_r21_reset_img");
button_reset_img.setAttribute("title", "remettre l'icône par défaut");
function button_do_reset_img() {
button_input.value = img_burger_default;
button_do_test_img();
}
button_reset_img.addEventListener("click", button_do_reset_img, false);
button_p.appendChild(button_reset_img);
button_fieldset.appendChild(button_p);
// section rehost_choice
var rehost_choice_fieldset = document.createElement("fieldset");
var rehost_choice_legend = document.createElement("legend");
rehost_choice_legend.textContent = "Choix du rehost";
rehost_choice_fieldset.appendChild(rehost_choice_legend);
config_window.appendChild(rehost_choice_fieldset);
var rehost_choice_div = document.createElement("div");
rehost_choice_div.setAttribute("class", "gm_hfr_sar_r21_rehost_choice_div_flex");
rehost_choice_fieldset.appendChild(rehost_choice_div);
var rehost_choice_div_choice = document.createElement("div");
rehost_choice_div.appendChild(rehost_choice_div_choice);
function rand_char() {
return char_list[Math.floor(Math.random() * char_list.length)];
}
function update_test_rehost_img(p_rehost) {
if(p_rehost === "") {
p_rehost = "nope";
}
let l_rand = "";
for(let i = 0; i < 10; ++i) {
l_rand += rand_char();
}
var l_src = p_rehost + test_rehost_img_src + l_rand + test_rehost_img_src_ext;
test_rehost_img.setAttribute("src", img_throbber);
window.setTimeout(function() {
test_rehost_img.setAttribute("src", l_src);
}, 250);
}
function update_rehost_choice() {
if(rehost_auto_radio.checked) { // auto
update_test_rehost_img(rehost_auto_select.value);
if(rehost_auto_select.value === reho.st.https) {
stealth_rehost_p.style.display = "none";
} else {
stealth_rehost_p.style.display = "block";
}
} else { // perso
update_test_rehost_img(rehost_perso_input.value.trim());
stealth_rehost_p.style.display = "block";
}
}
// rehost_auto
var rehost_auto_p = document.createElement("p");
rehost_auto_p.setAttribute("class", "gm_hfr_sar_r21_no_margin");
var rehost_auto_radio = document.createElement("input");
rehost_auto_radio.setAttribute("type", "radio");
rehost_auto_radio.setAttribute("id", "gm_hfr_sar_r21_rehost_auto_radio");
rehost_auto_radio.setAttribute("name", "gm_hfr_sar_r21_rehost_radios");
rehost_auto_radio.addEventListener("change", update_rehost_choice, false);
rehost_auto_p.appendChild(rehost_auto_radio);
var rehost_auto_label = document.createElement("label");
rehost_auto_label.textContent = " reho.st ou alias : ";
rehost_auto_label.setAttribute("for", "gm_hfr_sar_r21_rehost_auto_radio");
rehost_auto_p.appendChild(rehost_auto_label);
var rehost_auto_select = document.createElement("select");
for(let rehost of rehost_list) {
let option = document.createElement("option");
option.textContent = rehost;
option.setAttribute("value", rehost);
rehost_auto_select.appendChild(option);
}
rehost_auto_select.addEventListener("change", function() {
if(rehost_auto_radio.checked) {
update_rehost_choice();
}
}, false);
rehost_auto_p.appendChild(rehost_auto_select);
rehost_choice_div_choice.appendChild(rehost_auto_p);
// rehost_perso
var rehost_perso_p = document.createElement("p");
rehost_perso_p.setAttribute("class", "gm_hfr_sar_r21_no_margin");
var rehost_perso_radio = document.createElement("input");
rehost_perso_radio.setAttribute("type", "radio");
rehost_perso_radio.setAttribute("id", "gm_hfr_sar_r21_rehost_perso_radio");
rehost_perso_radio.setAttribute("name", "gm_hfr_sar_r21_rehost_radios");
rehost_perso_radio.addEventListener("change", update_rehost_choice, false);
rehost_perso_p.appendChild(rehost_perso_radio);
var rehost_perso_label = document.createElement("label");
rehost_perso_label.textContent = " rehost perso : ";
rehost_perso_label.setAttribute("for", "gm_hfr_sar_r21_rehost_perso_radio");
rehost_perso_p.appendChild(rehost_perso_label);
var rehost_perso_input = document.createElement("input");
rehost_perso_input.setAttribute("type", "text");
rehost_perso_input.setAttribute("spellcheck", "false");
rehost_perso_input.setAttribute("size", "38");
rehost_perso_input.setAttribute("maxLength", "100");
rehost_perso_input.addEventListener("input", function() {
window.clearTimeout(input_timer);
input_timer = window.setTimeout(function() {
if(rehost_perso_radio.checked) {
update_rehost_choice();
}
}, 250);
}, false);
rehost_perso_input.addEventListener("focus", function() {
rehost_perso_input.select();
}, false);
rehost_perso_p.appendChild(rehost_perso_input);
rehost_choice_div_choice.appendChild(rehost_perso_p);
// test_rehost
var rehost_choice_div_img = document.createElement("div");
rehost_choice_div_img.setAttribute("class", "gm_hfr_sar_r21_rehost_choice_div_img_flex");
rehost_choice_div_img.setAttribute("title", "image de test");
var test_rehost_img = document.createElement("img");
test_rehost_img.setAttribute("class", "gm_hfr_sar_r21_test_rehost_img");
test_rehost_img.addEventListener("load", function() {
test_result = true;
test_rehost_img.style.display = "block";
test_rehost_img_alt.style.display = "none";
}, false);
test_rehost_img.addEventListener("error", function() {
test_result = false;
test_rehost_img.style.display = "none";
test_rehost_img_alt.style.display = "block";
}, false);
rehost_choice_div_img.appendChild(test_rehost_img);
var test_rehost_img_alt = document.createElement("div");
test_rehost_img_alt.setAttribute("class", "gm_hfr_sar_r21_test_rehost_img_alt");
test_rehost_img_alt.textContent = "ÉCHEC";
rehost_choice_div_img.appendChild(test_rehost_img_alt);
rehost_choice_div.appendChild(rehost_choice_div_img);
// stealth_rehost
var stealth_rehost_p = document.createElement("p");
stealth_rehost_p.setAttribute("class", "gm_hfr_sar_r21_stealth_rehost_p");
var stealth_rehost_checkbox = document.createElement("input");
stealth_rehost_checkbox.setAttribute("type", "checkbox");
stealth_rehost_checkbox.setAttribute("id", "gm_hfr_sar_r21_stealth_rehost_checkbox");
stealth_rehost_p.appendChild(stealth_rehost_checkbox);
var stealth_rehost_label = document.createElement("label");
stealth_rehost_label.textContent =
" convertir les \u00ab\u202freho.st\u202f\u00bb de la page avec le rehost choisi ";
stealth_rehost_label.setAttribute("for", "gm_hfr_sar_r21_stealth_rehost_checkbox");
stealth_rehost_p.appendChild(stealth_rehost_label);
stealth_rehost_p.appendChild(create_help_button(275,
"Cette option permet de contourner les blocages d'accès à \u00ab\u202freho.st\u202f\u00bb " +
"mais suivant les situations vous pouvez aussi ne pas cocher cette option et simplement " +
"rajouter \u00ab\u202freho.st\u202f\u00bb à votre liste des noms de domaine à réhoster."));
rehost_choice_fieldset.appendChild(stealth_rehost_p);
// section no_rehost
var no_rehost_fieldset = document.createElement("fieldset");
var no_rehost_legend = document.createElement("legend");
no_rehost_legend.textContent = "Types de fichiers à ne pas réhoster";
no_rehost_fieldset.appendChild(no_rehost_legend);
config_window.appendChild(no_rehost_fieldset);
var no_rehost_div = document.createElement("div");
no_rehost_div.setAttribute("class", "gm_hfr_sar_r21_no_rehost_div_flex");
no_rehost_fieldset.appendChild(no_rehost_div);
// no_rehost_gif
var no_rehost_gif_div = document.createElement("div");
var no_rehost_gif_checkbox = document.createElement("input");
no_rehost_gif_checkbox.setAttribute("type", "checkbox");
no_rehost_gif_checkbox.setAttribute("id", "gm_hfr_sar_r21_no_rehost_gif_checkbox");
no_rehost_gif_div.appendChild(no_rehost_gif_checkbox);
var no_rehost_gif_label = document.createElement("label");
no_rehost_gif_label.textContent = " .gif ";
no_rehost_gif_label.setAttribute("for", "gm_hfr_sar_r21_no_rehost_gif_checkbox");
no_rehost_gif_div.appendChild(no_rehost_gif_label);
no_rehost_gif_div.appendChild(create_help_button(210,
"Certains gif, typiquement les gif animés, peuvent être trop gros pour être réhostés."));
no_rehost_div.appendChild(no_rehost_gif_div);
// no_rehost_gifv
var no_rehost_gifv_div = document.createElement("div");
var no_rehost_gifv_checkbox = document.createElement("input");
no_rehost_gifv_checkbox.setAttribute("type", "checkbox");
no_rehost_gifv_checkbox.setAttribute("id", "gm_hfr_sar_r21_no_rehost_gifv_checkbox");
no_rehost_gifv_div.appendChild(no_rehost_gifv_checkbox);
var no_rehost_gifv_label = document.createElement("label");
no_rehost_gifv_label.textContent = " .gifv ";
no_rehost_gifv_label.setAttribute("for", "gm_hfr_sar_r21_no_rehost_gifv_checkbox");
no_rehost_gifv_div.appendChild(no_rehost_gifv_label);
no_rehost_gifv_div.appendChild(create_help_button(340,
"Les gifv sont parfois utilisés en tant qu'image sur le forum et peuvent alors être affichés " +
"sous forme de gif ou de webp qui peuvent ne pas être supportés par le rehost choisi. " +
"Note : les liens vers les gifv ne sont jamais réhostés pour préserver la possibilité de " +
"les lire en tant que vidéo."));
no_rehost_div.appendChild(no_rehost_gifv_div);
// no_rehost_webp
var no_rehost_webp_div = document.createElement("div");
var no_rehost_webp_checkbox = document.createElement("input");
no_rehost_webp_checkbox.setAttribute("type", "checkbox");
no_rehost_webp_checkbox.setAttribute("id", "gm_hfr_sar_r21_no_rehost_webp_checkbox");
no_rehost_webp_div.appendChild(no_rehost_webp_checkbox);
var no_rehost_webp_label = document.createElement("label");
no_rehost_webp_label.textContent = " .webp ";
no_rehost_webp_label.setAttribute("for", "gm_hfr_sar_r21_no_rehost_webp_checkbox");
no_rehost_webp_div.appendChild(no_rehost_webp_label);
no_rehost_webp_div.appendChild(create_help_button(230,
"Le webp, qui est un format récent, peut ne pas être géré par le rehost choisi. " +
"(Pour le moment \u00ab\u202freho.st\u202f\u00bb ne le gère pas.)"));
no_rehost_div.appendChild(no_rehost_webp_div);
// no_rehost_svg
var no_rehost_svg_div = document.createElement("div");
var no_rehost_svg_checkbox = document.createElement("input");
no_rehost_svg_checkbox.setAttribute("type", "checkbox");
no_rehost_svg_checkbox.setAttribute("id", "gm_hfr_sar_r21_no_rehost_svg_checkbox");
no_rehost_svg_div.appendChild(no_rehost_svg_checkbox);
var no_rehost_svg_label = document.createElement("label");
no_rehost_svg_label.textContent = " .svg ";
no_rehost_svg_label.setAttribute("for", "gm_hfr_sar_r21_no_rehost_svg_checkbox");
no_rehost_svg_div.appendChild(no_rehost_svg_label);
no_rehost_svg_div.appendChild(create_help_button(185,
"Le svg est un format particulier qui n'est pas très bien géré par " +
"\u00ab\u202freho.st\u202f\u00bb."));
no_rehost_div.appendChild(no_rehost_svg_div);
// section lists
var lists_fieldset = document.createElement("fieldset");
var lists_legend = document.createElement("legend");
lists_legend.textContent = "Listes des noms de domaine";
lists_fieldset.appendChild(lists_legend);
config_window.appendChild(lists_fieldset);
var lists_div = document.createElement("div");
lists_div.setAttribute("class", "gm_hfr_sar_r21_lists_div_flex");
lists_fieldset.appendChild(lists_div);
// host_list
var host_list_div = document.createElement("div");
host_list_div.style.paddingRight = "5px";
lists_div.appendChild(host_list_div);
var host_list_p = document.createElement("p");
var host_list_label = document.createElement("label");
host_list_label.textContent = "à réhoster :";
host_list_label.setAttribute("for", "gm_hfr_sar_r21_host_list_textarea");
host_list_p.appendChild(host_list_label);
host_list_div.appendChild(host_list_p);
var host_list_textarea = document.createElement("textarea");
host_list_textarea.setAttribute("id", "gm_hfr_sar_r21_host_list_textarea");
host_list_textarea.setAttribute("spellcheck", "false");
host_list_div.appendChild(host_list_textarea);
// white_list
var white_list_div = document.createElement("div");
white_list_div.style.paddingLeft = "5px";
lists_div.appendChild(white_list_div);
var white_list_p = document.createElement("p");
var white_list_label = document.createElement("label");
white_list_label.textContent = "à ne pas réhoster : ";
white_list_label.setAttribute("for", "gm_hfr_sar_r21_white_list_textarea");
white_list_p.appendChild(white_list_label);
white_list_p.appendChild(create_help_button(250,
"Le rehost choisi est automatiquement inclus à la liste des noms de domaine à ne pas réhoster, " +
"il est inutile de le rajouter ici."));
white_list_div.appendChild(white_list_p);
var white_list_textarea = document.createElement("textarea");
white_list_textarea.setAttribute("id", "gm_hfr_sar_r21_white_list_textarea");
white_list_textarea.setAttribute("spellcheck", "false");
white_list_div.appendChild(white_list_textarea);
// rechargement de la page et boutons de validation et de fermeture
var save_close_div = document.createElement("div");
save_close_div.setAttribute("class", "gm_hfr_sar_r21_save_close_div");
var info_reload_div = document.createElement("div");
info_reload_div.setAttribute("class", "gm_hfr_sar_r21_info_reload_div");
var info_reload_checkbox = document.createElement("input");
info_reload_checkbox.setAttribute("type", "checkbox");
info_reload_checkbox.setAttribute("id", "gm_hfr_sar_r21_info_reload_checkbox");
info_reload_div.appendChild(info_reload_checkbox);
var info_reload_label = document.createElement("label");
info_reload_label.textContent = " recharger la page ";
info_reload_label.setAttribute("for", "gm_hfr_sar_r21_info_reload_checkbox");
info_reload_div.appendChild(info_reload_label);
info_reload_div.appendChild(create_help_button(255,
"La modification des paramètres de cette fenêtre de configuration n'est visible que sur " +
"les nouvelles pages ou après le rechargement de la page courante. Cette option permet de " +
"recharger automatiquement la page courante lors de la validation."));
save_close_div.appendChild(info_reload_div);
var save_button = document.createElement("img");
save_button.setAttribute("src", img_save);
save_button.setAttribute("title", "Valider");
save_button.addEventListener("click", save_config_window, false);
save_close_div.appendChild(save_button);
var close_button = document.createElement("img");
close_button.setAttribute("src", img_close);
close_button.setAttribute("title", "Annuler");
close_button.addEventListener("click", hide_config_window, false);
save_close_div.appendChild(close_button);
config_window.appendChild(save_close_div);
// fonction de validation de la fenêtre de configuration
function save_config_window() {
// vérification et confirmation
if(!test_result &&
!confirm("L'image de test est en échec, voulez-vous vraiment valider ?")) {
return;
}
// fermeture de la fenêtre
hide_config_window();
// récupération des paramètres
img_burger = button_input.value.trim();
if(img_burger === "") {
img_burger = img_burger_default;
}
rehost_type = rehost_auto_radio.checked ? "auto" : "perso";
rehost_auto = rehost_auto_select.value;
rehost_perso = rehost_perso_input.value.trim();
stealth_rehost = stealth_rehost_checkbox.checked;
no_rehost_gif = no_rehost_gif_checkbox.checked;
no_rehost_gifv = no_rehost_gifv_checkbox.checked;
no_rehost_webp = no_rehost_webp_checkbox.checked;
no_rehost_svg = no_rehost_svg_checkbox.checked;
host_list = get_list_from_string(host_list_textarea.value);
white_list = get_list_from_string(white_list_textarea.value);
the_rehost = get_rehost();
real_white_list = Array.from(white_list);
real_white_list.push(get_hostname(the_rehost));
// enregistrement des paramètres
Promise.all([
GM.setValue("img_burger", img_burger),
GM.setValue("rehost_type", rehost_type),
GM.setValue("rehost_auto", rehost_auto),
GM.setValue("rehost_perso", rehost_perso),
GM.setValue("stealth_rehost", stealth_rehost),
GM.setValue("no_rehost_gif", no_rehost_gif),
GM.setValue("no_rehost_gifv", no_rehost_gifv),
GM.setValue("no_rehost_webp", no_rehost_webp),
GM.setValue("no_rehost_svg", no_rehost_svg),
GM.setValue("host_list", get_string_from_list(host_list)),
GM.setValue("white_list", get_string_from_list(white_list)),
]).then(function() {
if(info_reload_checkbox.checked) {
window.location.reload(true);
}