// ==UserScript== // @name Redirect to Privacy-Friendly Frontends // @version 1.3 // @description Redirect supported websites to alternative frontend instances // @match *://*.reddit.com/* // @match *://*.youtube.com/* // @match *://*.imgur.com/* // @match *://*.pinterest.com/* // @match *://*.instagram.com/* // @match *://*.wikipedia.org/* // @match *://*.medium.com/* // @match *://*.gelbooru.com/* // @match *://*.github.com/* // @run-at document-start // @grant none // ==/UserScript== (() => { 'use strict'; const redirects = { 'reddit.com': 'redlib.thepixora.com', 'youtube.com': 'inv.miningtcup.me', 'imgur.com': 'rimgo.nadeko.net', 'pinterest.com': 'binternet.nadeko.net', 'instagram.com': 'kittygram.nadeko.net', 'wikipedia.org': 'wikiless.miningtcup.me', 'medium.com': 'scribe.privacyredirect.com', 'gelbooru.com': 'gel.nadeko.net', 'github.com': 'gothub.libre.tw' }; const hostname = location.hostname.toLowerCase(); // Match the domain itself and any of its subdomains. const sourceDomain = Object.keys(redirects).find(domain => hostname === domain || hostname.endsWith(`.${domain}`) ); if (!sourceDomain) return; const targetHost = redirects[sourceDomain]; // Preserve the path, query string, and fragment. const targetUrl = `${location.protocol}//${targetHost}${location.pathname}${location.search}${location.hash}`; location.replace(targetUrl); })();