changing from || to ??
This commit is contained in:
parent
0cbed7bbba
commit
933cd7b908
|
@ -59,7 +59,6 @@ function setBibliogramInstance(val) {
|
|||
browser.storage.sync.set({ bibliogramInstance })
|
||||
};
|
||||
|
||||
|
||||
async function redirect(url, initiator, type) {
|
||||
await init();
|
||||
if (disableInstagram)
|
||||
|
@ -68,11 +67,7 @@ async function redirect(url, initiator, type) {
|
|||
// Do not redirect Bibliogram view on Instagram links
|
||||
if (
|
||||
initiator &&
|
||||
(
|
||||
initiator.origin === bibliogramInstance ||
|
||||
redirects.normal.includes(initiator.origin) ||
|
||||
targets.includes(initiator.host)
|
||||
)
|
||||
(initiator.origin === bibliogramInstance || redirects.normal.includes(initiator.origin) || targets.includes(initiator.host))
|
||||
)
|
||||
return null;
|
||||
|
||||
|
@ -97,7 +92,7 @@ async function init() {
|
|||
"disableInstagram",
|
||||
"bibliogramInstance",
|
||||
])
|
||||
disableInstagram = result.disableInstagram || false;
|
||||
disableInstagram = result.disableInstagram ?? false;
|
||||
bibliogramInstance = result.bibliogramInstance;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ async function init() {
|
|||
"disableMaps",
|
||||
"osmInstance",
|
||||
])
|
||||
disableMaps = result.disableMaps;
|
||||
disableMaps = result.disableMaps ?? false;
|
||||
osmInstance = result.osmInstance;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ async function init() {
|
|||
"disableMedium",
|
||||
"scribeInstance",
|
||||
])
|
||||
disableMedium = result.disableMedium || false;
|
||||
disableMedium = result.disableMedium ?? false;
|
||||
scribeInstance = result.scribeInstance;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,9 +118,9 @@ async function init() {
|
|||
"redditInstance",
|
||||
"redditFrontend",
|
||||
])
|
||||
disableReddit = result.disableReddit || false;
|
||||
disableReddit = result.disableReddit ?? false;
|
||||
redditInstance = result.redditInstance;
|
||||
redditFrontend = result.redditFrontend || 'libreddit';
|
||||
redditFrontend = result.redditFrontend ?? 'libreddit';
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -200,15 +200,14 @@ async function redirect(url, initiator) {
|
|||
}
|
||||
|
||||
async function init() {
|
||||
console.log("Init Search Helper");
|
||||
let result = await browser.storage.sync.get([
|
||||
"disableSearch",
|
||||
"searchInstance",
|
||||
"searchFrontend",
|
||||
])
|
||||
disableSearch = result.disableSearch;
|
||||
disableSearch = result.disableSearch ?? false;
|
||||
searchInstance = result.searchInstance;
|
||||
searchFrontend = result.searchFrontend;
|
||||
searchFrontend = result.searchFrontend ?? 'searx';
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -90,9 +90,9 @@ async function init() {
|
|||
"simplyTranslateInstance",
|
||||
"translateFrontend"
|
||||
]);
|
||||
disableTranslate = result.disableTranslate || false;
|
||||
disableTranslate = result.disableTranslate ?? false;
|
||||
simplyTranslateInstance = result.simplyTranslateInstance;
|
||||
translateFrontend = result.translateFrontend || "simplyTransalte";
|
||||
translateFrontend = result.translateFrontend ?? "simplyTransalte";
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -96,7 +96,7 @@ async function init() {
|
|||
"disableTwitter",
|
||||
"nitterInstance"
|
||||
]);
|
||||
disableTwitter = result.disableTwitter || false;
|
||||
disableTwitter = result.disableTwitter ?? false;
|
||||
nitterInstance = result.nitterInstance;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ async function init() {
|
|||
"disableWikipedia",
|
||||
"wikipediaInstance",
|
||||
]);
|
||||
disableWikipedia = result.disableWikipedia || false;
|
||||
disableWikipedia = result.disableWikipedia ?? false;
|
||||
wikipediaInstance = result.wikipediaInstance;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,17 +234,17 @@ async function init() {
|
|||
"invidiousAutoplay",
|
||||
"useFreeTube",
|
||||
]);
|
||||
disableYoutube = result.disableYoutube || false;
|
||||
disableYoutube = result.disableYoutube ?? false;
|
||||
invidiousInstance = result.invidiousInstance;
|
||||
invidiousAlwaysProxy = result.invidiousAlwaysProxy || true;
|
||||
invidiousOnlyEmbeddedVideo = result.invidiousOnlyEmbeddedVideo || false;
|
||||
invidiousVideoQuality = result.invidiousVideoQuality || 'medium';
|
||||
invidiousDarkMode = result.invidiousDarkMode || true;
|
||||
invidiousVolume = result.invidiousVolume || 50;
|
||||
invidiousPlayerStyle = result.invidiousPlayerStyle || 'invidious';
|
||||
invidiousAlwaysProxy = result.invidiousAlwaysProxy ?? true;
|
||||
invidiousOnlyEmbeddedVideo = result.invidiousOnlyEmbeddedVideo ?? false;
|
||||
invidiousVideoQuality = result.invidiousVideoQuality ?? 'medium';
|
||||
invidiousDarkMode = result.invidiousDarkMode ?? true;
|
||||
invidiousVolume = result.invidiousVolume ?? 50;
|
||||
invidiousPlayerStyle = result.invidiousPlayerStyle ?? 'invidious';
|
||||
invidiousSubtitles = result.invidiousSubtitles || '';
|
||||
invidiousAutoplay = result.invidiousAutoplay || true;
|
||||
useFreeTube = result.useFreeTube || false;
|
||||
invidiousAutoplay = result.invidiousAutoplay ?? true;
|
||||
useFreeTube = result.useFreeTube ?? false;
|
||||
|
||||
if (result.persistInvidiousPrefs) initInvidiousCookie();
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
"use strict";
|
||||
|
||||
import mapsHelper from "../../assets/javascripts/helpers/maps.js";
|
||||
import twitterHelper from "../../assets/javascripts/helpers/twitter.js";
|
||||
import youtubeHelper from "../../assets/javascripts/helpers/youtube.js";
|
||||
import twitterHelper from "../../assets/javascripts/helpers/twitter.js";
|
||||
import instagramHelper from "../../assets/javascripts/helpers/instagram.js";
|
||||
import mediumHelper from "../../assets/javascripts/helpers/medium.js";
|
||||
import redditHelper from "../../assets/javascripts/helpers/reddit.js";
|
||||
import searchHelper from "../../assets/javascripts/helpers/search.js";
|
||||
import translateHelper from "../../assets/javascripts/helpers/translate.js";
|
||||
import wikipediaHelper from "../../assets/javascripts/helpers/wikipedia.js";
|
||||
import mapsHelper from "../../assets/javascripts/helpers/maps.js";
|
||||
import wikipediaHelper from "../../assets/javascripts/helpers/wikipedia.js";
|
||||
import mediumHelper from "../../assets/javascripts/helpers/medium.js";
|
||||
|
||||
window.browser = window.browser || window.chrome;
|
||||
|
||||
|
|
Loading…
Reference in New Issue