Open-Source Alternative Redirector

Redirects you from proprietary web-services to ethical alternatives.

目前為 2022-03-09 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Open-Source Alternative Redirector
  3. // @namespace -
  4. // @version 0.6
  5. // @description Redirects you from proprietary web-services to ethical alternatives.
  6. // @author NotYou
  7. // @include *youtube.com/*
  8. // @include *google.com/*
  9. // @include *yahoo.com/*
  10. // @include *bing.com/*
  11. // @include *duckduckgo.com/*
  12. // @include *reddit.com/*
  13. // @include *twitter.com/*
  14. // @include *instagram.com/*
  15. // @include *wikipedia.org/*
  16. // @run-at document-start
  17. // @license GPL-3.0-or-later
  18. // @icon https://icons.iconarchive.com/icons/itweek/knob-toolbar/32/Knob-Shuffle-Off-icon.png
  19. // @grant none
  20. // ==/UserScript==
  21.  
  22. /*
  23.  
  24. ﹀ Change Log ﹀
  25.  
  26. 0.6 Version:
  27. - Redirect from yahoo
  28. - Redirect from bing
  29. - Redirect from duckduckgo
  30.  
  31. 0.5 Version:
  32. - Support for other languages for wikiless/wikipedia
  33. - Better Instances format
  34.  
  35. */
  36.  
  37. // INSTANCES //
  38. const
  39. invidious = "yewtu.be",
  40. // Instances: https://docs.invidious.io/Invidious-Instances.md
  41.  
  42. searx = "search.mdosch.de",
  43. // Instances: https://searx.space
  44.  
  45. libreddit = "reddit.invak.id",
  46. // Instaces: https://rustrepo.com/repo/spikecodes-libreddit-rust-miscellaneous#instances
  47.  
  48. nitter = "nitter.snopyta.org",
  49. // Instaces: https://github-wiki-see.page/m/zedeus/nitter/wiki/Instances
  50.  
  51. bibliogram = "bibliogram.pussthecat.org",
  52. // Instaces: https://git.sr.ht/~cadence/bibliogram-docs/tree/master/docs/Instances.md
  53.  
  54. wikiless = "wikiless.org"
  55. // Instances: https://codeberg.org/orenom/Wikiless/src/branch/main/instances.json
  56.  
  57. // YouTube | Invidious //
  58. if(window.location.host.indexOf('youtube.com') != -1){
  59. window.location.replace('https://' + invidious + window.location.pathname + window.location.search)
  60. }
  61.  
  62. // Google | SearX //
  63. if(window.location.host.indexOf('google.com') != -1){
  64. window.location.replace('https://' + searx + window.location.pathname + window.location.search)
  65. }
  66.  
  67. // Yahoo | SearX //
  68. if(window.location.host.indexOf('yahoo.com') != -1){
  69. let search = window.location.search.replace('?p', '?q')
  70. window.location.replace('https://' + searx + window.location.pathname + search)
  71. }
  72.  
  73. // Bing | SearX //
  74. if(window.location.host.indexOf('bing.com') != -1){
  75. window.location.replace('https://' + searx + window.location.pathname + window.location.search)
  76. }
  77.  
  78. // DuckDuckGo | SearX //
  79. if(window.location.host.indexOf('duckduckgo.com') != -1){
  80. window.location.replace('https://' + searx + window.location.pathname + window.location.search)
  81. }
  82.  
  83. // Reddit | Libreddit //
  84. if(window.location.host.indexOf('reddit.com') != -1){
  85. window.location.replace('https://' + libreddit + window.location.pathname + window.location.search)
  86. }
  87.  
  88. // Twitter | Nitter //
  89. if(window.location.host.indexOf('twitter.com') != -1){
  90. window.location.replace('https://' + nitter + window.location.pathname + window.location.search)
  91. }
  92.  
  93. // Instagram | Bibliogram //
  94. if(window.location.host.indexOf('instagram.com') != -1){
  95. window.location.replace('https://' + bibliogram + window.location.pathname + window.location.search)
  96. }
  97.  
  98. // Wikipedia | Wikiless //
  99. if(window.location.host.indexOf('wikipedia.org') != -1){
  100. let url = new URL(window.location.href);
  101. let sub = url.hostname.split('.')[0];
  102. window.location.replace('https://' + wikiless + window.location.pathname + '?lang=' + sub)
  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.