Privacy Redirector

Redirect social media platforms to their privacy respecting frontends

Od 01.12.2021.. Pogledajte najnovija verzija.

  1. // ==UserScript==
  2. // @name Privacy Redirector
  3. // @namespace https://gist.github.com/dybdeskarphet/daf54cab6b1f510097a88104bec2e690
  4. // @license MIT
  5. // @version 1.0.4
  6. // @description Redirect social media platforms to their privacy respecting frontends
  7. // @description:tr Sosyal medya platformlarını, gizliliğe saygı duyan önyüzlerine yönlendirir
  8. // @run-at document-start
  9. // @match *://instagram.com/*
  10. // @match *://*.instagram.com/*
  11. // @match *://twitter.com/*
  12. // @match *://*.twitter.com/*
  13. // @match *://reddit.com/*
  14. // @match *://*.reddit.com/*
  15. // @match *://youtube.com/*
  16. // @match *://*.youtube.com/*
  17. // ==/UserScript==
  18.  
  19. function redirectInstagram() {
  20. if (window.location.pathname.indexOf("/p/") == 0) {
  21. window.stop();
  22. location.hostname = 'bibliogram.art';
  23. } else if (window.location.pathname == "/") {
  24. window.stop();
  25. location.hostname = 'bibliogram.art';
  26. } else {
  27. let oldUrlPath = window.location.pathname;
  28. let newURL = window.location.protocol + "//" + "bibliogram.art" + "/u" + oldUrlPath + window.location.search + window.location.hash;
  29. window.location.replace (newURL);
  30. }
  31. }
  32.  
  33. function redirectTwitter() {
  34. window.stop();
  35. location.hostname = "nitter.42l.fr";
  36. }
  37.  
  38. function redirectReddit() {
  39. window.stop();
  40. location.hostname = "teddit.net";
  41. }
  42.  
  43. function redirectYoutube() {
  44. if (window.location.pathname.indexOf("results?search_query") == 1) {
  45. window.stop();
  46. location.hostname = "yewtu.be";
  47. window.location.replace("results?search_query", "search?q");
  48. } else {
  49. window.stop();
  50. location.hostname = "yewtu.be";
  51. }
  52.  
  53. }
  54.  
  55. var urlHostname = window.location.hostname;
  56.  
  57. switch (urlHostname) {
  58. case "www.instagram.com":
  59. redirectInstagram();
  60. break;
  61. case "twitter.com":
  62. redirectTwitter();
  63. break;
  64.  
  65. case "mobile.twitter.com":
  66. redirectTwitter();
  67. break;
  68.  
  69. case "www.reddit.com":
  70. redirectReddit();
  71. break;
  72.  
  73. case "www.youtube.com":
  74. redirectYoutube();
  75. break;
  76.  
  77. case "m.youtube.com":
  78. redirectYoutube();
  79. break;
  80. }