开源替代重定向器

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

当前为 2022-05-02 提交的版本,查看 最新版本

  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
  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 *instagram.com/*
  54. // @include *wikipedia.org/*
  55. // @include *medium.com/*
  56. // @include *i.imgur.com/*
  57. // @include *i.stack.imgur.com/*
  58. // @include *odysee.com/*
  59. // @include *tiktok.com/*
  60. // @run-at document-start
  61. // @license GPL-3.0-or-later
  62. // @icon https://icons.iconarchive.com/icons/itweek/knob-toolbar/32/Knob-Shuffle-Off-icon.png
  63. // @grant none
  64. // ==/UserScript==
  65.  
  66. /*
  67.  
  68. ﹀ Change Log ﹀
  69.  
  70. 0.8 Version:
  71. - Added Scribe(Medium)
  72. - Added Rimgo(i.imgur)
  73. - Added Librarian(Odysee)
  74. - Added ProxiTok(TikTok)
  75.  
  76. 0.7 Version:
  77. - Removed duckduckgo
  78. - Better instagram redirect
  79. - Added google translate
  80.  
  81. 0.6 Version:
  82. - Redirect from yahoo
  83. - Redirect from bing
  84. - Redirect from duckduckgo
  85.  
  86. 0.5 Version:
  87. - Support for other languages for wikiless/wikipedia
  88. - Better Instances format
  89.  
  90. */
  91.  
  92. var url = new URL(window.location.href)
  93.  
  94. // INSTANCES //
  95. const
  96. invidious = 'yewtu.be',
  97. searx = 'search.mdosch.de',
  98. libreddit = 'reddit.invak.id',
  99. nitter = 'nitter.snopyta.org',
  100. bibliogram = 'bibliogram.pussthecat.org',
  101. wikiless = 'wikiless.org',
  102. lingva = 'lingva.ml',
  103. scribe = 'scribe.rip',
  104. rimgo = 'rimgo.pussthecat.org',
  105. librarian = 'librarian.pussthecat.org',
  106. proxitok = 'proxitok.herokuapp.com'
  107.  
  108. // YouTube | Invidious //
  109. if(window.location.host.indexOf('youtube.com') != -1){
  110. window.location.replace('https://' + invidious + window.location.pathname + window.location.search)
  111. }
  112.  
  113. if(window.location.host.includes('google')){
  114. // Google Translate | Lingva Translate //
  115. if(window.location.host.includes('translate.google')){
  116. if(window.location.search === '') {
  117. window.location.replace('https://' + lingva)
  118. } else {
  119. let
  120. base = window.location.search.split('&'),
  121. lang1 = base[0].split('=')[1],
  122. lang2 = base[1].split('=')[1],
  123. text = base[2].split('=')[1]
  124. window.location.replace('https://' + lingva + '/' + lang1 + '/' + lang2 + '/' + text)
  125. }
  126. // Google | SearX //
  127. } else if(window.location.host.includes('www.google')) {
  128. window.location.replace('https://' + searx + window.location.pathname + window.location.search)
  129. }
  130. }
  131.  
  132. // Yahoo | SearX //
  133. if(window.location.host.indexOf('yahoo.com') != -1){
  134. let search = window.location.search.replace('?p', '?q')
  135. window.location.replace('https://' + searx + window.location.pathname + search)
  136. }
  137.  
  138. // Bing | SearX //
  139. if(window.location.host.indexOf('bing.com') != -1){
  140. window.location.replace('https://' + searx + window.location.pathname + window.location.search)
  141. }
  142.  
  143. // Reddit | Libreddit //
  144. if(window.location.host.indexOf('reddit.com') != -1){
  145. window.location.replace('https://' + libreddit + window.location.pathname + window.location.search)
  146. }
  147.  
  148. // Twitter | Nitter //
  149. if(window.location.host.indexOf('twitter.com') != -1){
  150. window.location.replace('https://' + nitter + window.location.pathname + window.location.search)
  151. }
  152.  
  153. // Instagram | Bibliogram //
  154. if(window.location.host.indexOf('instagram.com') != -1){
  155. if(window.location.pathname === '/accounts/login/') {
  156. let path = '/u' + window.location.search.split('?next=').at(1)
  157. window.location.replace('https://' + bibliogram + path)
  158. } else {
  159. window.location.replace('https://' + bibliogram + window.location.pathname + window.location.search)
  160. }
  161. }
  162.  
  163. // Wikipedia | Wikiless //
  164. if(window.location.host.indexOf('wikipedia.org') != -1){
  165. window.location.replace('https://' + wikiless + window.location.pathname + '?lang=' + url.hostname.split('.')[0])
  166. }
  167.  
  168. // Medium | Scribe //
  169. if(window.location.host.indexOf('medium.com') != -1){
  170. window.location.replace('https://' + scribe + window.location.pathname + window.location.search)
  171. }
  172.  
  173. // i.Imgur | Rimgo //
  174. if(window.location.host.indexOf('i.imgur.com') != -1){
  175. window.location.replace('https://' + rimgo + window.location.pathname + window.location.search)
  176. }
  177.  
  178. // Odysee | Librarinan //
  179. if(window.location.host.indexOf('odysee.com') != -1){
  180. window.location.replace('https://' + librarian + window.location.pathname + window.location.search)
  181. }
  182.  
  183. // TikTok | ProxiTok //
  184. if(window.location.host.indexOf('tiktok.com') != -1||window.location.host.indexOf('www.tiktok.com') != -1){
  185. window.location.replace('https://' + proxitok + window.location.pathname + window.location.search)
  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.