summaryrefslogtreecommitdiff
path: root/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-08-15 03:01:21 +0300
committerawy <awy@awy.one>2025-08-15 03:01:21 +0300
commita9370a08517668b3e98cc1d0bd42df407a76c220 (patch)
tree37e7bdb0e76f5495f798e077e45d377c0c3870c0 /data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages
parentb73acfe395ea849fcd15c9886a7f4631f2b6f82b (diff)
ubo + private browsing patchHEADmaster
Diffstat (limited to 'data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages')
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.html7
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.js689
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.html647
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.js584
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.html265
-rw-r--r--data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.js76
6 files changed, 0 insertions, 2268 deletions
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.html b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.html
deleted file mode 100644
index 55f5b61..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8" />
- <script type="module" src="background.js"></script>
- </head>
-</html>
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.js b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.js
deleted file mode 100644
index c08d7b4..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/background/background.js
+++ /dev/null
@@ -1,689 +0,0 @@
-"use strict";
-
-import commonHelper from "../../assets/javascripts/helpers/common.js";
-import twitterHelper from "../../assets/javascripts/helpers/twitter.js";
-import youtubeHelper from "../../assets/javascripts/helpers/youtube.js";
-import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
-import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
-import redditHelper from "../../assets/javascripts/helpers/reddit.js";
-import searchHelper from "../../assets/javascripts/helpers/google-search.js";
-import googleTranslateHelper from "../../assets/javascripts/helpers/google-translate.js";
-import wikipediaHelper from "../../assets/javascripts/helpers/wikipedia.js";
-
-const nitterInstances = twitterHelper.redirects;
-const twitterDomains = twitterHelper.targets;
-const youtubeDomains = youtubeHelper.targets;
-const invidiousInstances = youtubeHelper.redirects;
-const instagramDomains = instagramHelper.targets;
-const bibliogramInstances = instagramHelper.redirects;
-const instagramReservedPaths = instagramHelper.reservedPaths;
-const bibliogramBypassPaths = instagramHelper.bypassPaths;
-const osmDefault = mapsHelper.redirects[0];
-const googleMapsRegex = mapsHelper.targets;
-const mapCentreRegex = mapsHelper.mapCentreRegex;
-const dataLatLngRegex = mapsHelper.dataLatLngRegex;
-const placeRegex = mapsHelper.placeRegex;
-const travelModes = mapsHelper.travelModes;
-const layers = mapsHelper.layers;
-const redditInstances = redditHelper.redirects;
-const redditDomains = redditHelper.targets;
-const redditBypassPaths = redditHelper.bypassPaths;
-const redditDefault = redditHelper.redirects[0];
-const googleSearchRegex = searchHelper.targets;
-const searchEngineInstances = searchHelper.redirects;
-const simplyTranslateInstances = googleTranslateHelper.redirects;
-const simplyTranslateDefault = simplyTranslateInstances[0];
-const googleTranslateDomains = googleTranslateHelper.targets;
-const wikipediaInstances = wikipediaHelper.redirects;
-const wikipediaDefault = wikipediaInstances[0];
-const wikipediaRegex = wikipediaHelper.targets;
-
-let disableNitter;
-let disableInvidious;
-let disableBibliogram;
-let disableOsm;
-let disableReddit;
-let disableSearchEngine;
-let disableSimplyTranslate;
-let disableWikipedia;
-let nitterInstance;
-let invidiousInstance;
-let bibliogramInstance;
-let osmInstance;
-let redditInstance;
-let searchEngineInstance;
-let simplyTranslateInstance;
-let wikipediaInstance;
-let alwaysProxy;
-let onlyEmbeddedVideo;
-let videoQuality;
-let invidiousDarkMode;
-let invidiousVolume;
-let invidiousPlayerStyle;
-let invidiousSubtitles;
-let invidiousAutoplay;
-let useFreeTube;
-let nitterRandomPool;
-let invidiousRandomPool;
-let bibliogramRandomPool;
-let exceptions;
-
-window.browser = window.browser || window.chrome;
-
-browser.storage.sync.get(
- [
- "nitterInstance",
- "invidiousInstance",
- "bibliogramInstance",
- "osmInstance",
- "redditInstance",
- "searchEngineInstance",
- "simplyTranslateInstance",
- "wikipediaInstance",
- "disableNitter",
- "disableInvidious",
- "disableBibliogram",
- "disableOsm",
- "disableReddit",
- "disableSearchEngine",
- "disableSimplyTranslate",
- "disableWikipedia",
- "alwaysProxy",
- "onlyEmbeddedVideo",
- "videoQuality",
- "invidiousDarkMode",
- "invidiousVolume",
- "invidiousPlayerStyle",
- "invidiousSubtitles",
- "invidiousAutoplay",
- "useFreeTube",
- "nitterRandomPool",
- "invidiousRandomPool",
- "bibliogramRandomPool",
- "exceptions",
- ],
- (result) => {
- nitterInstance = result.nitterInstance;
- invidiousInstance = result.invidiousInstance;
- bibliogramInstance = result.bibliogramInstance;
- osmInstance = result.osmInstance || osmDefault;
- redditInstance = result.redditInstance || redditDefault;
- searchEngineInstance = result.searchEngineInstance;
- simplyTranslateInstance =
- result.simplyTranslateInstance || simplyTranslateDefault;
- wikipediaInstance = result.wikipediaInstance || wikipediaDefault;
- disableNitter = result.disableNitter;
- disableInvidious = result.disableInvidious;
- disableBibliogram = result.disableBibliogram;
- disableOsm = result.disableOsm;
- disableReddit = result.disableReddit;
- disableSearchEngine = result.disableSearchEngine;
- disableWikipedia = result.disableWikipedia;
- disableSimplyTranslate = result.disableSimplyTranslate;
- alwaysProxy = result.alwaysProxy;
- onlyEmbeddedVideo = result.onlyEmbeddedVideo;
- videoQuality = result.videoQuality;
- invidiousDarkMode = result.invidiousDarkMode;
- exceptions = result.exceptions
- ? result.exceptions.map((e) => {
- return new RegExp(e);
- })
- : [];
- invidiousVolume = result.invidiousVolume;
- invidiousPlayerStyle = result.invidiousPlayerStyle;
- invidiousSubtitles = result.invidiousSubtitles || "";
- invidiousAutoplay = result.invidiousAutoplay;
- useFreeTube = result.useFreeTube;
- nitterRandomPool = result.nitterRandomPool
- ? result.nitterRandomPool.split(",")
- : commonHelper.filterInstances(nitterInstances);
- invidiousRandomPool = result.invidiousRandomPool
- ? result.invidiousRandomPool.split(",")
- : commonHelper.filterInstances(invidiousInstances);
- bibliogramRandomPool = result.bibliogramRandomPool
- ? result.bibliogramRandomPool.split(",")
- : commonHelper.filterInstances(bibliogramInstances);
- }
-);
-
-browser.storage.onChanged.addListener((changes) => {
- if ("nitterInstance" in changes) {
- nitterInstance = changes.nitterInstance.newValue;
- }
- if ("invidiousInstance" in changes) {
- invidiousInstance = changes.invidiousInstance.newValue;
- }
- if ("bibliogramInstance" in changes) {
- bibliogramInstance = changes.bibliogramInstance.newValue;
- }
- if ("osmInstance" in changes) {
- osmInstance = changes.osmInstance.newValue || osmDefault;
- }
- if ("simplyTranslateInstance" in changes) {
- simplyTranslateInstance =
- changes.simplyTranslateInstance.newValue || simplyTranslateDefault;
- }
- if ("wikipediaInstance" in changes) {
- wikipediaInstance = changes.wikipediaInstance.newValue || wikipediaDefault;
- }
- if ("redditInstance" in changes) {
- redditInstance = changes.redditInstance.newValue || redditDefault;
- }
- if ("searchEngineInstance" in changes) {
- searchEngineInstance = changes.searchEngineInstance.newValue;
- }
- if ("disableNitter" in changes) {
- disableNitter = changes.disableNitter.newValue;
- }
- if ("disableInvidious" in changes) {
- disableInvidious = changes.disableInvidious.newValue;
- }
- if ("disableBibliogram" in changes) {
- disableBibliogram = changes.disableBibliogram.newValue;
- }
- if ("disableOsm" in changes) {
- disableOsm = changes.disableOsm.newValue;
- }
- if ("disableReddit" in changes) {
- disableReddit = changes.disableReddit.newValue;
- }
- if ("disableSearchEngine" in changes) {
- disableSearchEngine = changes.disableSearchEngine.newValue;
- }
- if ("disableSimplyTranslate" in changes) {
- disableSimplyTranslate = changes.disableSimplyTranslate.newValue;
- }
- if ("disableWikipedia" in changes) {
- disableWikipedia = changes.disableWikipedia.newValue;
- }
- if ("alwaysProxy" in changes) {
- alwaysProxy = changes.alwaysProxy.newValue;
- }
- if ("onlyEmbeddedVideo" in changes) {
- onlyEmbeddedVideo = changes.onlyEmbeddedVideo.newValue;
- }
- if ("videoQuality" in changes) {
- videoQuality = changes.videoQuality.newValue;
- }
- if ("invidiousDarkMode" in changes) {
- invidiousDarkMode = changes.invidiousDarkMode.newValue;
- }
- if ("invidiousVolume" in changes) {
- invidiousVolume = changes.invidiousVolume.newValue;
- }
- if ("invidiousPlayerStyle" in changes) {
- invidiousPlayerStyle = changes.invidiousPlayerStyle.newValue;
- }
- if ("invidiousSubtitles" in changes) {
- invidiousSubtitles = changes.invidiousSubtitles.newValue;
- }
- if ("invidiousAutoplay" in changes) {
- invidiousAutoplay = changes.invidiousAutoplay.newValue;
- }
- if ("useFreeTube" in changes) {
- useFreeTube = changes.useFreeTube.newValue;
- }
- 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(",");
- }
- if ("exceptions" in changes) {
- exceptions = changes.exceptions.newValue.map((e) => {
- return new RegExp(e);
- });
- }
-});
-
-function isException(url, initiator) {
- return (
- exceptions.some((regex) => regex.test(url.href)) ||
- (initiator && exceptions.some((regex) => regex.test(initiator.href)))
- );
-}
-
-function isFirefox() {
- return typeof InstallTrigger !== "undefined";
-}
-
-function redirectYouTube(url, initiator, type) {
- if (disableInvidious || isException(url, initiator)) {
- return null;
- }
- if (
- initiator &&
- (initiator.origin === invidiousInstance ||
- invidiousInstances.includes(initiator.origin) ||
- youtubeDomains.includes(initiator.host))
- ) {
- return null;
- }
- if (url.pathname.match(/iframe_api/) || url.pathname.match(/www-widgetapi/)) {
- // Don't redirect YouTube Player API.
- return null;
- }
- if (url.host.split(".")[0] === "studio") {
- // Avoid redirecting `studio.youtube.com`
- return null;
- }
- if (onlyEmbeddedVideo && type !== "sub_frame") {
- return null;
- }
- if (useFreeTube && type === "main_frame") {
- return `freetube://${url}`;
- }
- // Apply settings
- if (alwaysProxy) {
- url.searchParams.append("local", true);
- }
- if (videoQuality) {
- url.searchParams.append("quality", videoQuality);
- }
- if (invidiousDarkMode) {
- url.searchParams.append("dark_mode", invidiousDarkMode);
- }
- if (invidiousVolume) {
- url.searchParams.append("volume", invidiousVolume);
- }
- if (invidiousPlayerStyle) {
- url.searchParams.append("player_style", invidiousPlayerStyle);
- }
- if (invidiousSubtitles) {
- url.searchParams.append("subtitles", invidiousSubtitles);
- }
- if (invidiousAutoplay) {
- url.searchParams.append("autoplay", 1);
- }
-
- return `${
- invidiousInstance || commonHelper.getRandomInstance(invidiousRandomPool)
- }${url.pathname.replace("/shorts", "")}${url.search}`;
-}
-
-function redirectTwitter(url, initiator) {
- if (disableNitter || isException(url, initiator)) {
- return null;
- }
- if (url.pathname.split("/").includes("home")) {
- return null;
- }
- if (
- isFirefox() &&
- initiator &&
- (initiator.origin === nitterInstance ||
- nitterInstances.includes(initiator.origin) ||
- twitterDomains.includes(initiator.host))
- ) {
- browser.storage.sync.set({
- redirectBypassFlag: true,
- });
- return null;
- }
- if (url.host.split(".")[0] === "pbs" || url.host.split(".")[0] === "video") {
- return `${
- nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
- }/pic/${encodeURIComponent(url.href)}`;
- } else if (url.pathname.split("/").includes("tweets")) {
- return `${
- nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
- }${url.pathname.replace("/tweets", "")}${url.search}`;
- } else {
- return `${
- nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
- }${url.pathname}${url.search}`;
- }
-}
-
-function redirectInstagram(url, initiator, type) {
- if (disableBibliogram || isException(url, initiator)) {
- return null;
- }
- // Do not redirect Bibliogram view on Instagram links
- if (
- initiator &&
- (initiator.origin === bibliogramInstance ||
- bibliogramInstances.includes(initiator.origin) ||
- instagramDomains.includes(initiator.host))
- ) {
- return null;
- }
- // Do not redirect /accounts, /embeds.js, or anything other than main_frame
- if (type !== "main_frame" || url.pathname.match(bibliogramBypassPaths)) {
- return null;
- }
- if (
- url.pathname === "/" ||
- instagramReservedPaths.includes(url.pathname.split("/")[1])
- ) {
- return `${
- bibliogramInstance || commonHelper.getRandomInstance(bibliogramRandomPool)
- }${url.pathname}${url.search}`;
- } else {
- // Likely a user profile, redirect to '/u/...'
- return `${
- bibliogramInstance || commonHelper.getRandomInstance(bibliogramRandomPool)
- }/u${url.pathname}${url.search}`;
- }
-}
-
-function redirectGoogleMaps(url, initiator) {
- if (disableOsm || isException(url, initiator)) {
- return null;
- }
- if (initiator.host === "earth.google.com") {
- return null;
- }
- let redirect;
- let mapCentre = "";
- let params = "";
- // Set map centre if present
- if (url.pathname.match(mapCentreRegex)) {
- const [, lat, lon, zoom] = url.pathname.match(mapCentreRegex);
- mapCentre = `#map=${zoom}/${lat}/${lon}`;
- } else if (url.search.includes("center=")) {
- const [lat, lon] = url.searchParams.get("center").split(",");
- mapCentre = `#map=${url.searchParams.get("zoom") || "17"}/${lat}/${lon}`;
- // Set default zoom if mapCentre not present
- } else {
- params = "&zoom=17";
- }
- // Set map layer
- params = `${params}&layers=${
- layers[url.searchParams.get("layer")] || layers["none"]
- }`;
- // Handle Google Maps Embed API
- if (url.pathname.split("/").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")) {
- try {
- query = url.searchParams.get("pb").split(/!2s(.*?)!/)[1];
- } catch (error) {
- console.error(error);
- // Unable to find map marker in URL.
- }
- }
- let marker, bbox;
- mapsHelper.addressToLatLng(query, (coords, boundingbox) => {
- marker = coords;
- bbox = boundingbox;
- });
- redirect = `${osmInstance}/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${marker}`;
- // Handle Google Maps Directions
- } else if (url.pathname.split("/").includes("dir")) {
- const travelMode =
- travelModes[url.searchParams.get("travelmode")] || travelModes["driving"];
- let origin;
- mapsHelper.addressToLatLng(url.searchParams.get("origin"), (coords) => {
- origin = coords;
- });
- let destination;
- mapsHelper.addressToLatLng(
- url.searchParams.get("destination"),
- (coords) => {
- destination = coords;
- }
- );
- redirect = `${osmInstance}/directions?engine=${travelMode}&route=${origin}%3B${destination}${mapCentre}${params}`;
- // Get marker from data attribute
- } else if (
- url.pathname.includes("data=") &&
- url.pathname.match(dataLatLngRegex)
- ) {
- const [mlat, mlon] = url.pathname.match(dataLatLngRegex);
- redirect = `${osmInstance}/?mlat=${mlat.replace(
- "!3d",
- ""
- )}&mlon=${mlon.replace("!4d", "")}${mapCentre}${params}`;
- // Get marker from ll param
- } else if (url.searchParams.has("ll")) {
- const [mlat, mlon] = url.searchParams.get("ll").split(",");
- redirect = `${osmInstance}/?mlat=${mlat}&mlon=${mlon}${mapCentre}${params}`;
- // Get marker from viewpoint param.
- } else if (url.searchParams.has("viewpoint")) {
- const [mlat, mlon] = url.searchParams.get("viewpoint").split(",");
- redirect = `${osmInstance}/?mlat=${mlat}&mlon=${mlon}${mapCentre}${params}`;
- // Use query as search if present.
- } else {
- let query;
- if (url.searchParams.has("q")) {
- query = url.searchParams.get("q");
- } else if (url.searchParams.has("query")) {
- query = url.searchParams.get("query");
- } else if (url.pathname.match(placeRegex)) {
- query = url.pathname.match(placeRegex)[1];
- }
- redirect = `${osmInstance}/${query ? "search?query=" + query : ""}${
- mapCentre || "#"
- }${params}`;
- }
-
- return redirect;
-}
-
-function redirectReddit(url, initiator, type) {
- if (disableReddit || isException(url, initiator)) {
- return null;
- }
- // Do not redirect when already on the selected view
- if (
- (initiator && initiator.origin === redditInstance) ||
- url.origin === redditInstance
- ) {
- return null;
- }
- // Do not redirect exclusions nor anything other than main_frame
- if (type !== "main_frame" || url.pathname.match(redditBypassPaths)) {
- return null;
- }
- if (url.host === "i.redd.it") {
- if (redditInstance.includes("libredd")) {
- return `${redditInstance}/img${url.pathname}${url.search}`;
- } else if (redditInstance.includes("teddit")) {
- // As of 2021-04-09, redirects for teddit images are nontrivial:
- // - navigating to the image before ever navigating to its page causes
- // 404 error (probably needs fix on teddit project)
- // - some image links on teddit are very different
- // Therefore, don't support redirecting image links for teddit.
- return null;
- } else {
- return null;
- }
- } else if (url.host === "redd.it") {
- if (
- redditInstance.includes("teddit") &&
- !url.pathname.match(/^\/+[^\/]+\/+[^\/]/)
- ) {
- // As of 2021-04-22, redirects for teddit redd.it/foo links don't work.
- // It appears that adding "/comments" as a prefix works, so manually add
- // that prefix if it is missing. Even though redd.it/comments/foo links
- // don't seem to work or exist, guard against affecting those kinds of
- // paths.
- //
- // Note the difference between redd.it/comments/foo (doesn't work) and
- // teddit.net/comments/foo (works).
- return `${redditInstance}/comments${url.pathname}${url.search}`;
- }
- }
- return `${redditInstance}${url.pathname}${url.search}`;
-}
-
-function redirectSearchEngine(url, initiator) {
- if (disableSearchEngine || isException(url, initiator)) {
- return null;
- }
-
- const searchEngine =
- searchEngineInstance ||
- commonHelper.getRandomInstance(searchEngineInstances);
- let search = "";
- url.search
- .slice(1)
- .split("&")
- .forEach(function (input) {
- if (input.startsWith("q=")) search = input;
- });
- return `${searchEngine.link}${searchEngine.q}?${search}`;
-}
-
-function redirectGoogleTranslate(url, initiator) {
- if (disableSimplyTranslate || isException(url, initiator)) {
- return null;
- }
-
- return `${simplyTranslateInstance}/${url.search}`;
-}
-
-function redirectWikipedia(url, initiator) {
- if (disableWikipedia || isException(url, initiator)) {
- return null;
- }
- let GETArguments = [];
- if (url.search.length > 0) {
- let search = url.search.substring(1); //get rid of '?'
- let argstrings = search.split("&");
- for (let i = 0; i < argstrings.length; i++) {
- let args = argstrings[i].split("=");
- GETArguments.push([args[0], args[1]]);
- }
- }
- let link = `${wikipediaInstance}${url.pathname}`;
- let urlSplit = url.host.split(".");
- if (urlSplit[0] != "wikipedia" && urlSplit[0] != "www") {
- if (urlSplit[0] == "m")
- GETArguments.push(["mobileaction", "toggle_view_mobile"]);
- else GETArguments.push(["lang", urlSplit[0]]);
- if (urlSplit[1] == "m")
- GETArguments.push(["mobileaction", "toggle_view_mobile"]);
- //wikiless doesn't have mobile view support yet
- }
- for (let i = 0; i < GETArguments.length; i++) {
- link +=
- (i == 0 ? "?" : "&") + GETArguments[i][0] + "=" + GETArguments[i][1];
- }
- if (
- urlSplit[urlSplit.length - 1] == "org" &&
- urlSplit[urlSplit.length - 2] == "wikipedia"
- )
- //just in case someone wanted to visit wikipedia.org.foo.bar.net
- return link;
- else return null;
-}
-
-browser.webRequest.onBeforeRequest.addListener(
- (details) => {
- const url = new URL(details.url);
- let initiator;
- if (details.originUrl) {
- initiator = new URL(details.originUrl);
- } else if (details.initiator) {
- initiator = new URL(details.initiator);
- }
- let redirect;
- if (youtubeDomains.includes(url.host)) {
- redirect = {
- redirectUrl: redirectYouTube(url, initiator, details.type),
- };
- } else if (twitterDomains.includes(url.host)) {
- redirect = {
- redirectUrl: redirectTwitter(url, initiator),
- };
-//
-// Bibliogram has been discontinued.
-// See <https://cadence.moe/blog/2022-09-01-discontinuing-bibliogram>
-// We'll keep this code in case the project is resurrected, but for
-// now we disable Bibliogram redirects and hide the associated UI.
-//
-// } else if (instagramDomains.includes(url.host)) {
-// redirect = {
-// redirectUrl: redirectInstagram(url, initiator, details.type),
-// };
-//
- } else if (url.href.match(googleMapsRegex)) {
- redirect = {
- redirectUrl: redirectGoogleMaps(url, initiator),
- };
- } else if (redditDomains.includes(url.host)) {
- redirect = {
- redirectUrl: redirectReddit(url, initiator, details.type),
- };
- } else if (url.href.match(googleSearchRegex)) {
- redirect = {
- redirectUrl: redirectSearchEngine(url, initiator),
- };
- } else if (googleTranslateDomains.includes(url.host)) {
- redirect = {
- redirectUrl: redirectGoogleTranslate(url, initiator),
- };
- } else if (url.host.match(wikipediaRegex)) {
- redirect = {
- redirectUrl: redirectWikipedia(url, initiator),
- };
- }
- if (redirect && redirect.redirectUrl) {
- console.info(
- "Redirecting",
- `"${url.href}"`,
- "=>",
- `"${redirect.redirectUrl}"`
- );
- console.info("Details", details);
- }
- return redirect;
- },
- {
- urls: ["<all_urls>"],
- },
- ["blocking"]
-);
-
-browser.runtime.onInstalled.addListener((details) => {
- browser.storage.sync.get(
- ["disableSearchEngine", "disableSimplyTranslate", "disableWikipedia"],
- (result) => {
- if (result.disableSearchEngine === undefined) {
- browser.storage.sync.set({
- disableSearchEngine: true,
- });
- }
- if (result.disableSimplyTranslate === undefined) {
- browser.storage.sync.set({
- disableSimplyTranslate: true,
- });
- }
- if (result.disableWikipedia === undefined) {
- browser.storage.sync.set({
- disableWikipedia: true,
- });
- }
- }
- );
- if (details.reason === "update") {
- browser.storage.sync.get(
- ["whitelist", "exceptions", "invidiousInstance", "disableSearchEngine"],
- (result) => {
- if (result.whitelist) {
- let whitelist = result.whitelist.map((e) =>
- e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
- );
- browser.storage.sync.set({
- exceptions: result.exceptions.concat(whitelist),
- whitelist: null,
- });
- }
- if (result.invidiousInstance === "https://invidio.us") {
- browser.storage.sync.set({
- invidiousInstance: null,
- });
- }
- }
- );
- }
-});
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.html b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.html
deleted file mode 100644
index c5d0096..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.html
+++ /dev/null
@@ -1,647 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title></title>
- <link href="../../assets/stylesheets/styles.css" rel="stylesheet" />
- <title>Privacy Redirect Options</title>
- </head>
-
- <body>
- <div class="tab">
- <button
- class="tablinks"
- id="general-tab"
- data-localise="__MSG_generalTab__"
- >
- General
- </button>
- <button
- class="tablinks"
- id="advanced-tab"
- data-localise="__MSG_advancedTab__"
- >
- Advanced
- </button>
- <button
- class="tablinks"
- id="exceptions-tab"
- data-localise="__MSG_exceptionsTab__"
- >
- Exceptions
- </button>
- </div>
-
- <div id="general" class="tabcontent">
- <section class="settings-block">
- <table class="option" aria-label="Toggle Nitter redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableNitter__">Nitter Redirects</h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-nitter"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-nitter" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Toggle Invidious redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableInvidious__">
- Invidious Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-invidious"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-invidious" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-<!-- <section class="settings-block">
- <table class="option" aria-label="Toggle Bibliogram redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableBibliogram__">
- Bibliogram Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-bibliogram"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-bibliogram" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section> -->
- <section class="settings-block">
- <table class="option" aria-label="Toggle OpenStreetMap redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableOsm__">
- OpenStreetMap Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-osm"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-osm" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Toggle Reddit redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableReddit__">
- Reddit Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-reddit"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-reddit" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Toggle Search Engine redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableSearchEngine__">
- Search Engine Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-search-engine"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-search-engine" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Toggle SimplyTranslate redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableSimplyTranslate__">SimplyTranslate Redirects</h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-simply-translate"
- type="checkbox"
- />&nbsp;
- <label for="disable-simply-translate" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Toggle Wikipedia redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableWikipedia__" class="new-badge" data-new-badge>Wikipedia Redirects</h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-wikipedia"
- type="checkbox"
- />&nbsp;
- <label for="disable-wikipedia" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_nitterInstance__">Nitter Instance</h1>
- <div class="autocomplete">
- <input
- id="nitter-instance"
- type="url"
- name="nitter-instance"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_invidiousInstance__">Invidious Instance</h1>
- <div class="autocomplete">
- <input
- id="invidious-instance"
- type="url"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)"
- />
- </div>
- </section>
-<!-- <section class="settings-block">
- <h1 data-localise="__MSG_bibliogramInstance__">Bibliogram Instance</h1>
- <div class="autocomplete">
- <input
- id="bibliogram-instance"
- type="url"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)"
- />
- </div>
- </section> -->
- <section class="settings-block">
- <h1 data-localise="__MSG_osmInstance__">OpenStreetMap Instance</h1>
- <div class="autocomplete">
- <input
- id="osm-instance"
- type="url"
- placeholder="https://openstreetmap.org"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_redditInstance__">Reddit Instance</h1>
- <div class="autocomplete">
- <input
- id="reddit-instance"
- type="url"
- placeholder="https://libreddit.de"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_searchEngineInstance__">Search Engine Instance</h1>
- <div class="autocomplete">
- <input
- id="search-engine-instance"
- type="url"
- data-localise-placeholder="__MSG_randomInstancePlaceholder__"
- placeholder="Random instance (none selected)"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_simplyTranslateInstance__">SimplyTranslate Instance</h1>
- <div class="autocomplete">
- <input
- id="simply-translate-instance"
- type="url"
- placeholder="https://translate.metalune.xyz"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_wikipediaInstance__">Wikipedia Instance</h1>
- <div class="autocomplete">
- <input
- id="wikipedia-instance"
- type="url"
- placeholder="https://wikiless.org"
- />
- </div>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_theme__">Theme</h1>
- <select id="theme">
- <option value="">System</option>
- <option value="light-theme">Light</option>
- <option value="dark-theme">Dark</option>
- </select>
- </section>
- </div>
-
- <div id="advanced" class="tabcontent">
- <button type="button" class="collapsible">
- Invidious
- </button>
- <div class="collapsible-content">
- <section class="settings-block">
- <h1 data-localise="__MSG_invidiousRandomPool__">
- Invidious random instance pool (comma-separated)
- </h1>
- <input
- id="invidious-random-pool"
- name="invidious-random-pool"
- type="text"
- />
- </section>
- <section class="settings-block">
- <table
- class="option"
- aria-label="Redirect YouTube to FreeTube where possible"
- >
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_useFreeTube__">
- Use FreeTube over Invidious when possible
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="use-freetube"
- type="checkbox"
- checked
- />&nbsp;
- <label for="use-freetube" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table
- class="option"
- aria-label="Always proxy videos through Invidious"
- >
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_alwaysProxy__">
- Always proxy videos through Invidious
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="always-proxy"
- type="checkbox"
- checked
- />&nbsp;
- <label for="always-proxy" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table
- class="option"
- aria-label="Only redirect embedded video to Invidious"
- >
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_onlyEmbeddedVideo__">
- Only redirect embedded video to Invidious
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="only-embed"
- type="checkbox"
- checked
- />&nbsp;
- <label for="only-embed" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_videoQuality__">Invidious Video Quality</h1>
- <select id="video-quality">
- <option value="">Default</option>
- <option value="hd720">720p</option>
- <option value="medium">480p</option>
- <option value="dash">DASH (Dynamic Adaptive Streaming over HTTP)</option>
- </option>
- </select>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Invidious dark mode aways on">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_invidiousDarkMode__">
- Invidious dark mode always on
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="invidious-dark-mode"
- type="checkbox"
- checked
- />&nbsp;
- <label for="invidious-dark-mode" class="checkbox-label">
- </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_invidiousVolume__">
- Invidious Volume
- </h1>
- <input
- id="invidious-volume"
- name="invidious-volume"
- type="range"
- min="0"
- max="100"
- step="1"
- /><span id="volume-value"></span>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_invidiousPlayerStyle__">
- Invidious Player Style
- </h1>
- <select id="invidious-player-style">
- <option value="">Invidious</option>
- <option value="youtube">YouTube</option>
- </select>
- </section>
- <section class="settings-block">
- <h1 data-localise="__MSG_invidiousSubtitles__">
- Invidious Subtitles - language codes (comma-separated)
- </h1>
- <input
- id="invidious-subtitles"
- name="invidious-subtitles"
- type="text"
- />
- </section>
- <section class="settings-block">
- <table
- class="option"
- aria-label="Invidious automatically play video on load"
- >
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_invidiousAutoplay__">
- Invidious automatically play video on load
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="invidious-autoplay"
- type="checkbox"
- checked
- />&nbsp;
- <label for="invidious-autoplay" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section class="settings-block">
- <table class="option" aria-label="Persist Invidious preferences">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_persistInvidiousPrefs__">
- Persist Invidious preferences (as cookie)
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="persist-invidious-prefs"
- type="checkbox"
- checked
- />&nbsp;
- <label for="persist-invidious-prefs" class="checkbox-label">
- </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <hr>
- </div>
- <button type="button" class="collapsible">
- Nitter
- </button>
- <div class="collapsible-content">
- <section class="settings-block">
- <h1 data-localise="__MSG_nitterRandomPool__">
- Nitter random instance pool (comma-separated)
- </h1>
- <input
- id="nitter-random-pool"
- name="nitter-random-pool"
- type="text"
- />
- </section>
- <section class="settings-block">
- <table
- class="option"
- aria-label="Proactively remove Twitter service worker"
- >
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_removeTwitterSW__">
- Proactively remove Twitter service worker
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="remove-twitter-sw"
- type="checkbox"
- checked
- />&nbsp;
- <label for="remove-twitter-sw" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <hr>
- </div>
-<!-- <button type="button" class="collapsible">
- Bibliogram
- </button>
- <div class="collapsible-content">
- <section class="settings-block">
- <h1 data-localise="__MSG_bibliogramRandomPool__">
- Bibliogram random instance pool (comma-separated)
- </h1>
- <input
- id="bibliogram-random-pool"
- name="bibliogram-random-pool"
- type="text"
- />
- </section>
- <hr>
- </div> -->
- </div>
-
- <div id="exceptions" class="tabcontent">
- <section class="settings-block">
- <p data-localise="__MSG_exceptionsDescriptionP1__">
- Enter a URL or Regular Expression to be excluded from redirects.
- </p>
- <p data-localise="__MSG_exceptionsDescriptionP2__">
- All requests for or initiating from a URL that matches your exception
- will be excluded from redirects.
- </p>
- <p data-localise="__MSG_exceptionsDescriptionP3__">
- Note - Supports JavaScript regular expressions, excluding the
- enclosing forward slashes.
- </p>
- </section>
- <section class="settings-block">
- <table class="exceptions option">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_addException__">Add Exception</h1>
- </td>
- </tr>
- <tr>
- <td>
- <input
- id="new-exceptions-item"
- type="text"
- placeholder="URL or RegExp"
- />
- </td>
- <td>
- <input type="radio" id="url" name="type" value="URL" checked />
- <label class="radio" for="url">URL</label>
- <input type="radio" id="regExp" name="type" value="RegExp" />
- <label class="radio" for="regExp">RegExp</label>
- </td>
- <td>
- <button id="add-to-exceptions">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="512"
- height="512"
- viewBox="0 0 512 512"
- >
- <line
- x1="256"
- y1="112"
- x2="256"
- y2="400"
- style="
- fill: none;
- stroke: #fff;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- "
- />
- <line
- x1="400"
- y1="256"
- x2="112"
- y2="256"
- style="
- fill: none;
- stroke: #fff;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- "
- />
- </svg>
- </button>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <ul id="exceptions-items"></ul>
- </div>
-
- <script type="module" src="./options.js"></script>
- <script src="../../assets/javascripts/localise.js"></script>
- </body>
-</html>
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.js b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.js
deleted file mode 100644
index 8309aab..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/options/options.js
+++ /dev/null
@@ -1,584 +0,0 @@
-"use strict";
-
-import commonHelper from "../../assets/javascripts/helpers/common.js";
-import twitterHelper from "../../assets/javascripts/helpers/twitter.js";
-import youtubeHelper from "../../assets/javascripts/helpers/youtube.js";
-import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
-import mapsHelper from "../../assets/javascripts/helpers/google-maps.js";
-import redditHelper from "../../assets/javascripts/helpers/reddit.js";
-import searchHelper from "../../assets/javascripts/helpers/google-search.js";
-import googleTranslateHelper from "../../assets/javascripts/helpers/google-translate.js";
-import wikipediaHelper from "../../assets/javascripts/helpers/wikipedia.js";
-
-const nitterInstances = twitterHelper.redirects;
-const invidiousInstances = youtubeHelper.redirects;
-const bibliogramInstances = instagramHelper.redirects;
-const osmInstances = mapsHelper.redirects;
-const redditInstances = redditHelper.redirects;
-const searchEngineInstances = searchHelper.redirects;
-const simplyTranslateInstances = googleTranslateHelper.redirects;
-const wikipediaInstances = wikipediaHelper.redirects;
-const autocompletes = [
- { id: "nitter-instance", instances: nitterInstances },
- { id: "invidious-instance", instances: invidiousInstances },
-// { id: "bibliogram-instance", instances: bibliogramInstances },
- { id: "osm-instance", instances: osmInstances },
- { id: "reddit-instance", instances: redditInstances },
- {
- id: "search-engine-instance",
- instances: searchEngineInstances.map((instance) => instance.link),
- },
- { id: "simply-translate-instance", instances: simplyTranslateInstances },
- { id: "wikipedia-instance", instances: wikipediaInstances },
-];
-const domparser = new DOMParser();
-
-let nitterInstance = document.getElementById("nitter-instance");
-let invidiousInstance = document.getElementById("invidious-instance");
-// let bibliogramInstance = document.getElementById("bibliogram-instance");
-let osmInstance = document.getElementById("osm-instance");
-let redditInstance = document.getElementById("reddit-instance");
-let searchEngineInstance = document.getElementById("search-engine-instance");
-let simplyTranslateInstance = document.getElementById(
- "simply-translate-instance"
-);
-let wikipediaInstance = document.getElementById("wikipedia-instance");
-let disableNitter = document.getElementById("disable-nitter");
-let disableInvidious = document.getElementById("disable-invidious");
-// let disableBibliogram = document.getElementById("disable-bibliogram");
-let disableOsm = document.getElementById("disable-osm");
-let disableReddit = document.getElementById("disable-reddit");
-let disableSearchEngine = document.getElementById("disable-search-engine");
-let disableSimplyTranslate = document.getElementById(
- "disable-simply-translate"
-);
-let disableWikipedia = document.getElementById("disable-wikipedia");
-let alwaysProxy = document.getElementById("always-proxy");
-let onlyEmbeddedVideo = document.getElementById("only-embed");
-let videoQuality = document.getElementById("video-quality");
-let removeTwitterSW = document.getElementById("remove-twitter-sw");
-let invidiousDarkMode = document.getElementById("invidious-dark-mode");
-let persistInvidiousPrefs = document.getElementById("persist-invidious-prefs");
-let invidiousVolume = document.getElementById("invidious-volume");
-let invidiousPlayerStyle = document.getElementById("invidious-player-style");
-let invidiousSubtitles = document.getElementById("invidious-subtitles");
-let invidiousAutoplay = document.getElementById("invidious-autoplay");
-let theme = document.getElementById("theme");
-let useFreeTube = document.getElementById("use-freetube");
-let nitterRandomPool = document.getElementById("nitter-random-pool");
-let invidiousRandomPool = document.getElementById("invidious-random-pool");
-// let bibliogramRandomPool = document.getElementById("bibliogram-random-pool");
-let exceptions;
-
-window.browser = window.browser || window.chrome;
-
-function prependExceptionsItem(item, index) {
- const li = document.createElement("li");
- li.appendChild(document.createTextNode(item.toString()));
- const button = document.createElement("button");
- li.appendChild(button);
- document.getElementById("exceptions-items").prepend(li);
- const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 512 512'>
- <line x1='368' y1='368' x2='144' y2='144'
- style='fill:none;stroke:#FFF;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px' />
- <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.appendChild(
- domparser.parseFromString(svg, "image/svg+xml").documentElement
- );
- button.addEventListener("click", () => {
- exceptions.splice(index, 1);
- browser.storage.sync.set({
- exceptions: exceptions,
- });
- li.remove();
- });
-}
-
-browser.storage.sync.get(
- [
- "nitterInstance",
- "invidiousInstance",
- "bibliogramInstance",
- "osmInstance",
- "redditInstance",
- "searchEngineInstance",
- "simplyTranslateInstance",
- "wikipediaInstance",
- "disableNitter",
- "disableInvidious",
- "disableBibliogram",
- "disableOsm",
- "disableReddit",
- "disableSearchEngine",
- "disableSimplyTranslate",
- "disableWikipedia",
- "alwaysProxy",
- "onlyEmbeddedVideo",
- "videoQuality",
- "removeTwitterSW",
- "invidiousDarkMode",
- "persistInvidiousPrefs",
- "invidiousVolume",
- "invidiousPlayerStyle",
- "invidiousSubtitles",
- "invidiousAutoplay",
- "exceptions",
- "theme",
- "useFreeTube",
- "nitterRandomPool",
- "invidiousRandomPool",
- "bibliogramRandomPool",
- ],
- (result) => {
- theme.value = result.theme || "";
- if (result.theme) document.body.classList.add(result.theme);
- nitterInstance.value = result.nitterInstance || "";
- invidiousInstance.value = result.invidiousInstance || "";
-// bibliogramInstance.value = result.bibliogramInstance || "";
- osmInstance.value = result.osmInstance || "";
- redditInstance.value = result.redditInstance || "";
- searchEngineInstance.value =
- (result.searchEngineInstance && result.searchEngineInstance.link) || "";
- simplyTranslateInstance.value = result.simplyTranslateInstance || "";
- wikipediaInstance.value = result.wikipediaInstance || "";
- disableNitter.checked = !result.disableNitter;
- disableInvidious.checked = !result.disableInvidious;
-// disableBibliogram.checked = !result.disableBibliogram;
- disableOsm.checked = !result.disableOsm;
- disableReddit.checked = !result.disableReddit;
- disableSearchEngine.checked = !result.disableSearchEngine;
- disableSimplyTranslate.checked = !result.disableSimplyTranslate;
- disableWikipedia.checked = !result.disableWikipedia;
- alwaysProxy.checked = result.alwaysProxy;
- onlyEmbeddedVideo.checked = result.onlyEmbeddedVideo;
- videoQuality.value = result.videoQuality || "";
- removeTwitterSW.checked = !result.removeTwitterSW;
- invidiousDarkMode.checked = result.invidiousDarkMode;
- persistInvidiousPrefs.checked = result.persistInvidiousPrefs;
- exceptions = result.exceptions || [];
- exceptions.forEach(prependExceptionsItem);
- invidiousVolume.value = result.invidiousVolume;
- document.querySelector("#volume-value").textContent = result.invidiousVolume
- ? `${result.invidiousVolume}%`
- : " - ";
- invidiousPlayerStyle.value = result.invidiousPlayerStyle || "";
- invidiousSubtitles.value = result.invidiousSubtitles || "";
- invidiousAutoplay.checked = result.invidiousAutoplay;
- useFreeTube.checked = result.useFreeTube;
- nitterRandomPool.value =
- result.nitterRandomPool || commonHelper.filterInstances(nitterInstances);
- invidiousRandomPool.value =
- result.invidiousRandomPool ||
- commonHelper.filterInstances(invidiousInstances);
-// bibliogramRandomPool.value =
-// result.bibliogramRandomPool ||
-// commonHelper.filterInstances(bibliogramInstances);
- }
-);
-
-function openTab(tab, event) {
- let i, tabcontent, tablinks;
- tabcontent = document.getElementsByClassName("tabcontent");
- for (i = 0; i < tabcontent.length; i++) {
- tabcontent[i].style.display = "none";
- }
- tablinks = document.getElementsByClassName("tablinks");
- for (i = 0; i < tablinks.length; i++) {
- tablinks[i].className = tablinks[i].className.replace(" active", "");
- }
- document.getElementById(tab).style.display = "block";
- event.currentTarget.className += " active";
-}
-
-document
- .getElementById("general-tab")
- .addEventListener("click", openTab.bind(null, "general"));
-document
- .getElementById("advanced-tab")
- .addEventListener("click", openTab.bind(null, "advanced"));
-document
- .getElementById("exceptions-tab")
- .addEventListener("click", openTab.bind(null, "exceptions"));
-
-document.getElementById("general-tab").click();
-
-function addToExceptions() {
- const input = document.getElementById("new-exceptions-item");
- const type = document.querySelector('input[name="type"]:checked').value;
- if (input.value) {
- try {
- let value = input.value;
- new RegExp(input.value);
- if (type === "URL") {
- value = value.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
- }
- exceptions.push(value);
- browser.storage.sync.set({
- exceptions: exceptions,
- });
- prependExceptionsItem(value, exceptions.indexOf(value));
- input.value = "";
- } catch (error) {
- input.setCustomValidity("Invalid RegExp");
- }
- } else {
- input.setCustomValidity("Invalid RegExp");
- }
-}
-
-document
- .getElementById("add-to-exceptions")
- .addEventListener("click", addToExceptions);
-
-function debounce(func, wait, immediate) {
- let timeout;
- return () => {
- let context = this,
- args = arguments;
- let later = () => {
- timeout = null;
- if (!immediate) func.apply(context, args);
- };
- let callNow = immediate && !timeout;
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- if (callNow) func.apply(context, args);
- };
-}
-
-function parseURL(urlString) {
- if (urlString) {
- try {
- const url = new URL(urlString);
- if (url.username && url.password) {
- return `${url.protocol}//${url.username}:${url.password}@${url.host}`;
- } else {
- return url.origin;
- }
- } catch (error) {
- console.log(error);
- return "";
- }
- } else {
- return "";
- }
-}
-
-const nitterInstanceChange = debounce(() => {
- if (nitterInstance.checkValidity()) {
- browser.storage.sync.set({
- nitterInstance: parseURL(nitterInstance.value),
- });
- }
-}, 500);
-nitterInstance.addEventListener("input", nitterInstanceChange);
-
-const invidiousInstanceChange = debounce(() => {
- if (invidiousInstance.checkValidity()) {
- browser.storage.sync.set({
- invidiousInstance: parseURL(invidiousInstance.value),
- });
- }
-}, 500);
-invidiousInstance.addEventListener("input", invidiousInstanceChange);
-
-// const bibliogramInstanceChange = debounce(() => {
-// if (bibliogramInstance.checkValidity()) {
-// browser.storage.sync.set({
-// bibliogramInstance: parseURL(bibliogramInstance.value),
-// });
-// }
-// }, 500);
-// bibliogramInstance.addEventListener("input", bibliogramInstanceChange);
-
-const osmInstanceChange = debounce(() => {
- if (osmInstance.checkValidity()) {
- browser.storage.sync.set({
- osmInstance: parseURL(osmInstance.value),
- });
- }
-}, 500);
-osmInstance.addEventListener("input", osmInstanceChange);
-
-const redditInstanceChange = debounce(() => {
- if (redditInstance.checkValidity()) {
- browser.storage.sync.set({
- redditInstance: parseURL(redditInstance.value),
- });
- }
-}, 500);
-redditInstance.addEventListener("input", redditInstanceChange);
-
-const searchEngineInstanceChange = debounce(() => {
- const instance = searchEngineInstances.find(
- (instance) => instance.link === searchEngineInstance.value
- );
- if (instance || !searchEngineInstance.value) {
- browser.storage.sync.set({
- searchEngineInstance: instance || searchEngineInstance.value,
- });
- } else {
- searchEngineInstance.setCustomValidity("Must be an instance from the list");
- }
-}, 500);
-searchEngineInstance.addEventListener("input", searchEngineInstanceChange);
-
-const simplyTranslateInstanceChange = debounce(() => {
- if (simplyTranslateInstance.checkValidity()) {
- browser.storage.sync.set({
- simplyTranslateInstance: parseURL(simplyTranslateInstance.value),
- });
- }
-}, 500);
-simplyTranslateInstance.addEventListener(
- "input",
- simplyTranslateInstanceChange
-);
-
-const wikipediaInstanceChange = debounce(() => {
- if (wikipediaInstance.checkValidity()) {
- browser.storage.sync.set({
- wikipediaInstance: parseURL(wikipediaInstance.value),
- });
- }
-}, 500);
-wikipediaInstance.addEventListener(
- "input",
- wikipediaInstanceChange
-);
-
-disableNitter.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableNitter: !event.target.checked });
-});
-
-disableInvidious.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableInvidious: !event.target.checked });
-});
-
-// disableBibliogram.addEventListener("change", (event) => {
-// browser.storage.sync.set({ disableBibliogram: !event.target.checked });
-// });
-
-disableOsm.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableOsm: !event.target.checked });
-});
-
-disableReddit.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableReddit: !event.target.checked });
-});
-
-disableSearchEngine.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
-});
-
-disableSimplyTranslate.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableSimplyTranslate: !event.target.checked });
-});
-
-disableWikipedia.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableWikipedia: !event.target.checked });
-});
-
-alwaysProxy.addEventListener("change", (event) => {
- browser.storage.sync.set({ alwaysProxy: event.target.checked });
-});
-
-onlyEmbeddedVideo.addEventListener("change", (event) => {
- browser.storage.sync.set({ onlyEmbeddedVideo: event.target.checked });
-});
-
-videoQuality.addEventListener("change", (event) => {
- browser.storage.sync.set({
- videoQuality: event.target.options[videoQuality.selectedIndex].value,
- });
-});
-
-removeTwitterSW.addEventListener("change", (event) => {
- browser.storage.sync.set({ removeTwitterSW: !event.target.checked });
-});
-
-invidiousDarkMode.addEventListener("change", (event) => {
- browser.storage.sync.set({ invidiousDarkMode: event.target.checked });
-});
-
-persistInvidiousPrefs.addEventListener("change", (event) => {
- browser.storage.sync.set({ persistInvidiousPrefs: event.target.checked });
-});
-
-useFreeTube.addEventListener("change", (event) => {
- browser.storage.sync.set({ useFreeTube: event.target.checked });
-});
-
-const invidiousVolumeChange = debounce(() => {
- document.querySelector(
- "#volume-value"
- ).textContent = `${invidiousVolume.value}%`;
- browser.storage.sync.set({
- invidiousVolume: invidiousVolume.value,
- });
-}, 500);
-invidiousVolume.addEventListener("input", invidiousVolumeChange);
-
-invidiousPlayerStyle.addEventListener("change", (event) => {
- browser.storage.sync.set({
- invidiousPlayerStyle:
- event.target.options[invidiousPlayerStyle.selectedIndex].value,
- });
-});
-
-const invidiousSubtitlesChange = debounce(() => {
- browser.storage.sync.set({ invidiousSubtitles: invidiousSubtitles.value });
-}, 500);
-invidiousSubtitles.addEventListener("input", invidiousSubtitlesChange);
-
-invidiousAutoplay.addEventListener("change", (event) => {
- browser.storage.sync.set({ invidiousAutoplay: event.target.checked });
-});
-
-const nitterRandomPoolChange = debounce(() => {
- browser.storage.sync.set({ nitterRandomPool: nitterRandomPool.value });
-}, 500);
-nitterRandomPool.addEventListener("input", nitterRandomPoolChange);
-
-const invidiousRandomPoolChange = debounce(() => {
- browser.storage.sync.set({ invidiousRandomPool: invidiousRandomPool.value });
-}, 500);
-invidiousRandomPool.addEventListener("input", invidiousRandomPoolChange);
-
-// const bibliogramRandomPoolChange = debounce(() => {
-// browser.storage.sync.set({
-// bibliogramRandomPool: bibliogramRandomPool.value,
-// });
-// }, 500);
-// bibliogramRandomPool.addEventListener("input", bibliogramRandomPoolChange);
-
-theme.addEventListener("change", (event) => {
- const value = event.target.options[theme.selectedIndex].value;
- switch (value) {
- case "dark-theme":
- document.body.classList.add("dark-theme");
- document.body.classList.remove("light-theme");
- break;
- case "light-theme":
- document.body.classList.add("light-theme");
- document.body.classList.remove("dark-theme");
- break;
- default:
- document.body.classList.remove("light-theme");
- document.body.classList.remove("dark-theme");
- }
- browser.storage.sync.set({
- theme: value,
- });
-});
-
-function autocomplete(input, list) {
- let currentFocus;
- input.addEventListener("focus", (e) => {
- showOptions(e, true);
- });
- input.addEventListener("input", (e) => {
- const val = e.target.value;
- if (!val) {
- return false;
- }
- currentFocus = -1;
- showOptions(e);
- });
- input.addEventListener("keydown", function (e) {
- let x = document.getElementById(this.id + "autocomplete-list");
- if (x) x = x.getElementsByTagName("div");
- if (e.keyCode == 40) {
- currentFocus++;
- addActive(x);
- } else if (e.keyCode == 38) {
- currentFocus--;
- addActive(x);
- } else if (e.keyCode == 13) {
- e.preventDefault();
- if (currentFocus > -1) {
- if (x) x[currentFocus].click();
- }
- }
- });
- function showOptions(event, showAll = false) {
- let div,
- i,
- val = event.target.value;
- closeAllLists();
- div = document.createElement("div");
- div.setAttribute("id", event.target.id + "autocomplete-list");
- div.setAttribute("class", "autocomplete-items");
- event.target.parentNode.appendChild(div);
- for (i = 0; i < list.length; i++) {
- if (list[i].toLowerCase().indexOf(val.toLowerCase()) > -1) {
- div.appendChild(getItem(list[i], val));
- } else if (showAll) {
- div.appendChild(getItem(list[i], val));
- }
- }
- }
- function getItem(item, val) {
- const div = document.createElement("div");
- const strong = document.createElement("strong");
- strong.textContent = item.substr(0, val.length);
- div.innerText = item.substr(val.length);
- const hiddenInput = document.createElement("input");
- hiddenInput.type = "hidden";
- hiddenInput.value = item;
- div.prepend(strong);
- div.appendChild(hiddenInput);
- div.addEventListener("click", function (e) {
- input.value = div.getElementsByTagName("input")[0].value;
- input.dispatchEvent(new Event("input"));
- closeAllLists();
- });
- return div;
- }
- function addActive(x) {
- if (!x) return false;
- removeActive(x);
- if (currentFocus >= x.length) currentFocus = 0;
- if (currentFocus < 0) currentFocus = x.length - 1;
- x[currentFocus].classList.add("autocomplete-active");
- }
- function removeActive(x) {
- for (let i = 0; i < x.length; i++) {
- x[i].classList.remove("autocomplete-active");
- }
- }
- function closeAllLists(elmnt) {
- let x = document.getElementsByClassName("autocomplete-items");
- for (let i = 0; i < x.length; i++) {
- if (elmnt != x[i] && elmnt != input) {
- x[i].parentNode.removeChild(x[i]);
- }
- }
- }
- document.addEventListener("click", (e) => {
- if (!autocompletes.find((element) => element.id === e.target.id)) {
- closeAllLists(e.target);
- }
- });
-}
-
-autocompletes.forEach((value) => {
- autocomplete(document.getElementById(value.id), value.instances);
-});
-
-var coll = document.getElementsByClassName("collapsible");
-var i;
-
-for (i = 0; i < coll.length; i++) {
- coll[i].addEventListener("click", function () {
- this.classList.toggle("collapsible-active");
- var content = this.nextElementSibling;
- if (content.style.display === "block") {
- content.style.display = "none";
- } else {
- content.style.display = "block";
- }
- });
-}
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.html b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.html
deleted file mode 100644
index 0f3792b..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.html
+++ /dev/null
@@ -1,265 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title></title>
- <link href="../../assets/stylesheets/styles.css" rel="stylesheet" />
- </head>
-
- <body class="popup">
- <header class="popup">
- <div class="logo-container">
- <img
- src="../../assets/images/icon128.png"
- alt="Privacy Redirect logo"
- />
- <h1>
- <span data-localise="__MSG_privacy__" class="privacy">Privacy</span
- ><br /><span data-localise="__MSG_redirect__">Redirect</span>
- </h1>
- </div>
- <div class="version">
- <span data-localise="__MSG_version__">Version</span>:&nbsp;<span
- id="version"
- ></span>
- </div>
- </header>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle Nitter redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableNitter__">Nitter Redirects</h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-nitter"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-nitter" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle Invidious redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableInvidious__">
- Invidious Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-invidious"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-invidious" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-<!--
- <section class="settings-block">
- <table class="option" aria-label="Toggle Bibliogram redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableBibliogram__">
- Bibliogram Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-bibliogram"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-bibliogram" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section> -->
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle OpenStreetMap redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableOsm__">
- OpenStreetMap Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-osm"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-osm" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle old Reddit redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableReddit__">Reddit Redirects</h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-reddit"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-reddit" class="checkbox-label"> </label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle Search Engine redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableSearchEngine__">
- Search Engine Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-searchEngine"
- type="checkbox"
- checked
- />&nbsp;
- <label for="disable-searchEngine" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle SimplyTranslate redirects">
- <tbody>
- <tr>
- <td>
- <h1 data-localise="__MSG_disableSimplyTranslate__">
- SimplyTranslate Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-simplyTranslate"
- type="checkbox"
- />&nbsp;
- <label
- for="disable-simplyTranslate"
- class="checkbox-label"
- ></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block">
- <table class="option" aria-label="Toggle Wikiepdia redirects">
- <tbody>
- <tr>
- <td>
- <h1
- data-localise="__MSG_disableWikipedia__"
- class="new-badge"
- data-new-badge
- >
- Wikipedia Redirects
- </h1>
- </td>
- <td>
- <input
- aria-hidden="true"
- id="disable-wikipedia"
- type="checkbox"
- />&nbsp;
- <label for="disable-wikipedia" class="checkbox-label"></label>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
-
- <section class="settings-block"></section>
-
- <footer>
- <a class="button" id="more-options">
- <span data-localise="__MSG_moreOptions__">More Options&nbsp;</span>
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="512"
- height="512"
- viewBox="0 0 512 512"
- >
- <path
- d="M384,224V408a40,40,0,0,1-40,40H104a40,40,0,0,1-40-40V168a40,40,0,0,1,40-40H271.48"
- style="
- fill: none;
- stroke: inherit;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- "
- />
- <polyline
- points="336 64 448 64 448 176"
- style="
- fill: none;
- stroke: inherit;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- "
- />
- <line
- x1="224"
- y1="288"
- x2="440"
- y2="72"
- style="
- fill: none;
- stroke: inherit;
- stroke-linecap: round;
- stroke-linejoin: round;
- stroke-width: 32px;
- "
- />
- </svg>
- </a>
- </footer>
-
- <script type="module" src="./popup.js"></script>
- <script src="../../assets/javascripts/localise.js"></script>
- </body>
-</html>
diff --git a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.js b/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.js
deleted file mode 100644
index b4699ca..0000000
--- a/data/extensions/{b7f9d2cd-d772-4302-8c3f-eb941af36f76}/pages/popup/popup.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-
-let disableNitter = document.querySelector("#disable-nitter");
-let disableInvidious = document.querySelector("#disable-invidious");
-// let disableBibliogram = document.querySelector("#disable-bibliogram");
-let disableOsm = document.querySelector("#disable-osm");
-let disableReddit = document.querySelector("#disable-reddit");
-let disableSearchEngine = document.querySelector("#disable-searchEngine");
-let disableSimplyTranslate = document.querySelector("#disable-simplyTranslate");
-let disableWikipedia = document.querySelector("#disable-wikipedia");
-let version = document.querySelector("#version");
-
-window.browser = window.browser || window.chrome;
-
-browser.storage.sync.get(
- [
- "disableNitter",
- "disableInvidious",
- "disableBibliogram",
- "disableOsm",
- "disableReddit",
- "disableSearchEngine",
- "disableSimplyTranslate",
- "disableWikipedia",
- "theme",
- ],
- (result) => {
- if (result.theme) document.body.classList.add(result.theme);
- disableNitter.checked = !result.disableNitter;
- disableInvidious.checked = !result.disableInvidious;
-// disableBibliogram.checked = !result.disableBibliogram;
- disableOsm.checked = !result.disableOsm;
- disableReddit.checked = !result.disableReddit;
- disableSearchEngine.checked = !result.disableSearchEngine;
- disableSimplyTranslate.checked = !result.disableSimplyTranslate;
- disableWikipedia.checked = !result.disableWikipedia;
- }
-);
-
-version.textContent = browser.runtime.getManifest().version;
-
-disableNitter.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableNitter: !event.target.checked });
-});
-
-disableInvidious.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableInvidious: !event.target.checked });
-});
-
-// disableBibliogram.addEventListener("change", (event) => {
-// browser.storage.sync.set({ disableBibliogram: !event.target.checked });
-// });
-
-disableOsm.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableOsm: !event.target.checked });
-});
-
-disableReddit.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableReddit: !event.target.checked });
-});
-
-disableSearchEngine.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableSearchEngine: !event.target.checked });
-});
-
-disableSimplyTranslate.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableSimplyTranslate: !event.target.checked });
-});
-
-disableWikipedia.addEventListener("change", (event) => {
- browser.storage.sync.set({ disableWikipedia: !event.target.checked });
-});
-
-document.querySelector("#more-options").addEventListener("click", () => {
- browser.runtime.openOptionsPage();
-});