2020-08-27 07:22:46 +02:00
|
|
|
"use strict";
|
2019-10-07 13:59:31 +02:00
|
|
|
|
2020-03-21 10:34:32 +01:00
|
|
|
const youtubeDomains = [
|
2020-08-27 07:22:46 +02:00
|
|
|
"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",
|
2020-03-21 10:34:32 +01:00
|
|
|
];
|
2020-09-01 09:26:23 +02:00
|
|
|
const nitterInstances = [
|
|
|
|
"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",
|
2020-11-08 11:07:03 +01:00
|
|
|
"https://nitter.dark.fail",
|
2020-09-01 09:26:23 +02:00
|
|
|
"https://nitter.tedomum.net",
|
|
|
|
"https://nitter.cattube.org",
|
|
|
|
"https://nitter.fdn.fr",
|
|
|
|
"https://nitter.1d4.us",
|
|
|
|
"https://nitter.kavin.rocks",
|
2020-10-05 00:56:44 +02:00
|
|
|
"https://tweet.lambda.dance",
|
2020-11-08 11:07:03 +01:00
|
|
|
"https://nitter.cc",
|
|
|
|
"https://nitter.weaponizedhumiliation.com",
|
|
|
|
"https://nitter.vxempire.xyz",
|
2020-12-17 17:57:14 +01:00
|
|
|
"https://nitter.unixfox.eu",
|
2020-11-08 11:07:03 +01:00
|
|
|
"http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion",
|
|
|
|
"http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion",
|
|
|
|
"http://nitterlgj3n5fgwesu3vxc5h67ruku33nqaoeoocae2mvlzhsu6k7fqd.onion",
|
|
|
|
"http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion",
|
|
|
|
];
|
|
|
|
const twitterDomains = [
|
|
|
|
"twitter.com",
|
|
|
|
"www.twitter.com",
|
|
|
|
"mobile.twitter.com",
|
|
|
|
"pbs.twimg.com",
|
|
|
|
"video.twimg.com",
|
|
|
|
];
|
|
|
|
const invidiousInstances = [
|
|
|
|
"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",
|
2020-11-17 14:31:14 +01:00
|
|
|
"https://yewtu.be",
|
2020-11-08 11:07:03 +01:00
|
|
|
"http://fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad.onion",
|
|
|
|
"http://qklhadlycap4cnod.onion",
|
|
|
|
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
|
|
|
"http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
|
2020-09-01 09:26:23 +02:00
|
|
|
];
|
2020-04-09 11:37:56 +02:00
|
|
|
const instagramDomains = [
|
|
|
|
"instagram.com",
|
|
|
|
"www.instagram.com",
|
|
|
|
"help.instagram.com",
|
|
|
|
"about.instagram.com",
|
|
|
|
];
|
2020-05-08 14:40:07 +02:00
|
|
|
const instagramReservedPaths = [
|
2020-08-27 07:22:46 +02:00
|
|
|
"about",
|
|
|
|
"explore",
|
|
|
|
"support",
|
|
|
|
"press",
|
|
|
|
"api",
|
|
|
|
"privacy",
|
|
|
|
"safety",
|
|
|
|
"admin",
|
|
|
|
"graphql",
|
|
|
|
"accounts",
|
|
|
|
"help",
|
|
|
|
"terms",
|
|
|
|
"contact",
|
|
|
|
"blog",
|
|
|
|
"igtv",
|
|
|
|
"u",
|
|
|
|
"p",
|
|
|
|
"fragment",
|
|
|
|
"imageproxy",
|
|
|
|
"videoproxy",
|
|
|
|
".well-known",
|
2020-11-04 12:06:29 +01:00
|
|
|
"tv",
|
|
|
|
"reel",
|
2020-05-08 14:40:07 +02:00
|
|
|
];
|
2020-04-09 11:37:56 +02:00
|
|
|
const bibliogramBypassPaths = /\/(accounts\/|embeds?.js)/;
|
|
|
|
const bibliogramInstances = [
|
2020-08-27 07:22:46 +02:00
|
|
|
"https://bibliogram.art",
|
|
|
|
"https://bibliogram.snopyta.org",
|
2020-09-01 09:26:23 +02:00
|
|
|
"https://bibliogram.pussthecat.org",
|
|
|
|
"https://bibliogram.nixnet.services",
|
|
|
|
"https://bg.endl.site",
|
2020-10-05 00:56:44 +02:00
|
|
|
"https://bibliogram.13ad.de",
|
|
|
|
"https://bibliogram.pixelfed.uno",
|
2020-11-08 11:07:03 +01:00
|
|
|
"https://bibliogram.ethibox.fr",
|
2020-09-01 09:26:23 +02:00
|
|
|
"https://bibliogram.hamster.dance",
|
2020-10-05 00:56:44 +02:00
|
|
|
"https://bibliogram.kavin.rocks",
|
2020-09-01 09:26:23 +02:00
|
|
|
"https://bibliogram.ggc-project.de",
|
2020-04-09 11:37:56 +02:00
|
|
|
];
|
2020-08-27 07:22:46 +02:00
|
|
|
const osmDefault = "https://openstreetmap.org";
|
2020-09-06 04:50:59 +02:00
|
|
|
const redditDomains = [
|
|
|
|
"www.reddit.com",
|
|
|
|
"np.reddit.com",
|
|
|
|
"new.reddit.com",
|
2020-09-06 07:21:41 +02:00
|
|
|
"amp.reddit.com",
|
2020-09-06 04:50:59 +02:00
|
|
|
];
|
|
|
|
const redditBypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/;
|
2020-09-06 07:21:41 +02:00
|
|
|
const oldRedditViews = [
|
2020-11-29 21:42:38 +01:00
|
|
|
"https://teddit.net", // privacy
|
|
|
|
"https://snew.notabug.io", // anti-censorship
|
2020-09-06 07:21:41 +02:00
|
|
|
"https://old.reddit.com", // desktop
|
2020-11-29 21:42:38 +01:00
|
|
|
"https://i.reddit.com" // mobile
|
2020-09-06 04:50:59 +02:00
|
|
|
];
|
2020-09-06 07:31:15 +02:00
|
|
|
const oldRedditDefaultView = oldRedditViews[0];
|
2020-05-27 15:29:16 +02:00
|
|
|
const googleMapsRegex = /https?:\/\/(((www|maps)\.)?(google\.).*(\/maps)|maps\.(google\.).*)/;
|
2020-02-27 02:18:50 +01:00
|
|
|
const mapCentreRegex = /@(-?\d[0-9.]*),(-?\d[0-9.]*),(\d{1,2})[.z]/;
|
2020-02-23 06:19:32 +01:00
|
|
|
const dataLatLngRegex = /(!3d|!4d)(-?[0-9]{1,10}.[0-9]{1,10})/g;
|
2020-02-27 02:18:50 +01:00
|
|
|
const placeRegex = /\/place\/(.*)\//;
|
2020-02-25 12:18:22 +01:00
|
|
|
const travelModes = {
|
2020-08-27 07:22:46 +02:00
|
|
|
driving: "fossgis_osrm_car",
|
|
|
|
walking: "fossgis_osrm_foot",
|
|
|
|
bicycling: "fossgis_osrm_bike",
|
|
|
|
transit: "fossgis_osrm_car", // not implemented on OSM, default to car.
|
2020-02-25 12:18:22 +01:00
|
|
|
};
|
2020-02-27 02:18:50 +01:00
|
|
|
const layers = {
|
2020-08-27 07:22:46 +02:00
|
|
|
none: "S",
|
|
|
|
transit: "T",
|
|
|
|
traffic: "S", // not implemented on OSM, default to standard.
|
|
|
|
bicycling: "C",
|
|
|
|
};
|
2020-11-11 01:01:33 +01:00
|
|
|
const googleSearchRegex = /https?:\/\/(((www|maps)\.)?(google\.).*(\/search)|search\.(google\.).*)/;
|
2020-11-08 15:50:55 +01:00
|
|
|
const privateSearchEngine = [
|
|
|
|
{ link: "https://duckduckgo.com", q: "/" },
|
|
|
|
{ link: "https://startpage.com", q: "/search/" },
|
|
|
|
{ link: "https://www.qwant.com", q: "/" },
|
|
|
|
{ link: "https://www.mojeek.com", q: "/search" },
|
|
|
|
];
|
2019-10-07 13:59:31 +02:00
|
|
|
|
|
|
|
let disableNitter;
|
|
|
|
let disableInvidious;
|
2020-02-01 04:17:51 +01:00
|
|
|
let disableBibliogram;
|
2020-02-23 06:19:32 +01:00
|
|
|
let disableOsm;
|
2020-09-06 07:21:41 +02:00
|
|
|
let disableOldReddit;
|
2020-11-08 15:50:55 +01:00
|
|
|
let disableSearchEngine;
|
2020-03-10 06:03:28 +01:00
|
|
|
let nitterInstance;
|
|
|
|
let invidiousInstance;
|
|
|
|
let bibliogramInstance;
|
|
|
|
let osmInstance;
|
2020-09-06 07:21:41 +02:00
|
|
|
let oldRedditView;
|
2020-03-10 06:03:28 +01:00
|
|
|
let alwaysProxy;
|
2020-03-21 10:34:32 +01:00
|
|
|
let onlyEmbeddedVideo;
|
|
|
|
let videoQuality;
|
2020-05-08 14:40:07 +02:00
|
|
|
let invidiousDarkMode;
|
2020-07-12 03:26:48 +02:00
|
|
|
let invidiousVolume;
|
|
|
|
let invidiousPlayerStyle;
|
|
|
|
let invidiousSubtitles;
|
|
|
|
let invidiousAutoplay;
|
2020-11-04 11:55:42 +01:00
|
|
|
let useFreeTube;
|
2020-11-08 11:07:03 +01:00
|
|
|
let nitterRandomPool;
|
|
|
|
let invidiousRandomPool;
|
|
|
|
let bibliogramRandomPool;
|
2020-07-12 03:26:48 +02:00
|
|
|
let exceptions;
|
2019-10-07 13:59:31 +02:00
|
|
|
|
2020-02-24 04:19:56 +01:00
|
|
|
window.browser = window.browser || window.chrome;
|
|
|
|
|
2020-11-08 11:07:03 +01:00
|
|
|
function filterInstances(instances) {
|
|
|
|
return instances.filter((instance) => !instance.includes(".onion"));
|
|
|
|
}
|
|
|
|
|
2020-02-24 04:19:56 +01:00
|
|
|
browser.storage.sync.get(
|
2020-02-01 04:17:51 +01:00
|
|
|
[
|
2020-08-27 07:22:46 +02:00
|
|
|
"nitterInstance",
|
|
|
|
"invidiousInstance",
|
|
|
|
"bibliogramInstance",
|
|
|
|
"osmInstance",
|
2020-09-06 07:21:41 +02:00
|
|
|
"oldRedditView",
|
2020-08-27 07:22:46 +02:00
|
|
|
"disableNitter",
|
|
|
|
"disableInvidious",
|
|
|
|
"disableBibliogram",
|
|
|
|
"disableOsm",
|
2020-09-06 07:21:41 +02:00
|
|
|
"disableOldReddit",
|
2020-11-08 15:50:55 +01:00
|
|
|
"disableSearchEngine",
|
2020-08-27 07:22:46 +02:00
|
|
|
"alwaysProxy",
|
|
|
|
"onlyEmbeddedVideo",
|
|
|
|
"videoQuality",
|
|
|
|
"invidiousDarkMode",
|
|
|
|
"invidiousVolume",
|
|
|
|
"invidiousPlayerStyle",
|
|
|
|
"invidiousSubtitles",
|
|
|
|
"invidiousAutoplay",
|
2020-11-04 11:55:42 +01:00
|
|
|
"useFreeTube",
|
2020-11-08 11:07:03 +01:00
|
|
|
"nitterRandomPool",
|
|
|
|
"invidiousRandomPool",
|
|
|
|
"bibliogramRandomPool",
|
2020-08-27 07:22:46 +02:00
|
|
|
"exceptions",
|
2020-02-01 04:17:51 +01:00
|
|
|
],
|
2020-08-27 07:22:46 +02:00
|
|
|
(result) => {
|
2019-10-07 13:59:31 +02:00
|
|
|
disableNitter = result.disableNitter;
|
|
|
|
disableInvidious = result.disableInvidious;
|
2020-02-01 04:17:51 +01:00
|
|
|
disableBibliogram = result.disableBibliogram;
|
2020-02-23 06:19:32 +01:00
|
|
|
disableOsm = result.disableOsm;
|
2020-09-06 07:21:41 +02:00
|
|
|
disableOldReddit = result.disableOldReddit;
|
2020-11-08 15:50:55 +01:00
|
|
|
disableSearchEngine = result.disableSearchEngine;
|
2020-09-01 09:26:23 +02:00
|
|
|
nitterInstance = result.nitterInstance;
|
|
|
|
invidiousInstance = result.invidiousInstance;
|
|
|
|
bibliogramInstance = result.bibliogramInstance;
|
2020-02-23 06:19:32 +01:00
|
|
|
osmInstance = result.osmInstance || osmDefault;
|
2020-09-06 07:31:15 +02:00
|
|
|
oldRedditView = result.oldRedditView || oldRedditDefaultView;
|
2020-03-10 06:03:28 +01:00
|
|
|
alwaysProxy = result.alwaysProxy;
|
2020-03-21 10:34:32 +01:00
|
|
|
onlyEmbeddedVideo = result.onlyEmbeddedVideo;
|
|
|
|
videoQuality = result.videoQuality;
|
2020-05-08 14:40:07 +02:00
|
|
|
invidiousDarkMode = result.invidiousDarkMode;
|
2020-08-27 07:22:46 +02:00
|
|
|
exceptions = result.exceptions
|
|
|
|
? result.exceptions.map((e) => {
|
|
|
|
return new RegExp(e);
|
|
|
|
})
|
|
|
|
: [];
|
2020-07-12 03:26:48 +02:00
|
|
|
invidiousVolume = result.invidiousVolume;
|
|
|
|
invidiousPlayerStyle = result.invidiousPlayerStyle;
|
2020-08-27 07:22:46 +02:00
|
|
|
invidiousSubtitles = result.invidiousSubtitles || "";
|
2020-08-28 01:17:36 +02:00
|
|
|
invidiousAutoplay = result.invidiousAutoplay;
|
2020-11-04 11:55:42 +01:00
|
|
|
useFreeTube = result.useFreeTube;
|
2020-11-08 11:07:03 +01:00
|
|
|
nitterRandomPool = result.nitterRandomPool
|
|
|
|
? result.nitterRandomPool.split(",")
|
|
|
|
: filterInstances(nitterInstances);
|
|
|
|
invidiousRandomPool = result.invidiousRandomPool
|
|
|
|
? result.invidiousRandomPool.split(",")
|
|
|
|
: filterInstances(invidiousInstances);
|
|
|
|
bibliogramRandomPool = result.bibliogramRandomPool
|
|
|
|
? result.bibliogramRandomPool.split(",")
|
|
|
|
: filterInstances(bibliogramInstances);
|
2019-10-07 13:59:31 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-08-27 07:22:46 +02:00
|
|
|
browser.storage.onChanged.addListener((changes) => {
|
|
|
|
if ("nitterInstance" in changes) {
|
2020-09-01 09:26:23 +02:00
|
|
|
nitterInstance = changes.nitterInstance.newValue;
|
2019-10-07 13:59:31 +02:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousInstance" in changes) {
|
2020-09-01 09:26:23 +02:00
|
|
|
invidiousInstance = changes.invidiousInstance.newValue;
|
2019-10-07 13:59:31 +02:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("bibliogramInstance" in changes) {
|
2020-09-01 09:26:23 +02:00
|
|
|
bibliogramInstance = changes.bibliogramInstance.newValue;
|
2020-02-01 04:17:51 +01:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("osmInstance" in changes) {
|
2020-02-23 06:19:32 +01:00
|
|
|
osmInstance = changes.osmInstance.newValue || osmDefault;
|
|
|
|
}
|
2020-09-06 07:21:41 +02:00
|
|
|
if ("oldRedditView" in changes) {
|
2020-09-06 07:31:15 +02:00
|
|
|
oldRedditView = changes.oldRedditView.newValue || oldRedditDefaultView;
|
2020-09-06 04:50:59 +02:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("disableNitter" in changes) {
|
2019-10-07 13:59:31 +02:00
|
|
|
disableNitter = changes.disableNitter.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("disableInvidious" in changes) {
|
2019-10-07 13:59:31 +02:00
|
|
|
disableInvidious = changes.disableInvidious.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("disableBibliogram" in changes) {
|
2020-02-01 04:17:51 +01:00
|
|
|
disableBibliogram = changes.disableBibliogram.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("disableOsm" in changes) {
|
2020-02-23 06:19:32 +01:00
|
|
|
disableOsm = changes.disableOsm.newValue;
|
|
|
|
}
|
2020-09-06 07:21:41 +02:00
|
|
|
if ("disableOldReddit" in changes) {
|
|
|
|
disableOldReddit = changes.disableOldReddit.newValue;
|
2020-09-06 04:50:59 +02:00
|
|
|
}
|
2020-11-08 15:50:55 +01:00
|
|
|
if ("disableSearchEngine" in changes) {
|
|
|
|
disableSearchEngine = changes.disableSearchEngine.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("alwaysProxy" in changes) {
|
2020-03-10 06:03:28 +01:00
|
|
|
alwaysProxy = changes.alwaysProxy.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("onlyEmbeddedVideo" in changes) {
|
2020-03-21 10:34:32 +01:00
|
|
|
onlyEmbeddedVideo = changes.onlyEmbeddedVideo.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("videoQuality" in changes) {
|
2020-03-21 10:34:32 +01:00
|
|
|
videoQuality = changes.videoQuality.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousDarkMode" in changes) {
|
2020-05-08 14:40:07 +02:00
|
|
|
invidiousDarkMode = changes.invidiousDarkMode.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousVolume" in changes) {
|
2020-07-12 03:26:48 +02:00
|
|
|
invidiousVolume = changes.invidiousVolume.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousPlayerStyle" in changes) {
|
2020-07-12 03:26:48 +02:00
|
|
|
invidiousPlayerStyle = changes.invidiousPlayerStyle.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousSubtitles" in changes) {
|
2020-07-12 03:26:48 +02:00
|
|
|
invidiousSubtitles = changes.invidiousSubtitles.newValue;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("invidiousAutoplay" in changes) {
|
2020-07-12 03:26:48 +02:00
|
|
|
invidiousAutoplay = changes.invidiousAutoplay.newValue;
|
|
|
|
}
|
2020-11-04 11:55:42 +01:00
|
|
|
if ("useFreeTube" in changes) {
|
|
|
|
useFreeTube = changes.useFreeTube.newValue;
|
|
|
|
}
|
2020-11-08 11:07:03 +01:00
|
|
|
if ("nitterRandomPool" in changes) {
|
|
|
|
nitterRandomPool = changes.nitterRandomPool.newValue.split(",");
|
|
|
|
}
|
|
|
|
if ("invidiousRandomPool" in changes) {
|
|
|
|
invidiousRandomPool = changes.invidiousRandomPool.newValue.split(",");
|
|
|
|
}
|
|
|
|
if ("bibliogramRandomPool" in changes) {
|
|
|
|
bibliogramRandomPool = changes.bibliogramRandomPool.newValue.split(",");
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if ("exceptions" in changes) {
|
|
|
|
exceptions = changes.exceptions.newValue.map((e) => {
|
2020-07-12 03:26:48 +02:00
|
|
|
return new RegExp(e);
|
2020-06-08 03:50:12 +02:00
|
|
|
});
|
2020-06-07 14:08:15 +02:00
|
|
|
}
|
2019-10-07 13:59:31 +02:00
|
|
|
});
|
2019-09-20 12:45:58 +02:00
|
|
|
|
2020-09-01 09:26:23 +02:00
|
|
|
function getRandomInstance(instanceList) {
|
|
|
|
return instanceList[~~(instanceList.length * Math.random())];
|
|
|
|
}
|
|
|
|
|
2020-02-27 02:18:50 +01:00
|
|
|
function addressToLatLng(address, callback) {
|
2020-02-25 12:18:22 +01:00
|
|
|
const xmlhttp = new XMLHttpRequest();
|
|
|
|
xmlhttp.onreadystatechange = () => {
|
|
|
|
if (xmlhttp.readyState === XMLHttpRequest.DONE) {
|
|
|
|
if (xmlhttp.status === 200) {
|
|
|
|
const json = JSON.parse(xmlhttp.responseText)[0];
|
|
|
|
if (json) {
|
2020-02-25 13:41:01 +01:00
|
|
|
callback(
|
|
|
|
`${json.lat}%2C${json.lon}`,
|
|
|
|
`${json.boundingbox[2]},${json.boundingbox[1]},${json.boundingbox[3]},${json.boundingbox[0]}`
|
|
|
|
);
|
2020-02-25 12:18:22 +01:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
} else {
|
2020-02-25 12:18:22 +01:00
|
|
|
console.info("Error: Status is " + xmlhttp.status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
xmlhttp.open(
|
2020-08-27 07:22:46 +02:00
|
|
|
"GET",
|
2020-02-25 12:18:22 +01:00
|
|
|
`https://nominatim.openstreetmap.org/search/${address}?format=json&limit=1`,
|
|
|
|
false
|
|
|
|
);
|
|
|
|
xmlhttp.send();
|
|
|
|
}
|
|
|
|
|
2020-07-12 03:26:48 +02:00
|
|
|
function isException(url, initiator) {
|
2020-08-27 07:22:46 +02:00
|
|
|
return (
|
|
|
|
exceptions.some((regex) => regex.test(url.href)) ||
|
|
|
|
(initiator && exceptions.some((regex) => regex.test(initiator.href)))
|
|
|
|
);
|
2020-04-25 16:43:43 +02:00
|
|
|
}
|
|
|
|
|
2020-06-07 14:08:15 +02:00
|
|
|
function isFirefox() {
|
2020-08-27 07:22:46 +02:00
|
|
|
return typeof InstallTrigger !== "undefined";
|
2020-06-07 14:08:15 +02:00
|
|
|
}
|
|
|
|
|
2020-03-31 05:57:36 +02:00
|
|
|
function redirectYouTube(url, initiator, type) {
|
2020-07-12 03:26:48 +02:00
|
|
|
if (disableInvidious || isException(url, initiator)) {
|
2020-02-09 01:08:04 +01:00
|
|
|
return null;
|
2020-03-21 10:34:32 +01:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (
|
|
|
|
initiator &&
|
|
|
|
(initiator.origin === invidiousInstance ||
|
2020-09-01 09:26:23 +02:00
|
|
|
invidiousInstances.includes(initiator.origin) ||
|
2020-08-27 07:22:46 +02:00
|
|
|
youtubeDomains.includes(initiator.host))
|
|
|
|
) {
|
2020-03-31 05:57:36 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-05-31 02:26:15 +02:00
|
|
|
if (url.pathname.match(/iframe_api/) || url.pathname.match(/www-widgetapi/)) {
|
|
|
|
// Don't redirect YouTube Player API.
|
|
|
|
return null;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (url.host.split(".")[0] === "studio") {
|
2020-06-03 14:01:27 +02:00
|
|
|
// Avoid redirecting `studio.youtube.com`
|
|
|
|
return null;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (onlyEmbeddedVideo && type !== "sub_frame") {
|
2020-06-07 14:08:15 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-11-08 11:07:03 +01:00
|
|
|
if (useFreeTube && type === "main_frame") {
|
2020-11-04 11:55:42 +01:00
|
|
|
return `freetube://${url}`;
|
|
|
|
}
|
2020-06-07 14:08:15 +02:00
|
|
|
// Apply settings
|
2020-05-31 02:26:15 +02:00
|
|
|
if (alwaysProxy) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("local", true);
|
2020-05-31 02:26:15 +02:00
|
|
|
}
|
|
|
|
if (videoQuality) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("quality", videoQuality);
|
2020-05-31 02:26:15 +02:00
|
|
|
}
|
|
|
|
if (invidiousDarkMode) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("dark_mode", invidiousDarkMode);
|
2020-02-09 01:08:04 +01:00
|
|
|
}
|
2020-07-12 03:26:48 +02:00
|
|
|
if (invidiousVolume) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("volume", invidiousVolume);
|
2020-07-12 03:26:48 +02:00
|
|
|
}
|
|
|
|
if (invidiousPlayerStyle) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("player_style", invidiousPlayerStyle);
|
2020-07-12 03:26:48 +02:00
|
|
|
}
|
|
|
|
if (invidiousSubtitles) {
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("subtitles", invidiousSubtitles);
|
2020-07-12 03:26:48 +02:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
url.searchParams.append("autoplay", invidiousAutoplay ? 1 : 0);
|
2020-07-12 03:26:48 +02:00
|
|
|
|
2020-11-04 11:10:18 +01:00
|
|
|
return `${
|
2020-11-08 11:07:03 +01:00
|
|
|
invidiousInstance || getRandomInstance(invidiousRandomPool)
|
2020-11-04 11:10:18 +01:00
|
|
|
}${url.pathname.replace("/shorts", "")}${url.search}`;
|
2020-02-09 01:08:04 +01:00
|
|
|
}
|
|
|
|
|
2020-04-25 16:43:43 +02:00
|
|
|
function redirectTwitter(url, initiator) {
|
2020-07-12 03:26:48 +02:00
|
|
|
if (disableNitter || isException(url, initiator)) {
|
2020-02-11 23:35:58 +01:00
|
|
|
return null;
|
2020-03-21 10:34:32 +01:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (url.pathname.includes("/home")) {
|
2020-06-07 14:08:15 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (
|
|
|
|
isFirefox() &&
|
|
|
|
initiator &&
|
|
|
|
(initiator.origin === nitterInstance ||
|
2020-09-01 09:26:23 +02:00
|
|
|
nitterInstances.includes(initiator.origin) ||
|
2020-08-27 07:22:46 +02:00
|
|
|
twitterDomains.includes(initiator.host))
|
|
|
|
) {
|
2020-06-03 14:01:27 +02:00
|
|
|
browser.storage.sync.set({
|
2020-08-27 07:22:46 +02:00
|
|
|
redirectBypassFlag: true,
|
2020-06-03 14:01:27 +02:00
|
|
|
});
|
|
|
|
return null;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (url.host.split(".")[0] === "pbs") {
|
2020-09-01 09:26:23 +02:00
|
|
|
return `${
|
2020-11-08 11:07:03 +01:00
|
|
|
nitterInstance || getRandomInstance(nitterRandomPool)
|
2020-09-01 09:26:23 +02:00
|
|
|
}/pic/${encodeURIComponent(url.href)}`;
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.host.split(".")[0] === "video") {
|
2020-09-01 09:26:23 +02:00
|
|
|
return `${
|
2020-11-08 11:07:03 +01:00
|
|
|
nitterInstance || getRandomInstance(nitterRandomPool)
|
2020-09-01 09:26:23 +02:00
|
|
|
}/gif/${encodeURIComponent(url.href)}`;
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.pathname.includes("tweets")) {
|
2020-09-01 09:26:23 +02:00
|
|
|
return `${
|
2020-11-08 11:07:03 +01:00
|
|
|
nitterInstance || getRandomInstance(nitterRandomPool)
|
2020-09-01 09:26:23 +02:00
|
|
|
}${url.pathname.replace("/tweets", "")}${url.search}`;
|
2020-02-11 23:35:58 +01:00
|
|
|
} else {
|
2020-11-08 11:07:03 +01:00
|
|
|
return `${nitterInstance || getRandomInstance(nitterRandomPool)}${
|
2020-09-01 09:26:23 +02:00
|
|
|
url.pathname
|
|
|
|
}${url.search}`;
|
2020-02-11 23:35:58 +01:00
|
|
|
}
|
2020-02-09 01:08:04 +01:00
|
|
|
}
|
|
|
|
|
2020-04-09 11:37:56 +02:00
|
|
|
function redirectInstagram(url, initiator, type) {
|
2020-07-12 03:26:48 +02:00
|
|
|
if (disableBibliogram || isException(url, initiator)) {
|
2020-03-21 10:34:32 +01:00
|
|
|
return null;
|
|
|
|
}
|
2020-04-09 11:37:56 +02:00
|
|
|
// Do not redirect Bibliogram view on Instagram links
|
2020-08-27 07:22:46 +02:00
|
|
|
if (
|
|
|
|
initiator &&
|
|
|
|
(initiator.origin === bibliogramInstance ||
|
2020-09-01 09:26:23 +02:00
|
|
|
bibliogramInstances.includes(initiator.origin) ||
|
2020-08-27 07:22:46 +02:00
|
|
|
instagramDomains.includes(initiator.host))
|
|
|
|
) {
|
2020-03-31 05:57:36 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-04-09 11:37:56 +02:00
|
|
|
// Do not redirect /accounts, /embeds.js, or anything other than main_frame
|
2020-08-27 07:22:46 +02:00
|
|
|
if (type !== "main_frame" || url.pathname.match(bibliogramBypassPaths)) {
|
2020-04-09 11:37:56 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
if (
|
|
|
|
url.pathname === "/" ||
|
|
|
|
instagramReservedPaths.includes(url.pathname.split("/")[1])
|
|
|
|
) {
|
2020-11-08 11:07:03 +01:00
|
|
|
return `${bibliogramInstance || getRandomInstance(bibliogramRandomPool)}${
|
2020-09-01 09:26:23 +02:00
|
|
|
url.pathname
|
|
|
|
}${url.search}`;
|
2020-02-01 04:17:51 +01:00
|
|
|
} else {
|
2020-05-08 14:40:07 +02:00
|
|
|
// Likely a user profile, redirect to '/u/...'
|
2020-11-08 11:07:03 +01:00
|
|
|
return `${bibliogramInstance || getRandomInstance(bibliogramRandomPool)}/u${
|
2020-09-01 09:26:23 +02:00
|
|
|
url.pathname
|
|
|
|
}${url.search}`;
|
2020-02-01 04:17:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-25 16:43:43 +02:00
|
|
|
function redirectGoogleMaps(url, initiator) {
|
2020-07-12 03:26:48 +02:00
|
|
|
if (disableOsm || isException(url, initiator)) {
|
2020-03-21 10:34:32 +01:00
|
|
|
return null;
|
|
|
|
}
|
2020-02-25 13:41:01 +01:00
|
|
|
let redirect;
|
2020-08-27 07:22:46 +02:00
|
|
|
let mapCentre = "";
|
|
|
|
let params = "";
|
2020-02-27 02:18:50 +01:00
|
|
|
// Set map centre if present
|
|
|
|
if (url.pathname.match(mapCentreRegex)) {
|
|
|
|
const [, lat, lon, zoom] = url.pathname.match(mapCentreRegex);
|
2020-02-24 09:22:10 +01:00
|
|
|
mapCentre = `#map=${zoom}/${lat}/${lon}`;
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.search.includes("center=")) {
|
|
|
|
const [lat, lon] = url.searchParams.get("center").split(",");
|
|
|
|
mapCentre = `#map=${url.searchParams.get("zoom") || "17"}/${lat}/${lon}`;
|
2020-02-27 02:18:50 +01:00
|
|
|
// Set default zoom if mapCentre not present
|
|
|
|
} else {
|
2020-08-27 07:22:46 +02:00
|
|
|
params = "&zoom=17";
|
2020-02-23 06:19:32 +01:00
|
|
|
}
|
2020-02-27 02:18:50 +01:00
|
|
|
// Set map layer
|
2020-08-27 07:22:46 +02:00
|
|
|
params = `${params}&layers=${
|
|
|
|
layers[url.searchParams.get("layer")] || layers["none"]
|
|
|
|
}`;
|
2020-02-27 02:18:50 +01:00
|
|
|
// Handle Google Maps Embed API
|
2020-08-27 07:22:46 +02:00
|
|
|
if (url.pathname.includes("/embed")) {
|
|
|
|
let query = "";
|
|
|
|
if (url.searchParams.has("q")) {
|
|
|
|
query = url.searchParams.get("q");
|
|
|
|
} else if (url.searchParams.has("query")) {
|
|
|
|
query = url.searchParams.has("query");
|
|
|
|
} else if (url.searchParams.has("pb")) {
|
2020-03-31 05:57:36 +02:00
|
|
|
try {
|
2020-08-27 07:22:46 +02:00
|
|
|
query = url.searchParams.get("pb").split(/!2s(.*?)!/)[1];
|
2020-03-31 05:57:36 +02:00
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
// Unable to find map marker in URL.
|
|
|
|
}
|
|
|
|
}
|
2020-02-25 12:18:22 +01:00
|
|
|
let marker, bbox;
|
2020-02-27 02:18:50 +01:00
|
|
|
addressToLatLng(query, (coords, boundingbox) => {
|
2020-02-25 12:18:22 +01:00
|
|
|
marker = coords;
|
|
|
|
bbox = boundingbox;
|
|
|
|
});
|
2020-02-25 13:41:01 +01:00
|
|
|
redirect = `${osmInstance}/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${marker}`;
|
2020-02-27 02:18:50 +01:00
|
|
|
// Handle Google Maps Directions
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.pathname.includes("/dir")) {
|
|
|
|
const travelMode =
|
|
|
|
travelModes[url.searchParams.get("travelmode")] || travelModes["driving"];
|
2020-02-25 12:18:22 +01:00
|
|
|
let origin;
|
2020-08-27 07:22:46 +02:00
|
|
|
addressToLatLng(url.searchParams.get("origin"), (coords) => {
|
2020-02-25 12:18:22 +01:00
|
|
|
origin = coords;
|
|
|
|
});
|
|
|
|
let destination;
|
2020-08-27 07:22:46 +02:00
|
|
|
addressToLatLng(url.searchParams.get("destination"), (coords) => {
|
2020-02-25 12:18:22 +01:00
|
|
|
destination = coords;
|
|
|
|
});
|
2020-02-27 02:18:50 +01:00
|
|
|
redirect = `${osmInstance}/directions?engine=${travelMode}&route=${origin}%3B${destination}${mapCentre}${params}`;
|
|
|
|
// Get marker from data attribute
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (
|
|
|
|
url.pathname.includes("data=") &&
|
|
|
|
url.pathname.match(dataLatLngRegex)
|
|
|
|
) {
|
2020-02-24 04:19:56 +01:00
|
|
|
const [mlat, mlon] = url.pathname.match(dataLatLngRegex);
|
2020-08-27 07:22:46 +02:00
|
|
|
redirect = `${osmInstance}/?mlat=${mlat.replace(
|
|
|
|
"!3d",
|
|
|
|
""
|
|
|
|
)}&mlon=${mlon.replace("!4d", "")}${mapCentre}${params}`;
|
2020-02-27 02:18:50 +01:00
|
|
|
// Get marker from ll param
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.searchParams.has("ll")) {
|
|
|
|
const [mlat, mlon] = url.searchParams.get("ll").split(",");
|
2020-02-27 02:18:50 +01:00
|
|
|
redirect = `${osmInstance}/?mlat=${mlat}&mlon=${mlon}${mapCentre}${params}`;
|
|
|
|
// Get marker from viewpoint param.
|
2020-08-27 07:22:46 +02:00
|
|
|
} else if (url.searchParams.has("viewpoint")) {
|
|
|
|
const [mlat, mlon] = url.searchParams.get("viewpoint").split(",");
|
2020-02-27 02:18:50 +01:00
|
|
|
redirect = `${osmInstance}/?mlat=${mlat}&mlon=${mlon}${mapCentre}${params}`;
|
|
|
|
// Use query as search if present.
|
2020-02-24 04:19:56 +01:00
|
|
|
} else {
|
2020-02-27 02:18:50 +01:00
|
|
|
let query;
|
2020-08-27 07:22:46 +02:00
|
|
|
if (url.searchParams.has("q")) {
|
|
|
|
query = url.searchParams.get("q");
|
|
|
|
} else if (url.searchParams.has("query")) {
|
|
|
|
query = url.searchParams.get("query");
|
2020-02-27 02:18:50 +01:00
|
|
|
} else if (url.pathname.match(placeRegex)) {
|
|
|
|
query = url.pathname.match(placeRegex)[1];
|
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
redirect = `${osmInstance}/${query ? "search?query=" + query : ""}${
|
|
|
|
mapCentre || "#"
|
|
|
|
}${params}`;
|
2020-02-25 13:41:01 +01:00
|
|
|
}
|
2020-02-27 02:18:50 +01:00
|
|
|
|
2020-02-25 13:41:01 +01:00
|
|
|
return redirect;
|
2020-02-23 06:19:32 +01:00
|
|
|
}
|
|
|
|
|
2020-09-06 04:50:59 +02:00
|
|
|
function redirectReddit(url, initiator, type) {
|
2020-09-06 07:21:41 +02:00
|
|
|
if (disableOldReddit || isException(url, initiator)) {
|
2020-09-06 04:50:59 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-09-06 07:21:41 +02:00
|
|
|
// Do not redirect when already on the selected view
|
2020-11-08 11:07:03 +01:00
|
|
|
if (
|
|
|
|
(initiator && initiator.origin === oldRedditView) ||
|
|
|
|
url.origin === oldRedditView
|
|
|
|
) {
|
2020-09-06 04:50:59 +02:00
|
|
|
return null;
|
|
|
|
}
|
2020-09-06 07:32:23 +02:00
|
|
|
// Do not redirect exclusions nor anything other than main_frame
|
2020-09-06 04:50:59 +02:00
|
|
|
if (type !== "main_frame" || url.pathname.match(redditBypassPaths)) {
|
|
|
|
return null;
|
|
|
|
}
|
2020-09-06 07:21:41 +02:00
|
|
|
return `${oldRedditView}${url.pathname}${url.search}`;
|
2020-09-06 04:50:59 +02:00
|
|
|
}
|
|
|
|
|
2020-11-08 15:50:55 +01:00
|
|
|
function redirectSearchEngine(url, initiator) {
|
|
|
|
if (disableSearchEngine || isException(url, initiator)) {
|
|
|
|
return null;
|
|
|
|
}
|
2020-11-22 08:41:43 +01:00
|
|
|
|
|
|
|
let searchEngine = getRandomInstance(privateSearchEngine);
|
|
|
|
let search = "";
|
|
|
|
url.search
|
|
|
|
.slice(1)
|
|
|
|
.split("&")
|
|
|
|
.forEach(function (input) {
|
|
|
|
if (input.startsWith("q=")) search = input;
|
|
|
|
});
|
|
|
|
console.log("search: ", search);
|
|
|
|
return `${searchEngine.link}${searchEngine.q}?${search}`;
|
2020-11-08 15:50:55 +01:00
|
|
|
}
|
|
|
|
|
2020-02-24 04:19:56 +01:00
|
|
|
browser.webRequest.onBeforeRequest.addListener(
|
2020-08-27 07:22:46 +02:00
|
|
|
(details) => {
|
2020-02-01 04:17:51 +01:00
|
|
|
const url = new URL(details.url);
|
2020-03-31 08:39:57 +02:00
|
|
|
let initiator;
|
2020-07-12 03:26:48 +02:00
|
|
|
if (details.originUrl) {
|
2020-03-31 08:39:57 +02:00
|
|
|
initiator = new URL(details.originUrl);
|
2020-07-12 03:26:48 +02:00
|
|
|
} else if (details.initiator) {
|
|
|
|
initiator = new URL(details.initiator);
|
2020-03-31 08:39:57 +02:00
|
|
|
}
|
2020-01-14 10:48:37 +01:00
|
|
|
let redirect;
|
2020-03-21 10:34:32 +01:00
|
|
|
if (youtubeDomains.includes(url.host)) {
|
|
|
|
redirect = {
|
2020-08-27 07:22:46 +02:00
|
|
|
redirectUrl: redirectYouTube(url, initiator, details.type),
|
2020-03-21 10:34:32 +01:00
|
|
|
};
|
|
|
|
} else if (twitterDomains.includes(url.host)) {
|
|
|
|
redirect = {
|
2020-08-27 07:22:46 +02:00
|
|
|
redirectUrl: redirectTwitter(url, initiator),
|
2020-03-21 10:34:32 +01:00
|
|
|
};
|
2020-04-09 11:37:56 +02:00
|
|
|
} else if (instagramDomains.includes(url.host)) {
|
2020-03-21 10:34:32 +01:00
|
|
|
redirect = {
|
2020-08-27 07:22:46 +02:00
|
|
|
redirectUrl: redirectInstagram(url, initiator, details.type),
|
2020-03-21 10:34:32 +01:00
|
|
|
};
|
2020-02-23 06:19:32 +01:00
|
|
|
} else if (url.href.match(googleMapsRegex)) {
|
2020-03-21 10:34:32 +01:00
|
|
|
redirect = {
|
2020-08-27 07:22:46 +02:00
|
|
|
redirectUrl: redirectGoogleMaps(url, initiator),
|
2020-03-21 10:34:32 +01:00
|
|
|
};
|
2020-11-08 11:07:03 +01:00
|
|
|
} else if (
|
|
|
|
redditDomains.includes(url.host) ||
|
|
|
|
oldRedditViews.includes(url.origin)
|
|
|
|
) {
|
2020-09-06 04:50:59 +02:00
|
|
|
redirect = {
|
|
|
|
redirectUrl: redirectReddit(url, initiator, details.type),
|
2020-11-08 11:07:03 +01:00
|
|
|
};
|
2020-11-11 01:01:33 +01:00
|
|
|
} else if (url.href.match(googleSearchRegex)) {
|
2020-11-08 15:50:55 +01:00
|
|
|
redirect = {
|
|
|
|
redirectUrl: redirectSearchEngine(url, initiator),
|
|
|
|
};
|
2019-09-20 12:45:58 +02:00
|
|
|
}
|
2020-02-09 01:08:04 +01:00
|
|
|
if (redirect && redirect.redirectUrl) {
|
2020-02-25 12:18:22 +01:00
|
|
|
console.info(
|
2020-08-27 07:22:46 +02:00
|
|
|
"Redirecting",
|
|
|
|
`"${url.href}"`,
|
|
|
|
"=>",
|
|
|
|
`"${redirect.redirectUrl}"`
|
2020-02-01 04:17:51 +01:00
|
|
|
);
|
2020-08-27 07:22:46 +02:00
|
|
|
console.info("Details", details);
|
2020-01-14 10:48:37 +01:00
|
|
|
}
|
|
|
|
return redirect;
|
2019-09-20 12:45:58 +02:00
|
|
|
},
|
|
|
|
{
|
2020-08-27 07:22:46 +02:00
|
|
|
urls: ["<all_urls>"],
|
2019-09-20 12:45:58 +02:00
|
|
|
},
|
2020-08-27 07:22:46 +02:00
|
|
|
["blocking"]
|
2019-09-20 12:45:58 +02:00
|
|
|
);
|
2020-04-09 11:37:56 +02:00
|
|
|
|
2020-08-27 07:22:46 +02:00
|
|
|
browser.runtime.onInstalled.addListener((details) => {
|
2020-09-01 09:26:23 +02:00
|
|
|
if (details.reason === "update") {
|
2020-08-27 07:22:46 +02:00
|
|
|
browser.storage.sync.get(
|
|
|
|
["whitelist", "exceptions", "invidiousInstance"],
|
|
|
|
(result) => {
|
|
|
|
if (result.whitelist) {
|
|
|
|
let whitelist = result.whitelist.map((e) =>
|
|
|
|
e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
|
|
|
|
);
|
|
|
|
browser.storage.sync.set({
|
|
|
|
exceptions: result.exceptions.concat(whitelist),
|
|
|
|
whitelist: null,
|
|
|
|
});
|
2020-07-12 03:26:48 +02:00
|
|
|
}
|
2020-09-01 09:26:23 +02:00
|
|
|
if (result.invidiousInstance === "https://invidio.us") {
|
2020-08-27 07:22:46 +02:00
|
|
|
browser.storage.sync.set({
|
2020-09-01 09:26:23 +02:00
|
|
|
invidiousInstance: null,
|
2020-08-27 07:22:46 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2020-04-09 11:37:56 +02:00
|
|
|
}
|
2020-08-27 07:22:46 +02:00
|
|
|
});
|