開源替代重定向器

將您從專有網絡服務重定向到道德替代品(前端)。

目前為 2022-10-26 提交的版本,檢視 最新版本

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