Redirecting2Frontend

This script links to the frontend of prominent services including YouTube, Twitter, Reddit, Imgur, Instagram, and TikTok. Updated from older script and reworked for newer frontends/frontend changes

  1. // ==UserScript==
  2. // @name Redirecting2Frontend
  3. // @match *://*/*
  4. // @exclude *://account*/*
  5. // @exclude *://message*/*
  6. // @exclude *://adsense.google.com/*
  7. // @exclude *://www.google.com/adsense/*
  8. // @exclude *://www.google.com/maps/*
  9. // @license MIT
  10. // @grant none
  11. // @version 2.2
  12. // @description This script links to the frontend of prominent services including YouTube, Twitter, Reddit, Imgur, Instagram, and TikTok. Updated from older script and reworked for newer frontends/frontend changes
  13. // @run-at document-start
  14. // @namespace https://greasyfork.org/users/1401273
  15. // ==/UserScript==
  16.  
  17. const hostname = window.location.hostname;
  18. const hosts = {
  19. "en.wikipedia.org": ["wiki.froth.zone", "wikiless.esmailelbob.xyz", "wikiless.northboot.xyz", "wl.vern.cc"],
  20. "i.imgur.com": ["rimgo.pussthecat.org", "rimgo.totaldarkness.net", "rimgo.vern.cc", "imgur.artemislena.eu", "rimgo.privacydev.net", "rimgo.bus-hit.me"],
  21. "i.stack.imgur.com": ["rimgo.pussthecat.org", "rimgo.totaldarkness.net", "rimgo.vern.cc", "imgur.artemislena.eu", "rimgo.privacydev.net", "rimgo.bus-hit.me"],//
  22. "imgur.com": ["rimgo.pussthecat.org", "rimgo.totaldarkness.net", "rimgo.vern.cc", "imgur.artemislena.eu", "rimgo.privacydev.net", "rimgo.bus-hit.me"],
  23. "m.youtube.com": ["inv.nadeko.net", "invidious.nerdvpn.de"],
  24. "medium.com": ["scribe.rip", "scribe.nixnet.services", "scribe.citizen4.eu", "scribe.bus-hit.me", "scribe.froth.zone", "scribe.rawbit.ninja"],
  25. "mobile.x.com": ["xcancel.com", "twstalker.com", "nitter.poast.org"],
  26. "music.youtube.com": ["hyperpipe.surge.sh", "hyperpipe.drgns.space", "hp.iqbalrifai.eu.org", "hyperpipe.projectsegfau.lt"],
  27. "odysee.com": ["lbry.projectsegfau.lt", "librarian.esmailelbob.xyz", "lbry.us.projectsegfau.lt", "lbry.ramondia.net"],
  28. "old.reddit.com": ["photon-reddit.com"],
  29. "stackoverflow.com": ["code.whatever.social", "ao.vern.cc", "overflow.adminforge.de", "ao.foss.wtf", "overflow.hostux.net"],
  30. "translate.google.com": ["tl.vern.cc", "translate.slipfox.xyz", "mozhi.aryak.me", "translate.projectsegfau.lt", "mozhi.gitro.xyz"],
  31. "www.goodreads.com": ["read.canine.tools", "biblioreads.ducks.party", "read.freedit.eu", "biblioreads.lunar.icu", "biblioreads.eu.org"],
  32. "www.imdb.com": ["ld.vern.cc", "libremdb.esmailelbob.xyz", "lmdb.tokhmi.xyz", "libremdb.iket.me", "libremdb.pussthecat.org"],
  33. "www.instagram.com": ["imginn.com"],
  34. "www.instructables.com": ["destructables.esmailelbob.xyz"],
  35. // "www.pinterest.com": ["bn.bloat.cat", "binternet.privacyredirect.com", "bn.opnxng.com", "binternet.4o1x5.dev"],
  36. "www.pixiv.net": ["pixivfe.drgns.space", "pixiv.perennialte.ch","pixivfe.thebunny.zone"],
  37. "www.quora.com": ["quetre.pussthecat.org", "quetre.gitro.xyz", "quetre.canine.tools", "quetre.r4fo.com"],
  38. "www.reddit.com": ["photon-reddit.com"],
  39. "www.reuters.com": ["neuters.de"],
  40. "www.snopes.com": ["sd.vern.cc", "suds.esmailelbob.xyz"],
  41. "www.tiktok.com": ["www.offtiktok.com", "tiktok.wpme.pl", "proxitok.belloworld.it"],
  42. "www.tumblr.com": ["pb.bloat.cat","priviblur.thebunny.zone"],
  43. "www.urbandictionary.com": ["rd.vern.cc"],
  44. "www.wolframalpha.com": ["wolfree.chickenkiller.com", "wolfree.crabdance.com", "wolfree.my.to", "wolfree.netlify.app", "wolfree.onrender.com", "wolfree.strangled.net"],
  45. "www.youtube-nocookie.com": ["inv.nadeko.net", "invidious.nerdvpn.de"],
  46. "x.com": ["xcancel.com", "twstalker.com", "nitter.poast.org"],
  47. // "web.archive.org": ["wayback-classic.net"],
  48. // "www.youtube.com": ["inv.nadeko.net", "invidious.nerdvpn.de"],
  49. };
  50.  
  51. const replaceUrl = (url) => {
  52. const { host, pathname } = new URL(url);
  53. if (host === 'genius.com' && pathname.endsWith('-lyrics')) {
  54. const randomHost = ['dm.vern.cc', 'sing.whatever.social'][Math.floor(Math.random() * 0.5)];
  55. return url.replace(host, randomHost);
  56. } else if (host in hosts) {
  57. let replacement = hosts[host];
  58. if (Array.isArray(replacement)) {
  59. replacement = replacement[Math.floor(Math.random() * replacement.length)];
  60. }
  61. return url.replace(host, replacement);
  62. }
  63. return url;
  64. };
  65.  
  66. try {
  67. const replacement = hosts[hostname];
  68. if (replacement) {
  69. const newUrl = replaceUrl(window.location.href);
  70. if (newUrl !== window.location.href) {
  71. window.location.replace(newUrl);
  72. }
  73. } else if (hostname === "genius.com" && window.location.pathname.endsWith("-lyrics")) {
  74. const randomHost = ["dm.vern.cc", "sing.whatever.social"][Math.floor(Math.random() * 0.5)];
  75. window.location.hostname = randomHost;
  76. } else if (hostname.endsWith('.bandcamp.com')) {
  77. const subdomain = hostname.slice(0, -'.bandcamp.com'.length);
  78. const path = window.location.pathname.split('/');
  79. if (path[1] === 'search') {
  80. const newUrl = `https://tent.bloatcat.tk/search.php?query=${path[2]}`;
  81. if (newUrl !== window.location.href) {
  82. window.location.replace(newUrl);
  83. }
  84. } else if (path[1] === 'img') {
  85. const newUrl = `https://tent.bloatcat.tk/image.php?file=${path[2]}`;
  86. if (newUrl !== window.location.href) {
  87. window.location.replace(newUrl);
  88. }
  89. } else if (path[1] === 'stream') {
  90. const [_, directory, format, file, token] = path;
  91. const newUrl = `https://tent.bloatcat.tk/audio.php?directory=${directory}&format=${format}&file=${file}&token=${token}`;
  92. if (newUrl !== window.location.href) {
  93. window.location.replace(newUrl);
  94. }
  95. } else {
  96. const newUrl = `https://tent.bloatcat.tk/release.php?artist=${subdomain}&type=${path[1]}&name=${path[2]}`;
  97. if (newUrl !== window.location.href) {
  98. window.location.replace(newUrl);
  99. }
  100. }
  101. }
  102. } catch (error) {
  103. console.error(error.message);
  104. }
  105.  
  106. window.addEventListener("load", function () {
  107. try {
  108. const iframes = document.querySelectorAll(`iframe[src*="${window.location.host}"]`);
  109. iframes.forEach(iframe => {
  110. const newIframe = document.createElement('iframe');
  111. const attributes = ['src', 'width', 'height', 'frameborder', 'allowfullscreen', 'allow', 'title'];
  112. attributes.forEach(attribute => {
  113. if (iframe.hasAttribute(attribute)) {
  114. newIframe.setAttribute(attribute, iframe.getAttribute(attribute));
  115. }
  116. });
  117. iframe.parentNode.replaceChild(newIframe, iframe);
  118. });
  119. const links = document.querySelectorAll("a");
  120. links.forEach(link => {
  121. const href = link.href;
  122. const newUrl = replaceUrl(href);
  123. if (newUrl !== href) {
  124. link.href = newUrl;
  125. }
  126. });
  127. } catch (error) {
  128. console.error(error.message);
  129. }
  130. });