Privacy Frontend Redirect

Redirect to privacy friendly front-ends of popular services.

目前为 2023-01-26 提交的版本。查看 最新版本

// ==UserScript==
// @name        Privacy Frontend Redirect
// @namespace   Privacy Frontend Redirect
// @match       *://*youtube.com/*
// @match       *://*youtu.be/*
// @match       *://*twitter.com/*
// @match       *://*reddit.com/*
// @grant       none
// @version     0.1
// @author      NoUser
// @description Redirect to privacy friendly front-ends of popular services.
// @run-at      document-start
// @license MIT
// ==/UserScript==

// YouTube
const yt = ["https://piped.tokhmi.xyz/", "https://piped.mha.fi/", "https://piped.syncpundit.io/", "https://yewtu.be/", "https://vid.puffyan.us/", "https://inv.riverside.rocks/", "https://inv.vern.cc/", "https://invidious.snopyta.org/"]
const ryt = yt[Math.floor(Math.random() * yt.length)];

if (window.location.href.match(/^https:\/\/www.youtube\.com\/watch\?v=*/)) { window.location.replace(ryt + window.location.href.substr(24,)) }

if (window.location.href.match(/^https:\/\/youtu\.be\/*/)) { window.location.replace(ryt + window.location.href.substr(16,)) }

// Twitter
const twt = ["https://nitter.sneed.network", "https://canada.unofficialbird.com", "https://nitter.privacytools.io", "https://nitter.foss.wtf", "https://nitter.privacy.com.de", "https://nitter.1d4.us", "https://nitter.pussthecat.org", "https://nitter.poast.org", "https://twitter.censors.us"]
const rtwt = twt[Math.floor(Math.random() * twt.length)];

if (window.location.href.match(/^https:\/\/twitter\.com\//)) { window.location.replace(rtwt + window.location.pathname) }

if (window.location.href.match(/^https:\/\/mobile\.twitter\.com\//)) { window.location.replace(rtwt + window.location.pathname) }

// Reddit
const red = ["https://libreddit.eu.org", "https://libreddit.spike.codes", "https://lr.odyssey346.dev", "https://rd.funami.tech", "https://libreddit.dcs0.hu", "https://libreddit.nl", "https://lr.vern.cc", "https://www.troddit.com"]
const rred = red[Math.floor(Math.random() * red.length)];

if (window.location.href.match(/^https:\/\/www\.reddit\.com\//)) { window.location.replace(rred + window.location.pathname) }