forked from Taraflex/Back2stackoverflow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
back2source.user.js
1461 lines (1436 loc) · 72.6 KB
/
back2source.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 Back2source
// @version 0.1.159
// @description Redirecting to source sites from sites with machine translation, etc.
// @namespace vladgba
// @author vladgba@gmail.com
// @run-at document-end
// @icon https://www.google.com/s2/favicons?sz=64&domain=stackoverflow.com
// @downloadURL https://github.com/vladgba/Back2source/raw/master/back2source.user.js
// @updateURL https://github.com/vladgba/Back2source/raw/master/back2source.user.js
// @homepageURL https://github.com/vladgba/Back2source
// @supportURL https://github.com/vladgba/Back2source/issues
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @grant GM_getValue
// @connect api.browser.yandex.ru
// @connect api.github.com
// @connect api.stackexchange.com
// @noframes
// @match *://*.16892.net/qa/*
// @match *://*.1r1g.com/sf/ask/*
// @match *://*.360wiki.ru/wiki/*
// @match *://*.55276.net/qa/*
// @match *://*.5axxw.com/*/*/*
// @match *://*.955yes.com/ask/1*.html
// @match *://*.9ishenzhen.com/?qa=*
// @match *://*.abcdef.wiki/*
// @match *://*.amuddycup.com/*
// @match *://*.androidalle.com/pregunta/*
// @match *://*.androiderrors.com/*
// @match *://*.androidrepo.com/repo/*
// @match *://*.answacode.com/*
// @match *://*.answeright.com/*
// @match *://*.answerlib.com/question/*
// @match *://*.answerspoint.com/questions/*/*
// @match *://*.antwortenhier.me/*
// @match *://*.anycodings.com/*
// @match *://*.ape-ask.com/read-*.html
// @match *://*.appsloveworld.com/*/*
// @match *://*.arip-photo.org/*
// @match *://*.ask-dev.ru/info/*
// @match *://*.ask-ubuntu.ru/questions/*
// @match *://*.ask.roboflow.ai/question/*
// @match *://*.askcodez.com/*
// @match *://*.askdev.info/questions/*
// @match *://*.askdev.ru/q*
// @match *://*.askdevz.com/question/*
// @match *://*.askentire.net/q/*-*
// @match *://*.askfrance.me/*
// @match *://*.askubuntu.ru/questions/*
// @match *://*.askvoprosy.com/voprosy/*
// @match *://*.astrophel.org/*
// @match *://*.athabasca-foto.com/*
// @match *://*.awesomeopensource.com/project/*
// @match *://*.bcqaw.com/*.html
// @match *://*.bestofcpp.com/repo/*
// @match *://*.bestofphp.com/repo/*
// @match *://*.bestofreactjs.com/repo/*
// @match *://*.bestofvue.com/repo/*
// @match *://*.bildiredi.com/*
// @match *://*.bilee.com/*.html
// @match *://*.binarydevelop.com/article/*
// @match *://*.bleepcoder.com/*/*
// @match *://*.bootpanic.com/*
// @match *://*.buildwiki.ru/wiki/*
// @match *://*.bytemeta.vip/*
// @match *://*.cache.one/read/*
// @match *://*.cainiaojiaocheng.com/questions/*
// @match *://*.catchconsole.com/code-example/*
// @match *://*.catwolf.org/qs*
// @match *://*.cepe-eua.org/*/*
// @match *://*.cfadnc.org/*
// @match *://*.chowdera.com/*.html
// @match *://*.ciupacabra.com/*
// @match *://*.cloud.tencent.com/developer/ask/*
// @match *://*.cmsdk.com/*/*.html
// @match *://*.cndgn.com/question/*
// @match *://*.code-error.com/*
// @match *://*.code-examples.net/*/q/*
// @match *://*.code-hint.com/en/*
// @match *://*.code.i-harness.com/*/q/*
// @match *://*.codebug.zone/*
// @match *://*.codefactor.io/repository/*
// @match *://*.codefaq.info/*
// @match *://*.codefaq.ru/*
// @match *://*.codefordev.com/discuss/*/*
// @match *://*.codegear.dev/*/questions/*
// @match *://*.codegrepper.com/code-examples/*
// @match *://*.codegrepr.com/question/*
// @match *://*.codeguides.site/questions/*
// @match *://*.codehunter.cc/*
// @match *://*.codengineering.net/q/*
// @match *://*.codengineering.ru/q/*
// @match *://*.codenong.com/*
// @match *://*.codepudding.com/*/*.html
// @match *://*.coder-question-ko.com/cq-ko-blog/*
// @match *://*.coder-question.com/cq-blog/*
// @match *://*.coder.social/*
// @match *://*.coder.work/article/*
// @match *://*.coderoad.in/questions/*
// @match *://*.coderoad.ru/*
// @match *://*.coderquestion.ru/q/*
// @match *://*.codespots.com/library/item/*
// @match *://*.codetd.com/article/*
// @match *://*.codeutility.org/*
// @match *://*.coredump.biz/questions/*
// @match *://*.culinarydegree.info/*
// @match *://*.curatedgo.com/r/*/index.html
// @match *://*.dailydevsblog.com/troubleshoot/*
// @match *://*.daplus.net/*
// @match *://*.datewiki.ru/wiki/*
// @match *://*.de-vraag.com/*
// @match *://*.debugcn.com/*article/*
// @match *://*.debugko.com/article/*
// @match *://*.dev-answers.com/solutions/*
// @match *://*.devasking.com/issue/*
// @match *://*.devdreamz.com/question/*
// @match *://*.devebee.com/answer/*
// @match *://*.develop-bugs.com/article/*
// @match *://*.developreference.com/article/*
// @match *://*.devfaq.fr/question/*
// @match *://*.devtip.in/*/*
// @match *://*.digitrain.ru/questions/*
// @match *://*.dir.md/*
// @match *://*.dokry.com/*
// @match *://*.domainelespailles.net/*
// @match *://*.donolik.com/*
// @match *://*.doraprojects.net/questions/*
// @match *://*.dtuto.com/questions/*/*
// @match *://*.duhoctrungquoc.vn/wiki/*/*
// @match *://*.duoduokou.com/*/*.html
// @match *://*.e-learn.cn/topic/*
// @match *://*.ec-europe.org/*
// @match *://*.ecnf2016.org/*
// @match *://*.editcode.net/article-*
// @match *://*.edupro.id/questions/*
// @match *://*.edureka.co/community/*/*
// @match *://*.elfishgene.com/*
// @match *://*.encyclopaedia.bid/*
// @match *://*.encyclopedia.thefreedictionary.com/*
// @match *://*.errorsandanswers.com/*
// @match *://*.errorsfixing.com/*
// @match *://*.exchangetuts.com/*-*
// @match *://*.explained.today/*
// @match *://*.extutorial.com/ask/*
// @match *://*.faithcov.org/*
// @match *://*.fantashit.com/*
// @match *://*.findatwiki.com/*
// @match *://*.findbestopensource.com/product/*
// @match *://*.firstlightsalon.in/*/questions/*
// @match *://*.fitforlearning.org/*
// @match *://*.fixes.pub/*/*.html
// @match *://*.fluffyfables.com/*
// @match *://*.flutterhq.com/questions-and-answers/*
// @match *://*.flutterrepos.com/lib/*
// @match *://*.frwiki.wiki/wiki/*
// @match *://*.fullstackuser.com/questions/*
// @match *://*.gaz.wiki/wiki/*
// @match *://*.geek-tips.imtqy.com/articles/*/*.html
// @match *://*.geeksrepos.com/*
// @match *://*.generacodice.com/*
// @match *://*.getridbug.com/*/*
// @match *://*.ghcc.net/*
// @match *://*.gitanswer.net/*
// @match *://*.gitcode.net/*
// @match *://*.gitdetail.com/repositories/*
// @match *://*.giters.com/*
// @match *://*.gitfreak.com/*
// @match *://*.githubhelp.com/*
// @match *://*.githubhot.com/*
// @match *://*.githublab.com/*/*
// @match *://*.githubmemory.com/*
// @match *://*.githubplus.com/*
// @match *://*.gitrush.ru/*/*/*
// @match *://*.globalwikionline.com/detial/*/*
// @match *://*.golangd.com/g/*
// @match *://*.golangexample.com/*
// @match *://*.golangrepo.com/repo/*
// @match *://*.gupgallery.com/*
// @match *://*.helpex.vn/question/*
// @match *://*.higithub.com/*/*
// @match *://*.hmong.ru/wiki/*
// @match *://*.hmong.wiki/wiki/*
// @match *://*.howtobuildsoftware.com/index.php/how-do/*
// @match *://*.howtosolves.com/q/*
// @match *://*.html-agility-pack.net/knowledge-base/*
// @match *://*.husl.ru/questions/*
// @match *://*.ichi.pro/*
// @match *://*.icode9.com/*
// @match *://*.icopy.site/questions/*
// @match *://*.idqna.com/question/*
// @match *://*.im-coder.com/*.html
// @match *://*.intellipaat.com/community/*
// @match *://*.intrepidgeeks.com/tutorial/*
// @match *://*.ipgirl.com/*
// @match *://*.iquestion.pro/q/*
// @match *://*.isolution.pro/q/*
// @match *://*.issue.life/questions/*
// @match *://*.issueantenna.com/*/*
// @match *://*.issuehint.com/issue/*/*/*
// @match *://*.it-brain.online/question/*
// @match *://*.it1352.com/*.html
// @match *://*.itbaoku.cn/post/*.html
// @match *://*.itdaan.com/*
// @match *://*.itecnote.com/tecnote/*
// @match *://*.itectec.com/*/*
// @match *://*.itnan.ru/post.php*
// @match *://*.itranslater.com/qa/details/*
// @match *://*.jablogs.com/detail/*
// @match *://*.javacodexamples.com/examples/*
// @match *://*.javaer101.com/*/*
// @match *://*.javafixing.com/*/*/*.html
// @match *://*.javarepos.com/lib/*
// @match *://*.jejakjabar.com/wiki/*
// @match *://*.jike.in/*-1.html
// @match *://*.jike.in/qa/*
// @match *://*.jonic.cn/qa/*
// @match *://*.jpdebug.com/p/*
// @match *://*.jscodetips.com/examples/*
// @match *://*.jsrepos.com/*/*
// @match *://*.juejin.cn/post/*
// @match *://*.knews.vip/q/*
// @match *://*.kompsekret.ru/q/*
// @match *://*.kotaeta.com/*
// @match *://*.kutombawewe.net/*/*
// @match *://*.learn-codes.net/*/*
// @match *://*.learnfk.com/*question/*
// @match *://*.legkovopros.ru/questions/*
// @match *://*.libraries.io/*/*
// @match *://*.lifesaver.codes/answer/*
// @match *://*.lightrun.com/answers/*
// @match *://*.linuxfixes.com/*/*/*
// @match *://*.livepcwiki.ru/wiki/*
// @match *://*.living-sun.com/*/*
// @match *://*.localcoder.org/*
// @match *://*.macosrepo.com/software/*
// @match *://*.manongdao.com/*.html
// @match *://*.mediatagtw.com/*/*
// @match *://*.mediawiki.feverous.co.uk/index.php/*
// @match *://*.messiahlebanon.org/*
// @match *://*.microeducate.tech/*
// @match *://*.mlink.in/qa/*
// @match *://*.mlog.club/article/*
// @match *://*.narkive.jp/*
// @match *://*.newbedev.com/*
// @match *://*.newdevzone.com/posts/*
// @match *://*.nina.az/wiki/*
// @match *://*.noblenaz.org/*
// @match *://*.npm.io/package/*
// @match *://*.npmmirror.com/package/*
// @match *://*.ntcdoon.org/*
// @match *://*.nuomiphp.com/*/*
// @match *://*.nwikiit.cyou/wiki/*
// @match *://*.ogeek.cn/*-1.html
// @match *://*.ogeek.cn/qa/*
// @match *://*.opensourcelibs.com/lib/*
// @match *://*.ostack.cn/*-1.html
// @match *://*.ostack.cn/qa/*
// @match *://*.ounapuu.ee/*/*
// @match *://*.ourladylakes.org/*
// @match *://*.overcoder.net/q/*
// @match *://*.overcoder.ru/q/*
// @match *://*.overstack.in/*-1.html
// @match *://*.overstack.in/qa/*
// @match *://*.pakostnici.com/*
// @match *://*.panaindustrial.com/*
// @match *://*.pcbconline.org/*
// @match *://*.pengembangan-web-mp-pd.com/id/*
// @match *://*.phptime.ru/questions/*
// @match *://*.poweruser.guru/*
// @match *://*.prog-help.ru/*
// @match *://*.progi.pro/*
// @match *://*.programmierfrage.com/items/*
// @match *://*.programming-articles.com/*
// @match *://*.projectbackpack.org/*
// @match *://*.proubuntu.ru/*/*
// @match *://*.pyquestions.com/*
// @match *://*.python2.net/questions-*.htm
// @match *://*.pythonawesome.com/*
// @match *://*.pythonfixing.com/*.html
// @match *://*.pythonlang.dev/repo/*
// @match *://*.pythonrepo.com/repo/*
// @match *://*.qa-stack.pl/*
// @match *://*.qandeelacademy.com/questions/*
// @match *://*.qapicks.com/question/*
// @match *://*.qarchive.ru/*
// @match *://*.qaru.tech/questions/*
// @match *://*.qarus.ru/*
// @match *://*.qastack.in.th/*
// @match *://*.qastack.info.tr/*
// @match *://*.qastack.net.bd/*
// @match *://*.qi-u.com/*-1.html
// @match *://*.qi-u.com/qa/*
// @match *://*.quabr.com/*
// @match *://*.querythreads.com/*
// @match *://*.question-it.com/questions/*
// @match *://*.questu.ru/questions/*
// @match *://*.reddit.fun/*/*
// @match *://*.reposhub.com/*/*
// @match *://*.respuestas.me/*
// @match *://*.rotadev.com/*
// @match *://*.routinepanic.com/questions/*
// @match *://*.ru.encyclopedia.kz/index.php/*
// @match *://*.rudata.ru/wiki/*
// @match *://*.runebook.dev/*/docs/*
// @match *://*.ruphp.com/*.html
// @match *://*.rustrepo.com/repo/*
// @match *://*.safehavenpetrescue.org/*
// @match *://*.savepearlharbor.com/?p=*
// @match *://*.sbup.com/wiki/*
// @match *://*.sch22.org/*
// @match *://*.secret-bases.co.uk/wiki/*
// @match *://*.semicolonworld.com/question/*
// @match *://*.serveanswer.com/issue/*
// @match *://*.server-fault.ru/questions/*
// @match *://*.shenghuobao.net/qa/*
// @match *://*.shenzhenjia.cn/qa/*
// @match *://*.shenzhenjia.net/qa/*
// @match *://*.sierrasummit2005.org/*
// @match *://*.siwib.org/*
// @match *://*.smnggeophysics.com/*
// @match *://*.snyk.io/advisor/npm-package/*
// @match *://*.sobrelinux.info/questions/*
// @match *://*.socket.dev/npm/package/*
// @match *://*.softbranchdevelopers.com/*
// @match *://*.softwareuser.asklobster.com/posts/*
// @match *://*.soinside.com/question/*
// @match *://*.solusi.cyou/*/*
// @match *://*.solveforum.com/forums/threads/*
// @match *://*.sprosi.pro/questions/*
// @match *://*.sqlite.in/*-1.html
// @match *://*.sqlite.in/qa/*
// @match *://*.stackanswers.net/questions/*
// @match *://*.stackfinder.jp.net/questions/*
// @match *://*.stackfinder.ru/questions/*
// @match *://*.stackguides.com/questions/*
// @match *://*.stackify.dev/*
// @match *://*.stackoom.com/*question/*
// @match *://*.stackoverflood.com/*
// @match *://*.stackoverflowpoint.com/question/*
// @match *://*.stackovergo.com/*q/*
// @match *://*.stackru.com/questions/*
// @match *://*.string.quest/read/*
// @match *://*.sunflowercreations.org/*
// @match *://*.super-unix.com/*/*
// @match *://*.swiftobc.com/repo/*
// @match *://*.switch-case.com/*
// @match *://*.syntaxfix.com/question/*
// @match *://*.sysadminde.com/questions/*
// @match *://*.techarks.ru/qa/*
// @match *://*.techfeed.net/*
// @match *://*.techhelpnotes.com/*
// @match *://*.techinplanet.com/*
// @match *://*.territorioscuola.it/*
// @match *://*.thecodeteacher.com/question/*
// @match *://*.theshuggahpies.com/*
// @match *://*.thinbug.com/q/*
// @match *://*.tipsfordev.com/*
// @match *://*.tistory.com/*
// @match *://*.tousu.in/qa/*
// @match *://*.tracholar.top/*/*/*/*
// @match *://*.try2explore.com/*
// @match *://*.tutorialguruji.com/*/*
// @match *://*.tutorialink.com/*
// @match *://*.tutorialmeta.com/question/*
// @match *://*.tutorialmore.com/questions-*
// @match *://*.twblogs.net/a/*
// @match *://*.ubuntuaa.com/*q/*
// @match *://*.ubuntuplace.info/questions/*
// @match *://*.utyatnishna.ru/info/*
// @match *://*.uwenku.com/question/*
// @match *://*.v-resheno.ru/*
// @match *://*.vigge.cn/qa/*
// @match *://*.vigge.net/qa/*
// @match *://*.vigges.net/qa/*
// @match *://*.voidcc.com/question/*
// @match *://*.vuejscode.com/*
// @match *://*.vvikipedla.com/wiki/*
// @match *://*.w3coded.com/questions/*/*
// @match *://*.w3toppers.com/*
// @match *://*.wake-up-neo.net/*/*
// @match *://*.waymanamechurch.org/*
// @match *://*.web-answers.ru/*/*
// @match *://*.web-dev-qa-db-fra.com/fr/*
// @match *://*.web-dev-qa-db-ja.com/ja/*
// @match *://*.web-gelistirme-sc.com/tr/*
// @match *://*.webdevdesigner.com/q*
// @match *://*.webentwicklung-frage-antwort-db.com.de/de/*
// @match *://*.wekeepcoding.com/article/*/*
// @match *://*.wenyanet.com/opensource/*
// @match *://*.while-do.com/*
// @match *://*.wiki-org.ru/*
// @match *://*.wiki-wiki.ru/wp/*
// @match *://*.wiki.cologne/*
// @match *://*.wiki2.info/*
// @match *://*.wiki2.net/*
// @match *://*.wiki2.org/*
// @match *://*.wiki2.wiki/wiki/*
// @match *://*.wiki5.ru/wiki/*
// @match *://*.wikibrief.org/wiki/*
// @match *://*.wikichi.ru/wiki/*
// @match *://*.wikidark.ru/wiki/*
// @match *://*.wikidea.ru/wiki/*
// @match *://*.wikies.wiki/wiki/*
// @match *://*.wikimho.com/*/q/*/*
// @match *://*.wikipe.wiki/wiki/*
// @match *://*.wikipedia-on-ipfs.org/wiki/*
// @match *://*.wikipedia.tel/*
// @match *://*.wikipedia24.ru/*
// @match *://*.wikiredia.ru/*
// @match *://*.wikiroot.ru/question/*
// @match *://*.wikit.wiki/article/*/*
// @match *://*.wikivisually.com/wiki/*
// @match *://*.wikiwand.com/*/*
// @match *://*.wikizero.com/*/*
// @match *://*.wp-qa.com/*
// @match *://*.wujigu.com/qa/*
// @match *://*.xcv.wiki/*
// @match *://*.xiu2.net/it/details/*
// @match *://*.xsprogram.com/content/*
// @match *://*.xstack.ru/qa/*
// @match *://*.xstack.us/*-1.html
// @match *://*.xstack.us/qa/*
// @match *://*.xszz.org/*/question-*
// @match *://*.yaoply.com/items/*
// @match *://*.yingqusp.com/so/*
// @match *://*.ylhow.com/*
// @match *://*.younggeeks.in/questions/*
// @match *://*.yuanmacha.com/*.html
// @match *://*.zahn-info-portal.de/wiki/*
// @match *://*.zaizhele.cn/qa/*
// @match *://*.zaizhele.net/qa/*
// @match *://*.zapytay.com/*
// @match *://*.zsharp.org/*
// @match *://*.zxc.wiki/wiki/*
// @match *://*.zzun.app/repo/*
// @include *://qastack.tld/*
// ==/UserScript==
/* jshint esversion: 10 */
/* eslint quotes: ['warn', 'single'] */
/* eslint userscripts/better-use-match: 'off' */
/* eslint no-fallthrough: 'off' */
(async () => {
'use strict';
var sitecolor = '#333';
var lang = 'ru';
var badCode = false;
var badImgs = false;
var _ = undefined;
var ll, tt;
const _p = location.pathname;
const _ps = _p.split('/');
const _h = location.href;
const _se = ['stackoverflow.com','superuser.com','serverfault.com','stackapps.com','mathoverflow.net','askubuntu.com','stackexchange.com'];
/** Checks if a given object is a string */
var _$s = (s) => typeof s === 'string' || s instanceof String;
/** Gets the subdomain (host part) of the site */
var _hp = (p = 3) => (ll = location.hostname.split('.')) && ll[ll.length-p];
/** Gets the element by a given selector */
var _t = (s) => document.querySelector(s);
/** Tests if the path of the site matches the given regex */
var _c = (r) => r.test(_p);
/** Redirects to a link, if it exists; checks for validity of the source site are bypassed */
var _go = (s) => s && window.location.replace(s);
/** Checks if a string is part of the hostname */
var _hst = (s) => location.hostname.includes(s);
/** Sets the color for the bottom bar, if it's not set */
var clr = (c, f) => (sitecolor = (f || sitecolor == '#333') ? c : sitecolor);
/** Sets the language for translating and searching, if it's not set */
var lng = (c, f) => (lang = (f || lang == 'ru') ? c : lang);
/** Gets the last part of a path */
var lastPathPart = () => _ps.filter(Boolean).slice(-1)[0];
/** Gets the href attribute (or any other attribute) of a selected element, if it exists */
var bySel = (s, a = 'href') => _t(s)?.getAttribute(a);
/** Removes the auxiliary words of the textcontent of: the header if no parameter is given; a element matching the given selector; the first element, if the parameter is an array*/
var getHeader = (h) => removeAuxiliary(h ? (Array.isArray(h) ? h[0] : textContent(h)) : textContent('h1'));
/** Get an array of the textcontent of: elements with the tag-class if no parameter is given; elements matching the given selector; or the first element, if the parameter is an array*/
var getTags = (t) => t ? (Array.isArray(t) ? [t[0]] : allTexts(t)) : allTexts('.tag');
/** Replaces in a string all occurrences of the first element of an arraygroup with the second */
var mulReplace = (str, a) => a.forEach((v) => (str = str.replace(v[0], v[1]))) || str;
/** Creates a Wikipedia link with language and article text or the number of the part in the website url, optionally adding the /wiki/ part */
var wiki = (l = 0, p = 2, w = true) => 'https://' + (_$s(l) ? l : _ps[l]) + '.wikipedia.org' + (w ? '/wiki/' : '') + (_$s(p) ? p : _ps[p]);
/** Creates a Github link with the project and repository */
var github = (l) => l ? 'https://github.com' + l : null;
/** Creates the bottom bar with the text, the code parts and images to search for */
var prepareSearch = (h, t, s) => promptRedirect(sitecolor, toSearch(h + (t ? ' ' + getTags(t).join(' ').replace(/\s+/g, ' ') : ''), s), !badCode && allTexts('pre code'), !badImgs && [...new Set([...allAttr('img[src*="://i.stack.imgur.com/"]', 'src'), ...allAttr('a[href*="://i.stack.imgur.com/"]', 'href')])], s);
/** Translates all tags given as an array */
var transTags = async (t) => (await yaTranslate(allTexts(t).join(' '), lang)).split(' ');
/** Creates the Google search link with the slightly aligned text to search for, the sites to search on, optionally searching for images */
var toSearch = (s, site, i) => (s = dropMarks(s) && s && (ll = s.split(' ').filter(i => !i.match(/^(and|an|are|for|how|in|is|it|i|of|or|the|to)$/i)).length) ? 'https://google.com/search?q=' + (ll <= 32 ? encodeURIComponent(s) + '+' : '') + ((site && Array.isArray(site)) ? (site.length < 1 ? '' : 'site%3A' + site.join('+OR+site%3A')) : 'site%3Astackexchange.com+OR+site%3Astackoverflow.com') + (ll <= 32 ? '' : '+' + encodeURIComponent(s)) + (i ? '&tbm=isch' : '') : null);
/** Gets the textcontent of a selected element, if it exists */
var textContent = (s) => _t(s)?.textContent.trim();
/** Creates StackOverflow link by article id, optionally mofifying it before */
var byNumber = (s, radix) => (s = parseInt(s, radix)) && s > 0 ? 'https://stackoverflow.com/questions/' + s : null;
/** Adds surrounding spaces and make the string lowercase, if it exists */
var normalize = (s) => s && ' ' + s.toLowerCase() + ' ';
/** Pipes multiple functions after each other */
var pipe = (...fns) => x => fns.reduce((v, f) => f(v), x);
/** Creates an array of the elements matched by given selector */
var all = (s) => [...document.querySelectorAll(s)];
/** Creates an array of the textcontent of all elements matched by given selector */
var allTexts = (s) => all(s).map(a => a.textContent.trim());
/** Creates an array of the attributes of all elements matched by given selector */
var allAttr = (s, t) => all(s).map(a => a[t].trim());
/** Gets the attribute of a given element, if it exists, and get a specific text part by regex or replace it with anoter text */
var getAttr = (t, a, r, s = '$1') => (t.hasAttribute(a)) && t.getAttribute(a).replace(r, s);
/** Removes marks of a string, if it exists */
var dropMarks = (s) => s && s.replace(/\[(на удержании|on hold|duplikować|duplicado|duplicar|duplikat|dublicate|duplicate|дубликат|закрыто|закрытый|closed|geschlossen|zamknięte|cerrado|重复|repeat)\]\s*$/i, '').trim();
/** Removes the beginning of a text that precedes a given part */
var removePartBefore = (t, p) => textContent(t).replace(new RegExp('.*?'+ p), '');
/** Returns text in parentheses **/
var fromParentheses = (t) => (ll = t.split('(')) && (ll.length == 1 ? ll[0] : (ll.length == 2 ? ll[1] : ll.slice((ll.length - 2) / 2 + 1).join('(')).slice(0, -1));
/** Gets the first link by a given selector, that links to a stack exchange site */
function _tc(s) {
var allw = _se.flatMap(i => [i+'/q', i+'/a/'])
var nods = all(s);
for (var nod in nods) for (var pt in allw) if(nods[nod]?.href?.indexOf(allw[pt])>=0) return nods[nod].href;
}
/** Gets the image url with the site where the image is from, optionally with by selector and cutting the path */
function urlByImg(v, s = 'img[src*="/images/content/"]', n = 3) {
var p = _t(s)?.src;
if (!p) return;
var l = (new URL(p)).pathname.split('/')[n];
return l && (v + l);
}
var db = JSON.parse(GM_getValue('b2s') || '{}');
for (var y in db) if (location.href == db[y][0]) return _go(db[y][1]);
/** Adds the given JavaScript code as inline code to the opened site */
function addJS(code) {
var scriptElm = document.createElement('script');
var inlineCode = document.createTextNode(code);
scriptElm.appendChild(inlineCode);
document.body.appendChild(scriptElm);
}
/** Replaces different quote variants, optionally removes them, replaces various control characters */
function filterText(text, rmquotes) {
var out = text.replace(/(\u02B9|\u0374|\u2018|\u201A|\u2039|\u203A|\u201B|\u2019)+/g, '\'').replace(/(\u00AB|\u00BB|\u201E|\u201C|\u201F|\u201D|\u2E42)+/g, '"');
return (rmquotes ? out.replace(/(\'|")+/g, ' ') : out).replace(/ /g, ' ').replace(/(\r|\n)+/g, ' ').replace(/\s\s+/g, ' ').trim().replace(/\.$/, '').trim();
}
/** Creates the bottom bar to search for a question */
async function promptRedirect(bgcolor, link, codef, imgf, site) {
const dialog = document.createElement('div');
try {
document.body.appendChild(dialog);
const shadowRoot = dialog.attachShadow ?
dialog.attachShadow({ mode: 'open' }) :
//@ts-ignore
dialog.createShadowRoot && dialog.createShadowRoot();
if (!shadowRoot) throw 'Shadow dom required!';
shadowRoot.innerHTML = `
<style>
:host{
position: fixed;
bottom: 0;
z-index: 16777271;
width: 100%;
color: white;
background-color: ${bgcolor}!important;
}
.m{
padding: 14px;
font-family: Ubuntu,Segoe UI,Optima,Trebuchet MS,-apple-system,BlinkMacSystemFont,sans-serif;
font-size: 14px;
}
#close-btn{
float: right;
cursor: pointer;
}
a{
color: white;
}
.search-icon{
font-size: 24px;
line-height: 0;
text-decoration: none;
}
</style>
<div class="m">[ Back2Source ]
<a id="ok-btn" href="#">Try to find the original question? <span class="search-icon">⌕<span></a> ` +
(codef && codef.length > 0 ? '<a href="' + toSearch(codef.join(' '), site) + '">[ByCode]</a>' : '') +
(imgf && imgf.length > 0 ? '<a href="' + toSearch(imgf.join(' '), site, true) + '">[ByImgs]</a>' : '') +
`<span id="close-btn">✖</span>
</div>`;
shadowRoot.querySelector('#ok-btn').href = link;
await new Promise((_, reject) => {
shadowRoot.querySelector('#close-btn').addEventListener('click', reject);
});
} finally {
document.body.removeChild(dialog);
}
}
//https://yandex.com/dev/translate/doc/dg/concepts/api-overview.html
/** Translates a slightly aligned text with Yandex from one language to english or any other given language */
async function yaTranslate(q, sourceLang, targetLang) {
q = dropMarks(q);
if (!q) return null;
q = 'https://api.browser.yandex.ru/dictionary/translate?statLang=en&targetLang=' + (targetLang ? targetLang : 'en') + '&text=' + encodeURIComponent(q) + (sourceLang ? '&fromLang=' + sourceLang : '')
try {
//doesn't work in chrome
return await fetch(q, {
mode: 'no-cors',
credentials: 'omit'
})
.then(r => r.json())
.then(r => r.text);
} catch (e) {
//works only in tampermonkey
return new Promise((resolve, reject) => {
//@ts-ignore
GM_xmlhttpRequest({
url: q,
responseType: 'json',
anonymous: true,
onload: (xhr) => {
xhr.status === 200 ? resolve(xhr.response.text) : reject(xhr);
},
onerror: reject
})
})
}
}
var auxiliaryRe = null;
/** Removes auxiliary words of a given string */
function removeAuxiliary(s) {
return s && s.replace(auxiliaryRe || (auxiliaryRe = new RegExp([
'a', 'an', 'the',
//Conjunctions http://englishgu.ru/soyuzyi-v-angliyskom-yazyike-tablitsa-spisok/
//https://7esl.com/english-conjunctions/
'according to', 'after', 'against', 'also', 'although', 'and', 'as far as', 'as if', 'as long as', 'as much as', 'as soon as', 'as though', 'as well as', 'as', 'assuming that', 'at last', 'at least', 'because of', 'because', 'before', 'beyond', 'both', 'but', 'by the time', 'either', 'even if', 'even though', 'for', 'from now on', 'from time to time', 'how', 'however', 'if', 'in case', 'in order', 'in spite of', 'in terms of', 'lest', 'like', 'meanwhile', 'moreover', 'neither', 'nevertheless', 'no matter how', 'no matter what', 'no matter when', 'no matter where', 'no matter who', 'no matter why', 'nor', 'not so as', 'not yet', 'now that', 'on behalf of', 'on condition', 'on the contrary', 'on the other hand', 'once', 'only if', 'or', 'otherwise', 'owing to', 'provided that', 'rather than', 'since', 'so that', 'so', 'still', 'than', 'that is why', 'that', 'therefore', 'though', 'thus', 'till', 'unless', 'unlike', 'until', 'what', 'whatever', 'when', 'whenever', 'where', 'whereas', 'wherever', 'whether', 'which', 'whichever', 'while', 'who', 'whoever', 'whom', 'whomever', 'whose', 'with', 'within', 'without', 'yet',
//some of Preposition https://www.englishclub.com/grammar/prepositions-list.htm
//https://www.talkenglish.com/vocabulary/top-50-prepositions.aspx
'aboard', 'about', 'above', 'across', 'after', 'against', 'along', 'amid', 'among', 'anti', 'around', 'at', 'behind', 'below', 'beneath', 'beside', 'besides', 'beyond', 'but', 'by', 'concerning', 'considering', 'despite', 'down', 'during', 'excepting', 'excluding', 'following', 'for', 'from', 'in', 'including', 'inside', 'into', 'of', 'off', 'on', 'onto', 'opposite', 'out', 'outside', 'over', 'past', 'per', 'regarding', 'since', 'than', 'through', 'throughout', 'to', 'toward', 'towards', 'under', 'underneath', 'unlike', 'until', 'up', 'upon', 'versus', 'via', 'within', 'without',
//some of https://7esl.com/interjections-exclamations/
'aah', 'ah', 'aha', 'ahem', 'alas', 'argh', 'aw', 'aww', 'bah', 'behold', 'bingo', 'boo', 'bravo', 'brr', 'dear', 'duh', 'eek', 'eh', 'er', 'eww', 'gah', 'gee', 'grr', 'hah', 'hello', 'hey', 'hi', 'hmm', 'huh', 'hullo', 'humph', 'hurrah', 'meh', 'mhm', 'muahaha', 'nuh-uh', 'oh', 'ooh', 'ooh-la-la', 'oomph', 'oops', 'ouch', 'oww', 'oy', 'pew', 'pff', 'phew', 'psst', 'sheesh', 'shh', 'shoo', 'tsk-tsk', 'uh-hu', 'uh-oh', 'uh-uh', 'uhh', 'um', 'umm', 'wee', 'well', 'whoa', 'wow', 'yahoo', 'yay', 'yeah', 'yikes', 'yippee', 'yoo-hoo', 'yuck', 'yuh-uh', 'zing',
//modals
'can', 'could', 'be able to', 'may', 'might', 'shall', 'should', 'must', 'have to', 'will', 'would',
].sort((a, b) => b.length - a.length).map(w => `\\W${w}(?!\\w)`).join('|'), 'g')), ' ');
}
/**
* Searches a text with the Stack Exchange API, optionally with a timeframe and the tags
* @param {string} q
* @param {Date} [before]
* @param {Date} [after]
* @param {string[]} [tags]
* @param {string} [site]
*/
async function findByApi(q, before, after, tags, site='stackoverflow.com') {
var dfgdr = (q = dropMarks(q)) && q && fetch(
`https://api.stackexchange.com/2.3/search?page=1&pagesize=1&order=desc&sort=relevance&intitle=${encodeURIComponent(q)}&site=${site.split('.')[0]}` +
(after ? '&fromdate=' + (after.getTime() / 1000 - 120 | 0) : '') +
(before ? '&todate=' + (before.getTime() / 1000 + 120 | 0) : '') +
(Array.isArray(tags) && tags.length > 0 ? '&tagged=' + encodeURIComponent(Array.from(new Set(tags)).join(';')) : ''), {
credentials: 'omit'
})
.then(r => r.json())
.then(r => r?.items[0]?.link);
return dfgdr;
}
/** Searches an issue text with the Github API, optionally with the user */
async function findByGitHubApi(q, user) {
var dfgdr = q && fetch(
`https://api.github.com/search/issues?q=${encodeURIComponent(q)}` +
(user && user != 'ghost' ? ' author:' + encodeURIComponent(user) : ''), {
credentials: 'omit'
})
.then(r => r.json())
.then(r => r?.items[0]?.html_url);
return dfgdr;
}
/**
* Takes the slightly aligned text of the header or a given selector, optionally translates it, tries to find it per API and otherwise creates the bottom bar to search for
* @param {string|array} [h] - header selector (def: 'h1')
* @param {string|array} [t] - tags selector (def: '.tag')
* @param {string} [l] - lang (def: none)
* @param {string} [s] - target site(s) (def: ['stackoverflow.com'])
*/
async function byHeader(h, t, l, s) {
var sbh = (l == 'en') ? (Array.isArray(h) ? h[0] : textContent(h ? h : 'h1')) : filterText(await yaTranslate(getHeader(h), l), 1);
return sbh && (await findByApi(sbh, _, _, getTags(t), Array.isArray(s) ? s[0] : _) || prepareSearch(sbh, t, s));
}
/** Gets the text to search for from a part of the path, tries to find it per API and otherwise creates the bottom bar to search for */
async function byPath(pos, s) {
ll = _ps[pos].replace(/(-closed|-duplicate)?(\.html)?$/, '').replace(/^\d+-/, '').replace(/[-+]/g, ' ');
ll = ll.replace(/\b(are|ca|could|did|does|do|has|have|is|must|were|wo)n ?t\b/g,'$1n\'t').replace(/\b(they|you) ?(re|ve)\b/g,'$1\'$2').replace(/\bi ?(m|ve)\b/g,'i\'$1').replace(/\b(what|there) ?s\b/g,'$1\'s');
return (await findByApi(ll)) || prepareSearch(ll, '', s);
}
/** Matches elements by a given selector, searches for elements whose inner text starts with a given search text and returns the link of an element matched by a second given selector or the inner text that follows the search text */
function startsByText(selector, text, href = false) {
const e = all(selector);
for (var i = 0; i < e.length; i++) {
var t = e[i].innerText.trim();
var f = t.indexOf(text);
if (f == 0) return (href ? e[i].querySelector(href)?.href : t.substr(text.length).trim());
}
}
/** Matches elements by a given selector, searches for elements whose inner text includes a given search text and returns their link */
function byInner(selector, text) {
const e = all(selector);
for (var i = 0; i < e.length; i++) {
if (e[i].innerText.trim().indexOf(text) >= 0) return e[i].href;
}
}
var link;
const host = location.hostname.split('.').slice(-2).join('.');
console.log('Checking site: ' + location.hostname + (location.hostname != host ? ' as ' + host : ''));
switch (host) {
case '16892.net':
case '55276.net':
case 'jike.in':
case 'jonic.cn':
case 'mlink.in':
case 'ogeek.cn':
case 'ostack.cn':
case 'overstack.in':
case 'qi-u.com':
case 'shenghuobao.net':
case 'shenzhenjia.cn':
case 'shenzhenjia.net':
case 'sqlite.in':
case 'tousu.in':
case 'vigge.cn':
case 'vigge.net':
case 'vigges.net':
case 'wujigu.com':
case 'xstack.ru':
case 'xstack.us':
case 'zaizhele.cn':
case 'zaizhele.net':
if (_c(/^\/thread-.*.html$/) && textContent('#pt a:nth-child(5)') == '知识问答') return byHeader([removePartBefore('h1',' - ')], _, 'en');
if (_c(/^\/article-.*.html$/) && textContent('#pt a:nth-child(5)') == '开源') return bySel('.deanedit > a');
if (_ps[1] == 'qa' && _t('h1 a')){
if (textContent('h1').match(/[\u4e00-\u9fa5]/)) return byHeader('h1', _, 'zh');
return byHeader([removePartBefore('h1',' - ')], _, 'en');
}
return;
case '1r1g.com':
return clr('#343a40') && byHeader('h1', 'a.badge', 'en');
case '5axxw.com':
return byHeader('h1','.badge-tag','zh') && byHeader('h2',_,'zh');
case '955yes.com':
return byNumber(_ps[2].match(/1(\d*)\.html/)[1]);
case '9ishenzhen.com':
return !_c(/[\u4e00-\u9fa5]/) && _t('h1 a') && byHeader([removePartBefore('h1',' - ')], _, 'en');
case 'amuddycup.com':
case 'arip-photo.org':
case 'athabasca-foto.com':
case 'cfadnc.org':
case 'culinarydegree.info':
case 'domainelespailles.net':
case 'ec-europe.org':
case 'ecnf2016.org':
case 'elfishgene.com':
case 'faithcov.org':
case 'fitforlearning.org':
case 'fluffyfables.com':
case 'gupgallery.com':
case 'messiahlebanon.org':
case 'noblenaz.org':
case 'ntcdoon.org':
case 'ourladylakes.org':
case 'pakostnici.com':
case 'panaindustrial.com':
case 'pcbconline.org':
case 'projectbackpack.org':
case 'safehavenpetrescue.org':
case 'sch22.org':
case 'sierrasummit2005.org':
case 'siwib.org':
case 'smnggeophysics.com':
case 'sunflowercreations.org':
case 'theshuggahpies.com':
case 'waymanamechurch.org':
case 'zsharp.org':
return (tt = _t('meta[property="og:image"]').content.split('/').pop().split('.')[0].replace(/-/g,' ')) && byHeader([tt], _, 'en', ['stackoverflow.com','superuser.com','askubuntu.com','stackexchange.com']);
case 'androiderrors.com':
case 'w3toppers.com':
return byHeader('h1', 'span.tags-links > a', 'en');
case 'answerlib.com':
case 'answerspoint.com':
case 'ask-dev.ru':
case 'coderoad.in':
case 'younggeeks.in':
return byPath(3);
case 'antwortenhier.me':
case 'askfrance.me':
case 'respuestas.me':
case 'askentire.net':
return clr('#2c3e50') && byHeader('h1', [await transTags('ul.x-tags li a[href*="/t/"]')], document.documentElement.lang);
case 'anycodings.com':
return byHeader([removePartBefore('h2',': ')], '.no-gutters > a', 'en');
case 'appsloveworld.com':{
let title = textContent('h1#posttitle');
let crop_start = title.match(/^((?:\w+[\-\s]*)?\[?(?:SOLVED|SOLUTION)\]?\s*-\s*)/i);
let matches = title.match(/\s?(?:\s*-\s*([\w+#]+(?:[\-\s.]\w+)?))?$/i);
if (crop_start != null) title = title.replace(crop_start, '');
let tag = false;
if (matches != null) {
title = title.replace(matches[0], '');
tag = matches[1];
}
return byHeader([title], tag ? [tag] : [], 'en');
}
case 'askdev.ru':
return clr('#970f1b') && urlByImg('https://superuser.com/questions/') || byHeader('h1', [await transTags('.block_taxonomies a')], 'ru');
case 'askdevz.com':
case 'askvoprosy.com':
case 'living-sun.com':
case 'qandeelacademy.com':
case 'yaoply.com':
return byPath(2);
case 'asklobster.com':
case 'cainiaojiaocheng.com':
case 'coderquestion.ru':
case 'coredump.biz':
case 'digitrain.ru':
case 'gitrush.ru':
case 'html-agility-pack.net':
case 'icopy.site':
case 'issue.life':
case 'qaru.tech':
case 'stackfinder.ru':
case 'thinbug.com':
return byNumber(_ps[2]);
case 'askubuntu.ru':
return byHeader('h1', 'nav .col-tag', 'ru', ['askubuntu.com']);
case 'bcqaw.com':
return byHeader('h1.article-title', _, 'zh');
case 'bildiredi.com':
case 'ciupacabra.com':
case 'de-vraag.com':
case 'donolik.com':
case 'kotaeta.com':
case 'switch-case.com':
case 'while-do.com':
case 'zapytay.com':
return bySel('a.link.block');
case 'bilee.com':
clr('#178acc');
case 'techarks.ru':
clr('#20a169');
case 'question-it.com':
clr('#2c3e50');
case 'legkovopros.ru':
lng('ru') && clr('#55b252');
case 'edupro.id':
lng('id') && clr('#2c3e50');
return byHeader('h1', '.tag', lang);
case 'binarydevelop.com':
return bySel('div.cc', 'data-href');
case 'catchconsole.com':
return byHeader([dropMarks(textContent('h1'))], _, 'en');
case 'cmsdk.com':
case 'code-error.com':
case 'idqna.com':
case 'learn-codes.net':
case 'newdevzone.com':
case 'programming-articles.com':
case 'thecodeteacher.com':
case 'w3coded.com':
return byHeader('h1', _, 'en');
case 'cndgn.com':
return 'https://' + _ps[2].replace(/(.+)stack/,'$1.stackexchange').replace(/^(stack)$/,'$1overflow') + '.com/questions/' + _ps[3];
case 'code-examples.net':
case 'i-harness.com':
return byNumber(lastPathPart(), 16);
case 'codebug.zone':
return byHeader([removePartBefore('h1', ' – ')], _, 'es');
case 'codefordev.com':
return byHeader('h1', '.ui.small.label', 'en');
case 'codeguides.site':
return byNumber(_ps[3]);
case 'codehunter.cc':
return byHeader('h1', '.badge', 'en');
case 'codengineering.net':
return (!allTexts('.tags > div > a').join().match(/[\u0400-\u04ff]/)) && byHeader('h1', '.tags > div > a', 'ru');
case 'codengineering.ru':
return toSearch(lastPathPart().replace(/(-closed|-duplicate)?(-\d+)?(\.html)?$/, ''), true);
case 'codenong.com':
case 'coderoad.ru':
case 'quabr.com':
return byNumber(_ps[1]);
case 'codepudding.com':
return byHeader('div.detail_title', '.hot-tags a', 'en');
case 'coder.work':
return bySel('div>p>a[rel="noreferrer noopener nofollow"]') || startsByText('p', 'stackoverflow链接', 'a[href*="stackoverflow.com"]') || startsByText('p', 'stackoverflow原址', 'a[href*="stackoverflow.com"]') || byHeader('h1', _, 'zh');
case 'codeutility.org':
return byHeader('h1', '.tags-links > a', 'en');
case 'dailydevsblog.com':
return byHeader([removePartBefore('h1', 'Resolved: ')], '.tags > a', 'en');
case 'daplus.net':
return byHeader([removePartBefore('h1','\\] ')], _, 'ko');
case 'debugcn.com':
lng(_ps[1] == 'article' ? 'zh' : _ps[1]);
case 'debugko.com':
case 'jablogs.com':
lng('ja');
case 'xsprogram.com':
case 'devasking.com':
lng('en');
return byHeader('h1', _, lang);
case 'devdreamz.com':
return byHeader('h1','[class^="ButtonTags_tags_container"] a', 'en');
case 'devebee.com':
return byHeader('h1', '.content > .tagcloud > a', 'en');
case 'develop-bugs.com':
tt = _t('blockquote > h2 > a').innerHTML.split(' - ');
return byHeader([tt[0]], tt[1], 'en');
case 'developreference.com':
var parts = document.title.split(' - ');
var devpref = _ps[3].replace(/[-+]/g, ' ').replace(/(%ef|%bc|%9f)+$/i, '');
return (await findByApi(devpref)) || (await findByApi(parts[0], _, _, [parts.pop()])) || promptRedirect(sitecolor, toSearch(devpref));
case 'devfaq.fr':
return byHeader('h1', '.badge-info', 'fr');
case 'devtip.in':
return byHeader('h1', '.tag-list div', 'en');
case 'dokry.com':
return byHeader('h1', '.badge a', 'es');
case 'doraprojects.net':
return byInner('a.text-muted', 'Source');
case 'dtuto.com':
return byHeader('h5', '.tag-link', 'en');
case 'duoduokou.com':
return byHeader('p.post-title', 'span.category > a', 'zh');
case 'e-learn.cn':
return startsByText('div.content p:last-child', '来源:');
case 'editcode.net':
return byHeader([removePartBefore('h1', ':')], _,'en');
case 'edureka.co':
return byHeader([JSON.parse(textContent('[type="application/ld+json"]')).name], _,'en');
case 'errorsfixing.com':
return bySel('div.entry-content.boxed > p:nth-last-of-type(3) > a');
case 'exchangetuts.com':
return byHeader('h1', '.item-tag > a', 'en');
case 'extutorial.com':
return byHeader('h1', 'a[href*="/tags/"]', 'en');
case 'firstlightsalon.in':
return 'https://' + _ps[1].replace('_threads','.stackexchange.com/questions/') + _ps[3];
case 'fixes.pub':
return byHeader('h1', 'aside li a[href*="fixes.pub/topics"]', 'ja');
case 'flutterhq.com':
return byInner('a', 'Stackoverflow.com');
case 'fullstackuser.com':
return byHeader('h1', '.custom-head .post-tag', 'en');
case 'getridbug.com':
return byHeader('h1', 'div.post-tags > a', 'en');
case 'ghcc.net':
return byHeader('h1', '.field__item > a', 'en');
case 'helpex.vn':
return _t('#viewSource>span')?.innerText.replace(/^: /,'');
case 'howtobuildsoftware.com':
return byHeader([removePartBefore('title',' - ')], '#list .email-content-subtitle a', 'en');
case 'imtqy.com':
return byHeader('.question-header>h1', _, 'en');
case 'intellipaat.com':
return byHeader('h1', '.qa-q-view-tag-item', 'en');
case 'ipgirl.com':
return byHeader('h1', '.breadcrumb-item > span > a', 'fr');
case 'it1352.com':
return byHeader([removePartBefore('h1 > em','\\] ')], 'div.arc-meta > span > a', 'en');
case 'itbaoku.cn':
return byHeader([removePartBefore('h1 > em','\\] ')], '.article-tags > a', 'en');
case 'itecnote.com':
return byHeader([removePartBefore('h1',' – ').replace(/How to/, '')], _, 'en');
case 'itectec.com':
return byHeader([removePartBefore('h1', ' – ')], '.badge','en', _se);
case 'javacodexamples.com':
return byHeader('h1', '.titleBox > p > a', 'en');
case 'javaer101.com':
return byHeader('h1', 'nav .col-tag', _ps[1] == 'article' ? 'ja' : _ps[1]);
case 'jscodetips.com':
return byHeader('h1', '.contentBox > div:nth-child(3) > a', 'en');
case 'kompsekret.ru':
return clr('#292d2f') && (urlByImg('https://superuser.com/questions/') || byHeader([lastPathPart().replace(/(-closed|-duplicate)?(\d+)?(\.html)?$/, '').replace(/-/g, ' ')], '.tags a', 'en', ['superuser.com']));
case 'kutombawewe.net':
case 'pengembangan-web-mp-pd.com':
case 'wake-up-neo.net':
case 'web-dev-qa-db-fra.com':
case 'web-dev-qa-db-ja.com':
case 'web-gelistirme-sc.com':
return bySel('.q-source > a');