开源替代重定向器

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

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

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