mirror of
https://github.com/SimonBrazell/privacy-redirect
synced 2025-01-09 15:24:54 +01:00
This commit is contained in:
parent
20a2713a56
commit
f56fc68188
@ -2,7 +2,9 @@
|
||||
|
||||
[![Awesome Humane Tech](https://raw.githubusercontent.com/humanetech-community/awesome-humane-tech/main/humane-tech-badge.svg?sanitize=true)](https://github.com/humanetech-community/awesome-humane-tech)
|
||||
|
||||
[![Donate](https://liberapay.com/src/assets/widgets/donate.svg)](https://liberapay.com/SimonBrazell/donate) [![Buy me a coffee](src/assets/images/buy-me-a-coffee.png)](https://www.buymeacoffee.com/SimonBrazell)
|
||||
[![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/SimonBrazell/donate) [![Buy me a coffee](src/assets/images/buy-me-a-coffee.png)](https://www.buymeacoffee.com/SimonBrazell)
|
||||
|
||||
<img src="https://img.shields.io/liberapay/receives/SimonBrazell.svg?logo=liberapay">
|
||||
|
||||
## Get
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
export default class {
|
||||
static filterInstances(instances) {
|
||||
return instances.filter((instance) => !instance.includes(".onion"));
|
||||
}
|
||||
|
||||
static getRandomInstance(instances) {
|
||||
return instances[~~(instances.length * Math.random())];
|
||||
}
|
||||
function filterInstances(instances) {
|
||||
return instances.filter((instance) => !instance.includes(".onion"));
|
||||
}
|
||||
|
||||
function getRandomInstance(instances) {
|
||||
return instances[~~(instances.length * Math.random())];
|
||||
}
|
||||
|
||||
export default {
|
||||
filterInstances,
|
||||
getRandomInstance,
|
||||
};
|
||||
|
@ -1,43 +1,52 @@
|
||||
export default class {
|
||||
static targets = /https?:\/\/(((www|maps)\.)?(google\.).*(\/maps)|maps\.(google\.).*)/;
|
||||
static redirects = ["https://openstreetmap.org"];
|
||||
static mapCentreRegex = /@(-?\d[0-9.]*),(-?\d[0-9.]*),(\d{1,2})[.z]/;
|
||||
static dataLatLngRegex = /(!3d|!4d)(-?[0-9]{1,10}.[0-9]{1,10})/g;
|
||||
static placeRegex = /\/place\/(.*)\//;
|
||||
static travelModes = {
|
||||
driving: "fossgis_osrm_car",
|
||||
walking: "fossgis_osrm_foot",
|
||||
bicycling: "fossgis_osrm_bike",
|
||||
transit: "fossgis_osrm_car", // not implemented on OSM, default to car.
|
||||
};
|
||||
static layers = {
|
||||
none: "S",
|
||||
transit: "T",
|
||||
traffic: "S", // not implemented on OSM, default to standard.
|
||||
bicycling: "C",
|
||||
};
|
||||
static addressToLatLng(address, callback) {
|
||||
const xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = () => {
|
||||
if (xmlhttp.readyState === XMLHttpRequest.DONE) {
|
||||
if (xmlhttp.status === 200) {
|
||||
const json = JSON.parse(xmlhttp.responseText)[0];
|
||||
if (json) {
|
||||
callback(
|
||||
`${json.lat}%2C${json.lon}`,
|
||||
`${json.boundingbox[2]},${json.boundingbox[1]},${json.boundingbox[3]},${json.boundingbox[0]}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.info("Error: Status is " + xmlhttp.status);
|
||||
const targets = /https?:\/\/(((www|maps)\.)?(google\.).*(\/maps)|maps\.(google\.).*)/;
|
||||
const redirects = ["https://openstreetmap.org"];
|
||||
const mapCentreRegex = /@(-?\d[0-9.]*),(-?\d[0-9.]*),(\d{1,2})[.z]/;
|
||||
const dataLatLngRegex = /(!3d|!4d)(-?[0-9]{1,10}.[0-9]{1,10})/g;
|
||||
const placeRegex = /\/place\/(.*)\//;
|
||||
const travelModes = {
|
||||
driving: "fossgis_osrm_car",
|
||||
walking: "fossgis_osrm_foot",
|
||||
bicycling: "fossgis_osrm_bike",
|
||||
transit: "fossgis_osrm_car", // not implemented on OSM, default to car.
|
||||
};
|
||||
const layers = {
|
||||
none: "S",
|
||||
transit: "T",
|
||||
traffic: "S", // not implemented on OSM, default to standard.
|
||||
bicycling: "C",
|
||||
};
|
||||
function addressToLatLng(address, callback) {
|
||||
const xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = () => {
|
||||
if (xmlhttp.readyState === XMLHttpRequest.DONE) {
|
||||
if (xmlhttp.status === 200) {
|
||||
const json = JSON.parse(xmlhttp.responseText)[0];
|
||||
if (json) {
|
||||
callback(
|
||||
`${json.lat}%2C${json.lon}`,
|
||||
`${json.boundingbox[2]},${json.boundingbox[1]},${json.boundingbox[3]},${json.boundingbox[0]}`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.info("Error: Status is " + xmlhttp.status);
|
||||
}
|
||||
};
|
||||
xmlhttp.open(
|
||||
"GET",
|
||||
`https://nominatim.openstreetmap.org/search/${address}?format=json&limit=1`,
|
||||
false
|
||||
);
|
||||
xmlhttp.send();
|
||||
}
|
||||
}
|
||||
};
|
||||
xmlhttp.open(
|
||||
"GET",
|
||||
`https://nominatim.openstreetmap.org/search/${address}?format=json&limit=1`,
|
||||
false
|
||||
);
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
mapCentreRegex,
|
||||
dataLatLngRegex,
|
||||
placeRegex,
|
||||
travelModes,
|
||||
layers,
|
||||
addressToLatLng,
|
||||
};
|
||||
|
@ -1,9 +1,12 @@
|
||||
export default class {
|
||||
static targets = /https?:\/\/(((www|maps)\.)?(google\.).*(\/search)|search\.(google\.).*)/;
|
||||
static redirects = [
|
||||
{ link: "https://duckduckgo.com", q: "/" },
|
||||
{ link: "https://startpage.com", q: "/search/" },
|
||||
{ link: "https://www.qwant.com", q: "/" },
|
||||
{ link: "https://www.mojeek.com", q: "/search" },
|
||||
];
|
||||
}
|
||||
const targets = /https?:\/\/(((www|maps)\.)?(google\.).*(\/search)|search\.(google\.).*)/;
|
||||
const redirects = [
|
||||
{ link: "https://duckduckgo.com", q: "/" },
|
||||
{ link: "https://startpage.com", q: "/search/" },
|
||||
{ link: "https://www.qwant.com", q: "/" },
|
||||
{ link: "https://www.mojeek.com", q: "/search" },
|
||||
];
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
};
|
||||
|
@ -1,47 +1,52 @@
|
||||
export default class {
|
||||
static targets = [
|
||||
"instagram.com",
|
||||
"www.instagram.com",
|
||||
"help.instagram.com",
|
||||
"about.instagram.com",
|
||||
];
|
||||
static redirects = [
|
||||
"https://bibliogram.art",
|
||||
"https://bibliogram.snopyta.org",
|
||||
"https://bibliogram.pussthecat.org",
|
||||
"https://bibliogram.nixnet.services",
|
||||
"https://bg.endl.site",
|
||||
"https://bibliogram.13ad.de",
|
||||
"https://bibliogram.pixelfed.uno",
|
||||
"https://bibliogram.ethibox.fr",
|
||||
"https://bibliogram.hamster.dance",
|
||||
"https://bibliogram.kavin.rocks",
|
||||
"https://bibliogram.ggc-project.de",
|
||||
];
|
||||
static reservedPaths = [
|
||||
"about",
|
||||
"explore",
|
||||
"support",
|
||||
"press",
|
||||
"api",
|
||||
"privacy",
|
||||
"safety",
|
||||
"admin",
|
||||
"graphql",
|
||||
"accounts",
|
||||
"help",
|
||||
"terms",
|
||||
"contact",
|
||||
"blog",
|
||||
"igtv",
|
||||
"u",
|
||||
"p",
|
||||
"fragment",
|
||||
"imageproxy",
|
||||
"videoproxy",
|
||||
".well-known",
|
||||
"tv",
|
||||
"reel",
|
||||
];
|
||||
static bypassPaths = /\/(accounts\/|embeds?.js)/;
|
||||
}
|
||||
const targets = [
|
||||
"instagram.com",
|
||||
"www.instagram.com",
|
||||
"help.instagram.com",
|
||||
"about.instagram.com",
|
||||
];
|
||||
const redirects = [
|
||||
"https://bibliogram.art",
|
||||
"https://bibliogram.snopyta.org",
|
||||
"https://bibliogram.pussthecat.org",
|
||||
"https://bibliogram.nixnet.services",
|
||||
"https://bg.endl.site",
|
||||
"https://bibliogram.13ad.de",
|
||||
"https://bibliogram.pixelfed.uno",
|
||||
"https://bibliogram.ethibox.fr",
|
||||
"https://bibliogram.hamster.dance",
|
||||
"https://bibliogram.kavin.rocks",
|
||||
"https://bibliogram.ggc-project.de",
|
||||
];
|
||||
const reservedPaths = [
|
||||
"about",
|
||||
"explore",
|
||||
"support",
|
||||
"press",
|
||||
"api",
|
||||
"privacy",
|
||||
"safety",
|
||||
"admin",
|
||||
"graphql",
|
||||
"accounts",
|
||||
"help",
|
||||
"terms",
|
||||
"contact",
|
||||
"blog",
|
||||
"igtv",
|
||||
"u",
|
||||
"p",
|
||||
"fragment",
|
||||
"imageproxy",
|
||||
"videoproxy",
|
||||
".well-known",
|
||||
"tv",
|
||||
"reel",
|
||||
];
|
||||
const bypassPaths = /\/(accounts\/|embeds?.js)/;
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
reservedPaths,
|
||||
bypassPaths,
|
||||
};
|
||||
|
@ -1,24 +1,28 @@
|
||||
export default class {
|
||||
static targets = [
|
||||
"www.reddit.com",
|
||||
"np.reddit.com",
|
||||
"new.reddit.com",
|
||||
"amp.reddit.com",
|
||||
];
|
||||
static redirects = [
|
||||
"https://old.reddit.com", // desktop
|
||||
"https://i.reddit.com", // mobile
|
||||
// teddit: privacy w/ old UI
|
||||
"https://teddit.net",
|
||||
"https://teddit.ggc-project.de",
|
||||
"https://teddit.kavin.rocks",
|
||||
"https://snew.notabug.io", // anti-censorship
|
||||
// libreddit: privacy w/ modern UI
|
||||
"https://libredd.it",
|
||||
"https://libreddit.spike.codes",
|
||||
"https://libreddit.kavin.rocks",
|
||||
"https://libreddit.insanity.wtf",
|
||||
"https://libreddit.dothq.co",
|
||||
];
|
||||
static bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/;
|
||||
}
|
||||
const targets = [
|
||||
"www.reddit.com",
|
||||
"np.reddit.com",
|
||||
"new.reddit.com",
|
||||
"amp.reddit.com",
|
||||
];
|
||||
const redirects = [
|
||||
"https://old.reddit.com", // desktop
|
||||
"https://i.reddit.com", // mobile
|
||||
// teddit: privacy w/ old UI
|
||||
"https://teddit.net",
|
||||
"https://teddit.ggc-project.de",
|
||||
"https://teddit.kavin.rocks",
|
||||
"https://snew.notabug.io", // anti-censorship
|
||||
// libreddit: privacy w/ modern UI
|
||||
"https://libredd.it",
|
||||
"https://libreddit.spike.codes",
|
||||
"https://libreddit.kavin.rocks",
|
||||
"https://libreddit.insanity.wtf",
|
||||
"https://libreddit.dothq.co",
|
||||
];
|
||||
const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/;
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
bypassPaths,
|
||||
};
|
||||
|
@ -1,38 +1,41 @@
|
||||
export default class {
|
||||
/*
|
||||
/*
|
||||
Please remember to also update the manifest.json file
|
||||
(content_scripts > matches, 'remove-twitter-sw.js')
|
||||
when updating this list:
|
||||
*/
|
||||
static targets = [
|
||||
"twitter.com",
|
||||
"www.twitter.com",
|
||||
"mobile.twitter.com",
|
||||
"pbs.twimg.com",
|
||||
"video.twimg.com",
|
||||
];
|
||||
static redirects = [
|
||||
"https://nitter.net",
|
||||
"https://nitter.snopyta.org",
|
||||
"https://nitter.42l.fr",
|
||||
"https://nitter.nixnet.services",
|
||||
"https://nitter.13ad.de",
|
||||
"https://nitter.pussthecat.org",
|
||||
"https://nitter.mastodont.cat",
|
||||
"https://nitter.dark.fail",
|
||||
"https://nitter.tedomum.net",
|
||||
"https://nitter.cattube.org",
|
||||
"https://nitter.fdn.fr",
|
||||
"https://nitter.1d4.us",
|
||||
"https://nitter.kavin.rocks",
|
||||
"https://tweet.lambda.dance",
|
||||
"https://nitter.cc",
|
||||
"https://nitter.weaponizedhumiliation.com",
|
||||
"https://nitter.vxempire.xyz",
|
||||
"https://nitter.unixfox.eu",
|
||||
"http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion",
|
||||
"http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion",
|
||||
"http://nitterlgj3n5fgwesu3vxc5h67ruku33nqaoeoocae2mvlzhsu6k7fqd.onion",
|
||||
"http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion",
|
||||
];
|
||||
}
|
||||
const targets = [
|
||||
"twitter.com",
|
||||
"www.twitter.com",
|
||||
"mobile.twitter.com",
|
||||
"pbs.twimg.com",
|
||||
"video.twimg.com",
|
||||
];
|
||||
const redirects = [
|
||||
"https://nitter.net",
|
||||
"https://nitter.snopyta.org",
|
||||
"https://nitter.42l.fr",
|
||||
"https://nitter.nixnet.services",
|
||||
"https://nitter.13ad.de",
|
||||
"https://nitter.pussthecat.org",
|
||||
"https://nitter.mastodont.cat",
|
||||
"https://nitter.dark.fail",
|
||||
"https://nitter.tedomum.net",
|
||||
"https://nitter.cattube.org",
|
||||
"https://nitter.fdn.fr",
|
||||
"https://nitter.1d4.us",
|
||||
"https://nitter.kavin.rocks",
|
||||
"https://tweet.lambda.dance",
|
||||
"https://nitter.cc",
|
||||
"https://nitter.weaponizedhumiliation.com",
|
||||
"https://nitter.vxempire.xyz",
|
||||
"https://nitter.unixfox.eu",
|
||||
"http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion",
|
||||
"http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion",
|
||||
"http://nitterlgj3n5fgwesu3vxc5h67ruku33nqaoeoocae2mvlzhsu6k7fqd.onion",
|
||||
"http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion",
|
||||
];
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
};
|
||||
|
@ -1,33 +1,36 @@
|
||||
export default class {
|
||||
static targets = [
|
||||
"m.youtube.com",
|
||||
"youtube.com",
|
||||
"img.youtube.com",
|
||||
"www.youtube.com",
|
||||
"youtube-nocookie.com",
|
||||
"www.youtube-nocookie.com",
|
||||
"youtu.be",
|
||||
"s.ytimg.com",
|
||||
"music.youtube.com",
|
||||
];
|
||||
/*
|
||||
const targets = [
|
||||
"m.youtube.com",
|
||||
"youtube.com",
|
||||
"img.youtube.com",
|
||||
"www.youtube.com",
|
||||
"youtube-nocookie.com",
|
||||
"www.youtube-nocookie.com",
|
||||
"youtu.be",
|
||||
"s.ytimg.com",
|
||||
"music.youtube.com",
|
||||
];
|
||||
/*
|
||||
Please remember to also update the manifest.json file
|
||||
(content_scripts > matches, 'persist-invidious-prefs.js')
|
||||
when updating this list:
|
||||
*/
|
||||
static redirects = [
|
||||
"https://invidious.snopyta.org",
|
||||
"https://invidious.xyz",
|
||||
"https://invidious.kavin.rocks",
|
||||
"https://tube.connect.cafe",
|
||||
"https://invidious.zapashcanon.fr",
|
||||
"https://invidiou.site",
|
||||
"https://vid.mint.lgbt",
|
||||
"https://invidious.site",
|
||||
"https://yewtu.be",
|
||||
"http://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion",
|
||||
"http://qklhadlycap4cnod.onion",
|
||||
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
||||
"http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
|
||||
];
|
||||
}
|
||||
const redirects = [
|
||||
"https://invidious.snopyta.org",
|
||||
"https://invidious.xyz",
|
||||
"https://invidious.kavin.rocks",
|
||||
"https://tube.connect.cafe",
|
||||
"https://invidious.zapashcanon.fr",
|
||||
"https://invidiou.site",
|
||||
"https://vid.mint.lgbt",
|
||||
"https://invidious.site",
|
||||
"https://yewtu.be",
|
||||
"http://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion",
|
||||
"http://qklhadlycap4cnod.onion",
|
||||
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
||||
"http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
|
||||
];
|
||||
|
||||
export default {
|
||||
targets,
|
||||
redirects,
|
||||
};
|
||||
|
@ -481,7 +481,7 @@ input[type="range"]::-moz-range-thumb {
|
||||
}
|
||||
|
||||
.collapsible:after {
|
||||
content: "\002B";
|
||||
content: "\25BE";
|
||||
color: var(--active);
|
||||
font-weight: bold;
|
||||
float: right;
|
||||
@ -496,7 +496,7 @@ input[type="range"]::-moz-range-thumb {
|
||||
}
|
||||
|
||||
.collapsible-active:after {
|
||||
content: "\002D";
|
||||
content: "\25B4";
|
||||
color: var(--text-secondary);
|
||||
font-weight: bold;
|
||||
float: right;
|
||||
|
@ -1 +1,2 @@
|
||||
<!DOCTYPE html>
|
||||
<script type="module" src="background.js"></script>
|
||||
|
@ -25,6 +25,7 @@ const autocompletes = [
|
||||
instances: searchEngineInstances.map((instance) => instance.link),
|
||||
},
|
||||
];
|
||||
const domparser = new DOMParser();
|
||||
|
||||
let nitterInstance = document.getElementById("nitter-instance");
|
||||
let invidiousInstance = document.getElementById("invidious-instance");
|
||||
@ -69,7 +70,9 @@ function prependExceptionsItem(item, index) {
|
||||
<line x1='368' y1='144' x2='144' y2='368'
|
||||
style='fill:none;stroke:#FFF;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px' />
|
||||
</svg>`;
|
||||
button.innerHTML = svg;
|
||||
button.appendChild(
|
||||
domparser.parseFromString(svg, "image/svg+xml").documentElement
|
||||
);
|
||||
button.addEventListener("click", () => {
|
||||
exceptions.splice(index, 1);
|
||||
browser.storage.sync.set({
|
||||
@ -465,9 +468,10 @@ function autocomplete(input, list) {
|
||||
}
|
||||
function getItem(item, val) {
|
||||
let div = document.createElement("div");
|
||||
div.innerHTML = "<strong>" + item.substr(0, val.length) + "</strong>";
|
||||
div.innerHTML += item.substr(val.length);
|
||||
div.innerHTML += "<input type='hidden' value='" + item + "'>";
|
||||
let html = `<strong>${item.substr(0, val.length)}</strong>${item.substr(
|
||||
val.length
|
||||
)}<input type='hidden' value='${item}'>`;
|
||||
div.appendChild(parser.parseFromString(html, "text/html").documentElement);
|
||||
div.addEventListener("click", function (e) {
|
||||
input.value = e.target.getElementsByTagName("input")[0].value;
|
||||
input.dispatchEvent(new Event("input"));
|
||||
|
Loading…
Reference in New Issue
Block a user