Privacy Redirector

Redirect social media platforms to their privacy respecting frontends

2021-12-02 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

  1. // ==UserScript==
  2. // @name Privacy Redirector
  3. // @namespace https://github.com/dybdeskarphet/privacy-redirector
  4. // @license AGPLv3
  5. // @version 1.0.8
  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. function redirectInstagram() {
  19. if (window.location.pathname.indexOf("/p/") == 0) {
  20. window.stop();
  21. location.hostname = 'bibliogram.art';
  22. } else if (window.location.pathname == "/") {
  23. window.stop();
  24. location.hostname = 'bibliogram.art';
  25. } else {
  26. let oldUrlPath = window.location.pathname;
  27. let newURL = window.location.protocol + "//" + "bibliogram.art" + "/u" + oldUrlPath + window.location.search + window.location.hash;
  28. window.location.replace (newURL);
  29. }
  30. }
  31. function redirectTwitter() {
  32. window.stop();
  33. location.hostname = "nitter.42l.fr";
  34. }
  35. function redirectReddit() {
  36. window.stop();
  37. location.hostname = "teddit.net";
  38. }
  39. function redirectYoutube() {
  40. if (window.location.pathname.indexOf("results?search_query") == 1) {
  41. window.stop();
  42. location.hostname = "vid.puffyan.us";
  43. window.location.replace("results?search_query", "search?q");
  44. } else {
  45. window.stop();
  46. location.hostname = "vid.puffyan.us";
  47. }
  48. }
  49. var urlHostname = window.location.hostname;
  50. switch (urlHostname) {
  51. case "www.instagram.com":
  52. redirectInstagram();
  53. break;
  54. case "twitter.com":
  55. redirectTwitter();
  56. break;
  57. case "mobile.twitter.com":
  58. redirectTwitter();
  59. break;
  60. case "www.reddit.com":
  61. redirectReddit();
  62. break;
  63. case "www.youtube.com":
  64. redirectYoutube();
  65. break;
  66. case "m.youtube.com":
  67. redirectYoutube();
  68. break;
  69. }