开源替代重定向器

将您从专有网络服务重定向到道德替代品(前端)。

当前为 2022-10-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Open-Source Alternative Redirector
  3. // @name:ar معيد التوجيه البديل مفتوح المصدر
  4. // @name:bg Алтернативно пренасочване с отворен код
  5. // @name:cs Open-Source alternativní přesměrovač
  6. // @name:da Open Source Alternativ Redirector
  7. // @name:de Open-Source-alternativer Redirector
  8. // @name:es Redirector alternativo de código abierto
  9. // @name:fi Open-Source Alternative Redirector
  10. // @name:fr Redirecteur alternatif open source
  11. // @name:he מפנה אלטרנטיבי בקוד פתוח
  12. // @name:it Reindirizzamento alternativo open source
  13. // @name:ja オープンソースの代替リダイレクター
  14. // @name:ko 오픈 소스 대체 리디렉터
  15. // @name:nl Alternatieve Open Source-redirector
  16. // @name:pl Alternatywny readresator typu open source
  17. // @name:ro Redirector alternativ cu sursă deschisă
  18. // @name:ru Альтернативный перенаправитель с открытым исходным кодом
  19. // @name:tr Açık Kaynak Alternatif Yönlendirici
  20. // @name:uk Альтернативний перенаправник з відкритим вихідним кодом
  21. // @name:zh-CN 开源替代重定向器
  22. // @name:zh-TW 開源替代重定向器
  23. // @namespace -
  24. // @version 0.9.1
  25. // @description Redirects you from proprietary web-services to ethical alternatives(front-end).
  26. // @description:ar يعيد توجيهك من خدمات الويب المسجلة الملكية إلى البدائل الأخلاقية (الواجهة الأمامية).
  27. // @description:bg Пренасочва ви от собствени уеб-услуги към етични алтернативи (front-end).
  28. // @description:cs Přesměruje vás z proprietárních webových služeb na etické alternativy (front-end).
  29. // @description:da Omdirigerer dig fra proprietære web-tjenester til etiske alternativer (front-end).
  30. // @description:de Leitet Sie von proprietären Webdiensten zu ethischen Alternativen (Front-End) weiter.
  31. // @description:es Lo redirige de servicios web propietarios a alternativas éticas (front-end).
  32. // @description:fi Ohjaa sinut patentoiduista verkkopalveluista eettisiin vaihtoehtoihin (käyttöliittymä).
  33. // @description:fr Vous redirige des services Web propriétaires vers des alternatives éthiques (front-end).
  34. // @description:he מפנה אותך משירותי אינטרנט קנייניים לחלופות אתיות (חזית).
  35. // @description:it Ti reindirizza da servizi web proprietari ad alternative etiche (front-end).
  36. // @description:ja 独自のWebサービスから倫理的な代替手段(フロントエンド)にリダイレクトします。
  37. // @description:ko 독점 웹 서비스에서 윤리적 대안(프론트 엔드)으로 리디렉션합니다.
  38. // @description:nl Leidt u om van propriëtaire webservices naar ethische alternatieven (front-end).
  39. // @description:pl Przekierowuje Cię z zastrzeżonych usług internetowych do etycznych alternatyw (front-end).
  40. // @description:ro Vă redirecționează de la servicii web proprietare la alternative etice (front-end).
  41. // @description:ru Перенаправляет вас с проприетарных веб-сервисов на этические альтернативы (интерфейс).
  42. // @description:tr Sizi tescilli web hizmetlerinden etik alternatiflere (ön uç) yönlendirir.
  43. // @description:uk Перенаправляє вас із власних веб-сервісів до етичних альтернатив (фронт-енд).
  44. // @description:zh-CN 将您从专有网络服务重定向到道德替代品(前端)。
  45. // @description:zh-TW 將您從專有網絡服務重定向到道德替代品(前端)。
  46. // @author NotYou
  47. // @include *youtube.com/*
  48. // @include *google.com/*
  49. // @include *yahoo.com/*
  50. // @include *bing.com/*
  51. // @include *reddit.com/*
  52. // @include *twitter.com/*
  53. // @include *wikipedia.org/*
  54. // @include *medium.com/*
  55. // @include *i.imgur.com/*
  56. // @include *i.stack.imgur.com/*
  57. // @include *odysee.com/*
  58. // @include *tiktok.com/*
  59. // @run-at document-start
  60. // @license GPL-3.0-or-later
  61. // @icon https://icons.iconarchive.com/icons/itweek/knob-toolbar/32/Knob-Shuffle-Off-icon.png
  62. // @grant none
  63. // ==/UserScript==
  64.  
  65. /*
  66.  
  67. ﹀ Change Log ﹀
  68.  
  69. 0.9.1 Version:
  70. - Instagram do not working :(
  71.  
  72. 0.9 Version:
  73. - Shorter code
  74. - Better Instances format
  75.  
  76. 0.8 Version:
  77. - Added Scribe(Medium)
  78. - Added Rimgo(i.imgur)
  79. - Added Librarian(Odysee)
  80. - Added ProxiTok(TikTok)
  81.  
  82. 0.7 Version:
  83. - Removed duckduckgo
  84. - Better instagram redirect
  85. - Added google translate
  86.  
  87. 0.6 Version:
  88. - Redirect from yahoo
  89. - Redirect from bing
  90. - Redirect from duckduckgo
  91.  
  92. 0.5 Version:
  93. - Support for other languages for wikiless/wikipedia
  94. - Better Instances format
  95.  
  96. */
  97.  
  98. var url = new URL(location.href),
  99.  
  100. // INSTANCES //
  101. invidious = 'yewtu.be',
  102. searx = 'search.mdosch.de',
  103. libreddit = 'reddit.invak.id',
  104. nitter = 'nitter.snopyta.org',
  105. wikiless = 'wikiless.org',
  106. lingva = 'lingva.ml',
  107. scribe = 'scribe.rip',
  108. rimgo = 'rimgo.pussthecat.org',
  109. librarian = 'librarian.pussthecat.org',
  110. proxitok = 'proxitok.herokuapp.com'
  111.  
  112. // YouTube | Invidious //
  113. if(location.host.indexOf('youtube.com') != -1){
  114. location.replace('https://' + invidious + location.pathname + location.search)
  115. }
  116.  
  117. if(location.host.includes('google.')){
  118. // Google Translate | Lingva Translate //
  119. if(location.hostname.match(/translate.google.+/)){
  120. if(location.search === '') {
  121. location.replace('https://' + lingva)
  122. } else {
  123. let
  124. base = location.search.split('&'),
  125. lang1 = base[0].split('=')[1],
  126. lang2 = base[1].split('=')[1],
  127. text = base[2].split('=')[1]
  128. location.replace('https://' + lingva + '/' + lang1 + '/' + lang2 + '/' + text)
  129. }
  130. // Google | SearX //
  131. } else if(location.host.match(/www.google.+/)) {
  132. location.replace('https://' + searx + location.pathname + location.search)
  133. }
  134. }
  135.  
  136. // Yahoo | SearX //
  137. if(location.host.indexOf('yahoo.com') != -1){
  138. let search = location.search.replace('?p', '?q')
  139. location.replace('https://' + searx + location.pathname + search)
  140. }
  141.  
  142. // Bing | SearX //
  143. if(location.host.indexOf('bing.com') != -1){
  144. location.replace('https://' + searx + location.pathname + location.search)
  145. }
  146.  
  147. // Reddit | Libreddit //
  148. if(location.host.indexOf('reddit.com') != -1){
  149. location.replace('https://' + libreddit + location.pathname + location.search)
  150. }
  151.  
  152. // Twitter | Nitter //
  153. if(location.host.indexOf('twitter.com') != -1){
  154. location.replace('https://' + nitter + location.pathname + location.search)
  155. }
  156.  
  157. // Wikipedia | Wikiless //
  158. if(location.host.indexOf('wikipedia.org') != -1){
  159. location.replace('https://' + wikiless + location.pathname + '?lang=' + url.hostname.split('.')[0])
  160. }
  161.  
  162. // Medium | Scribe //
  163. if(location.host.indexOf('medium.com') != -1){
  164. location.replace('https://' + scribe + location.pathname + location.search)
  165. }
  166.  
  167. // i.Imgur | Rimgo //
  168. if(location.host.indexOf('i.imgur.com') != -1){
  169. location.replace('https://' + rimgo + location.pathname + location.search)
  170. }
  171.  
  172. // Odysee | Librarinan //
  173. if(location.host.indexOf('odysee.com') != -1){
  174. location.replace('https://' + librarian + location.pathname + location.search)
  175. }
  176.  
  177. // TikTok | ProxiTok //
  178. if(location.host.indexOf('tiktok.com') != -1||location.host.indexOf('www.tiktok.com') != -1){
  179. location.replace('https://' + proxitok + location.pathname + location.search)
  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.