Completing on supporting tor #32
This commit is contained in:
parent
1a1e0c988c
commit
384950d348
|
@ -49,7 +49,7 @@ async function wholeInit() {
|
|||
}
|
||||
|
||||
async function updateInstances() {
|
||||
const apiEndpoint = 'https://raw.githubusercontent.com/libredirect/libredirect/master/instances/data.json';
|
||||
const apiEndpoint = 'https://raw.githubusercontent.com/libredirect/libredirect/master/src/instances/data.json';
|
||||
let request = new XMLHttpRequest();
|
||||
request.open('GET', apiEndpoint, false);
|
||||
request.send(null);
|
||||
|
|
|
@ -28,7 +28,7 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"rimgo": {
|
||||
"normal": [...rimgoRedirectsChecks, ...rimgoCustomRedirects]
|
||||
"normal": [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -37,28 +37,28 @@ function setRedirects(val) {
|
|||
redirects.rimgo = val;
|
||||
browser.storage.sync.set({ imgurRedirects: redirects })
|
||||
console.log("imgurRedirects: ", val)
|
||||
for (const item of rimgoRedirectsChecks)
|
||||
for (const item of rimgoNormalRedirectsChecks)
|
||||
if (!redirects.rimgo.normal.includes(item)) {
|
||||
var index = rimgoRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) rimgoRedirectsChecks.splice(index, 1);
|
||||
var index = rimgoNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) rimgoNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setRimgoRedirectsChecks(rimgoRedirectsChecks);
|
||||
setRimgoNormalRedirectsChecks(rimgoNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let rimgoRedirectsChecks;
|
||||
const getRimgoRedirectsChecks = () => rimgoRedirectsChecks;
|
||||
function setRimgoRedirectsChecks(val) {
|
||||
rimgoRedirectsChecks = val;
|
||||
browser.storage.sync.set({ rimgoRedirectsChecks })
|
||||
console.log("rimgoRedirectsChecks: ", val)
|
||||
let rimgoNormalRedirectsChecks;
|
||||
const getRimgoNormalRedirectsChecks = () => rimgoNormalRedirectsChecks;
|
||||
function setRimgoNormalRedirectsChecks(val) {
|
||||
rimgoNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ rimgoNormalRedirectsChecks })
|
||||
console.log("rimgoNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let rimgoCustomRedirects = [];
|
||||
const getRimgoCustomRedirects = () => rimgoCustomRedirects;
|
||||
function setRimgoCustomRedirects(val) {
|
||||
rimgoCustomRedirects = val;
|
||||
browser.storage.sync.set({ rimgoCustomRedirects })
|
||||
console.log("rimgoCustomRedirects: ", val)
|
||||
let rimgoNormalCustomRedirects = [];
|
||||
const getRimgoNormalCustomRedirects = () => rimgoNormalCustomRedirects;
|
||||
function setRimgoNormalCustomRedirects(val) {
|
||||
rimgoNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ rimgoNormalCustomRedirects })
|
||||
console.log("rimgoNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -73,7 +73,7 @@ function isImgur(url, initiator) {
|
|||
if (url.pathname == "/") return false;
|
||||
if (
|
||||
initiator &&
|
||||
([...redirects.rimgo.normal, ...rimgoCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
([...redirects.rimgo.normal, ...rimgoNormalCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
) return false;
|
||||
return targets.some((rx) => rx.test(url.href));
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ function redirect(url, type) {
|
|||
|
||||
if (type != "main_frame" && "sub_frame" && "xmlhttprequest" && "other") return null;
|
||||
|
||||
let instancesList = [...rimgoRedirectsChecks, ...rimgoCustomRedirects];
|
||||
let instancesList = [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -100,16 +100,16 @@ async function init() {
|
|||
[
|
||||
"disableImgur",
|
||||
"imgurRedirects",
|
||||
"rimgoRedirectsChecks",
|
||||
"rimgoCustomRedirects",
|
||||
"rimgoNormalRedirectsChecks",
|
||||
"rimgoNormalCustomRedirects",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableImgur ?? false;
|
||||
|
||||
if (result.imgurRedirects) redirects = result.imgurRedirects;
|
||||
|
||||
rimgoRedirectsChecks = result.rimgoRedirectsChecks ?? [...redirects.rimgo.normal];
|
||||
rimgoCustomRedirects = result.rimgoCustomRedirects ?? [];
|
||||
rimgoNormalRedirectsChecks = result.rimgoNormalRedirectsChecks ?? [...redirects.rimgo.normal];
|
||||
rimgoNormalCustomRedirects = result.rimgoNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -125,11 +125,11 @@ export default {
|
|||
getDisable,
|
||||
setDisable,
|
||||
|
||||
getRimgoRedirectsChecks,
|
||||
setRimgoRedirectsChecks,
|
||||
getRimgoNormalRedirectsChecks,
|
||||
setRimgoNormalRedirectsChecks,
|
||||
|
||||
getRimgoCustomRedirects,
|
||||
setRimgoCustomRedirects,
|
||||
getRimgoNormalCustomRedirects,
|
||||
setRimgoNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
isImgur,
|
||||
|
|
|
@ -26,7 +26,7 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"bibliogram": {
|
||||
"normal": [...bibliogramRedirectsChecks, ...bibliogramCustomRedirects]
|
||||
"normal": [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -34,28 +34,28 @@ function setRedirects(val) {
|
|||
redirects.bibliogram = val;
|
||||
browser.storage.sync.set({ instagramRedirects: redirects })
|
||||
console.log("instagramRedirects: ", val)
|
||||
for (const item of bibliogramRedirectsChecks)
|
||||
for (const item of bibliogramNormalRedirectsChecks)
|
||||
if (!redirects.bibliogram.normal.includes(item)) {
|
||||
var index = bibliogramRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) bibliogramRedirectsChecks.splice(index, 1);
|
||||
var index = bibliogramNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) bibliogramNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setBibliogramRedirectsChecks(bibliogramRedirectsChecks);
|
||||
setBibliogramNormalRedirectsChecks(bibliogramNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let bibliogramRedirectsChecks;
|
||||
const getBibliogramRedirectsChecks = () => bibliogramRedirectsChecks;
|
||||
function setBibliogramRedirectsChecks(val) {
|
||||
bibliogramRedirectsChecks = val;
|
||||
browser.storage.sync.set({ bibliogramRedirectsChecks })
|
||||
console.log("bibliogramRedirectsChecks: ", val)
|
||||
let bibliogramNormalRedirectsChecks;
|
||||
const getBibliogramNormalRedirectsChecks = () => bibliogramNormalRedirectsChecks;
|
||||
function setBibliogramNormalRedirectsChecks(val) {
|
||||
bibliogramNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ bibliogramNormalRedirectsChecks })
|
||||
console.log("bibliogramNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let bibliogramCustomRedirects = [];
|
||||
const getBibliogramCustomRedirects = () => bibliogramCustomRedirects;
|
||||
function setBibliogramCustomRedirects(val) {
|
||||
bibliogramCustomRedirects = val;
|
||||
browser.storage.sync.set({ bibliogramCustomRedirects })
|
||||
console.log("bibliogramCustomRedirects: ", val)
|
||||
let bibliogramNormalCustomRedirects = [];
|
||||
const getBibliogramNormalCustomRedirects = () => bibliogramNormalCustomRedirects;
|
||||
function setBibliogramNormalCustomRedirects(val) {
|
||||
bibliogramNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ bibliogramNormalCustomRedirects })
|
||||
console.log("bibliogramNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
const reservedPaths = [
|
||||
|
@ -97,7 +97,7 @@ function isInstagram(url, initiator) {
|
|||
if (disable) return false;
|
||||
if (
|
||||
initiator &&
|
||||
([...redirects.bibliogram.normal, ...bibliogramCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
([...redirects.bibliogram.normal, ...bibliogramNormalCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
)
|
||||
return false; // Do not redirect Bibliogram view on Instagram links
|
||||
return targets.includes(url.host)
|
||||
|
@ -107,7 +107,7 @@ function redirect(url, type) {
|
|||
if (type !== "main_frame" || url.pathname.match(bypassPaths))
|
||||
return 'CANCEL'; // Do not redirect /accounts, /embeds.js, or anything other than main_frame
|
||||
|
||||
let instancesList = [...bibliogramRedirectsChecks, ...bibliogramCustomRedirects];
|
||||
let instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -124,16 +124,16 @@ async function init() {
|
|||
[
|
||||
"disableInstagram",
|
||||
"instagramRedirects",
|
||||
"bibliogramRedirectsChecks",
|
||||
"bibliogramCustomRedirects",
|
||||
"bibliogramNormalRedirectsChecks",
|
||||
"bibliogramNormalCustomRedirects",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableInstagram ?? false;
|
||||
|
||||
if (result.instagramRedirects) redirects = result.instagramRedirects
|
||||
|
||||
bibliogramRedirectsChecks = result.bibliogramRedirectsChecks ?? [...redirects.bibliogram.normal];
|
||||
bibliogramCustomRedirects = result.bibliogramCustomRedirects ?? [];
|
||||
bibliogramNormalRedirectsChecks = result.bibliogramNormalRedirectsChecks ?? [...redirects.bibliogram.normal];
|
||||
bibliogramNormalCustomRedirects = result.bibliogramNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -149,11 +149,11 @@ export default {
|
|||
getDisable,
|
||||
setDisable,
|
||||
|
||||
getBibliogramRedirectsChecks,
|
||||
setBibliogramRedirectsChecks,
|
||||
getBibliogramNormalRedirectsChecks,
|
||||
setBibliogramNormalRedirectsChecks,
|
||||
|
||||
getBibliogramCustomRedirects,
|
||||
setBibliogramCustomRedirects,
|
||||
getBibliogramNormalCustomRedirects,
|
||||
setBibliogramNormalCustomRedirects,
|
||||
|
||||
isInstagram,
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"scribe": {
|
||||
"normal": [...scribeRedirectsChecks, ...scribeCustomRedirects]
|
||||
"normal": [...scribeNormalRedirectsChecks, ...scribeNormalCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -40,27 +40,27 @@ function setRedirects(val) {
|
|||
redirects.scribe = val;
|
||||
browser.storage.sync.set({ mediumRedirects: redirects })
|
||||
console.log("mediumRedirects: ", val)
|
||||
for (const item of scribeRedirectsChecks) if (!redirects.scribe.normal.includes(item)) {
|
||||
var index = scribeRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) scribeRedirectsChecks.splice(index, 1);
|
||||
for (const item of scribeNormalRedirectsChecks) if (!redirects.scribe.normal.includes(item)) {
|
||||
var index = scribeNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) scribeNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setScribeRedirectsChecks(scribeRedirectsChecks);
|
||||
setScribeNormalRedirectsChecks(scribeNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let scribeRedirectsChecks;
|
||||
const getScribeRedirectsChecks = () => scribeRedirectsChecks;
|
||||
function setScribeRedirectsChecks(val) {
|
||||
scribeRedirectsChecks = val;
|
||||
browser.storage.sync.set({ scribeRedirectsChecks })
|
||||
console.log("scribeRedirectsChecks: ", val)
|
||||
let scribeNormalRedirectsChecks;
|
||||
const getScribeNormalRedirectsChecks = () => scribeNormalRedirectsChecks;
|
||||
function setScribeNormalRedirectsChecks(val) {
|
||||
scribeNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ scribeNormalRedirectsChecks })
|
||||
console.log("scribeNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let scribeCustomRedirects = [];
|
||||
const getScribeCustomRedirects = () => scribeCustomRedirects;
|
||||
function setScribeCustomRedirects(val) {
|
||||
scribeCustomRedirects = val;
|
||||
browser.storage.sync.set({ scribeCustomRedirects })
|
||||
console.log("scribeCustomRedirects: ", val)
|
||||
let scribeNormalCustomRedirects = [];
|
||||
const getScribeNormalCustomRedirects = () => scribeNormalCustomRedirects;
|
||||
function setScribeNormalCustomRedirects(val) {
|
||||
scribeNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ scribeNormalCustomRedirects })
|
||||
console.log("scribeNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -68,6 +68,7 @@ const getDisable = () => disable;
|
|||
function setDisable(val) {
|
||||
disable = val;
|
||||
browser.storage.sync.set({ disableMedium: disable })
|
||||
console.log("disableMedium", disable)
|
||||
}
|
||||
|
||||
function isMedium(url, initiator) {
|
||||
|
@ -76,7 +77,7 @@ function isMedium(url, initiator) {
|
|||
|
||||
if (
|
||||
commonHelper.isFirefox() &&
|
||||
initiator && ([...redirects.scribe.normal, ...scribeCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
initiator && ([...redirects.scribe.normal, ...scribeNormalCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))
|
||||
) return false;
|
||||
|
||||
return targets.some((rx) => rx.test(url.host));
|
||||
|
@ -85,7 +86,7 @@ function redirect(url, type) {
|
|||
|
||||
if (type != "main_frame" && "sub_frame" && "xmlhttprequest" && "other") return null;
|
||||
|
||||
let instancesList = [...scribeRedirectsChecks, ...scribeCustomRedirects];
|
||||
let instancesList = [...scribeNormalRedirectsChecks, ...scribeNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -98,16 +99,16 @@ async function init() {
|
|||
[
|
||||
"disableMedium",
|
||||
"mediumRedirects",
|
||||
"scribeRedirectsChecks",
|
||||
"scribeCustomRedirects",
|
||||
"scribeNormalRedirectsChecks",
|
||||
"scribeNormalCustomRedirects",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableMedium ?? false;
|
||||
|
||||
if (result.mediumRedirects) redirects = result.mediumRedirects;
|
||||
|
||||
scribeRedirectsChecks = result.scribeRedirectsChecks ?? [...redirects.scribe.normal];
|
||||
scribeCustomRedirects = result.scribeCustomRedirects ?? [];
|
||||
scribeNormalRedirectsChecks = result.scribeNormalRedirectsChecks ?? [...redirects.scribe.normal];
|
||||
scribeNormalCustomRedirects = result.scribeNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -126,11 +127,11 @@ export default {
|
|||
getDisable,
|
||||
setDisable,
|
||||
|
||||
getScribeRedirectsChecks,
|
||||
setScribeRedirectsChecks,
|
||||
getScribeNormalRedirectsChecks,
|
||||
setScribeNormalRedirectsChecks,
|
||||
|
||||
getScribeCustomRedirects,
|
||||
setScribeCustomRedirects,
|
||||
getScribeNormalCustomRedirects,
|
||||
setScribeNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
isMedium,
|
||||
|
|
|
@ -63,10 +63,10 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"libreddit": {
|
||||
"normal": [...libredditRedirectsChecks, ...libredditCustomRedirects]
|
||||
"normal": [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects]
|
||||
},
|
||||
"teddit": {
|
||||
"normal": [...tedditRedirectsChecks, ...tedditCustomRedirects]
|
||||
"normal": [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -75,57 +75,57 @@ function setLibredditRedirects(val) {
|
|||
redirects.libreddit = val;
|
||||
browser.storage.sync.set({ redditRedirects: redirects })
|
||||
console.log("libredditRedirects:", val)
|
||||
for (const item of libredditRedirectsChecks)
|
||||
for (const item of libredditNormalRedirectsChecks)
|
||||
if (!redirects.libreddit.normal.includes(item)) {
|
||||
var index = libredditRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) libredditRedirectsChecks.splice(index, 1);
|
||||
var index = libredditNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) libredditNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setLibredditRedirectsChecks(libredditRedirectsChecks);
|
||||
setLibredditNormalRedirectsChecks(libredditNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
function setTedditRedirects(val) {
|
||||
redirects.teddit = val;
|
||||
browser.storage.sync.set({ redditRedirects: redirects })
|
||||
console.log("tedditRedirects:", val)
|
||||
for (const item of tedditRedirectsChecks)
|
||||
for (const item of tedditNormalRedirectsChecks)
|
||||
if (!redirects.teddit.normal.includes(item)) {
|
||||
var index = tedditRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) tedditRedirectsChecks.splice(index, 1);
|
||||
var index = tedditNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) tedditNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setTedditRedirectsChecks(tedditRedirectsChecks);
|
||||
setTedditNormalRedirectsChecks(tedditNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
|
||||
let libredditRedirectsChecks;
|
||||
const getLibredditRedirectsChecks = () => libredditRedirectsChecks;
|
||||
function setLibredditRedirectsChecks(val) {
|
||||
libredditRedirectsChecks = val;
|
||||
browser.storage.sync.set({ libredditRedirectsChecks })
|
||||
console.log("libredditRedirectsChecks: ", val)
|
||||
let libredditNormalRedirectsChecks;
|
||||
const getLibredditNormalRedirectsChecks = () => libredditNormalRedirectsChecks;
|
||||
function setLibredditNormalRedirectsChecks(val) {
|
||||
libredditNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ libredditNormalRedirectsChecks })
|
||||
console.log("libredditNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let libredditCustomRedirects = [];
|
||||
const getLibredditCustomRedirects = () => libredditCustomRedirects;
|
||||
function setLibredditCustomRedirects(val) {
|
||||
libredditCustomRedirects = val;
|
||||
browser.storage.sync.set({ libredditCustomRedirects })
|
||||
console.log("libredditCustomRedirects: ", val)
|
||||
let libredditNormalCustomRedirects = [];
|
||||
const getLibredditNormalCustomRedirects = () => libredditNormalCustomRedirects;
|
||||
function setLibredditNormalCustomRedirects(val) {
|
||||
libredditNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ libredditNormalCustomRedirects })
|
||||
console.log("libredditNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let tedditRedirectsChecks;
|
||||
const getTedditRedirectsChecks = () => tedditRedirectsChecks;
|
||||
function setTedditRedirectsChecks(val) {
|
||||
tedditRedirectsChecks = val;
|
||||
browser.storage.sync.set({ tedditRedirectsChecks })
|
||||
console.log("tedditRedirectsChecks: ", val)
|
||||
let tedditNormalRedirectsChecks;
|
||||
const getTedditNormalRedirectsChecks = () => tedditNormalRedirectsChecks;
|
||||
function setTedditNormalRedirectsChecks(val) {
|
||||
tedditNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ tedditNormalRedirectsChecks })
|
||||
console.log("tedditNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let tedditCustomRedirects = [];
|
||||
const getTedditCustomRedirects = () => tedditCustomRedirects;
|
||||
function setTedditCustomRedirects(val) {
|
||||
tedditCustomRedirects = val;
|
||||
browser.storage.sync.set({ tedditCustomRedirects })
|
||||
console.log("tedditCustomRedirects: ", val)
|
||||
let tedditNormalCustomRedirects = [];
|
||||
const getTedditNormalCustomRedirects = () => tedditNormalCustomRedirects;
|
||||
function setTedditNormalCustomRedirects(val) {
|
||||
tedditNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ tedditNormalCustomRedirects })
|
||||
console.log("tedditNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/;
|
||||
|
@ -148,8 +148,8 @@ function isReddit(url, initiator) {
|
|||
if (
|
||||
initiator &&
|
||||
(
|
||||
[...redirects.libreddit.normal, ...libredditCustomRedirects].includes(initiator.origin) ||
|
||||
[...redirects.teddit.normal, ...tedditCustomRedirects].includes(initiator.origin) ||
|
||||
[...redirects.libreddit.normal, ...libredditNormalCustomRedirects].includes(initiator.origin) ||
|
||||
[...redirects.teddit.normal, ...tedditNormalCustomRedirects].includes(initiator.origin) ||
|
||||
targets.includes(initiator.host)
|
||||
)
|
||||
) return false;
|
||||
|
@ -161,8 +161,8 @@ function redirect(url, type) {
|
|||
|
||||
if (type !== "main_frame" || url.pathname.match(bypassPaths)) return null;
|
||||
|
||||
let libredditInstancesList = [...libredditRedirectsChecks, ...libredditCustomRedirects];
|
||||
let tedditInstancesList = [...tedditRedirectsChecks, ...tedditCustomRedirects];
|
||||
let libredditInstancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
let tedditInstancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
|
||||
if (url.host === "i.redd.it") {
|
||||
if (libredditInstancesList.length === 0) return null;
|
||||
|
@ -212,21 +212,21 @@ async function init() {
|
|||
"disableReddit",
|
||||
"redditFrontend",
|
||||
"redditRedirects",
|
||||
"libredditRedirectsChecks",
|
||||
"libredditCustomRedirects",
|
||||
"tedditRedirectsChecks",
|
||||
"tedditCustomRedirects",
|
||||
"libredditNormalRedirectsChecks",
|
||||
"libredditNormalCustomRedirects",
|
||||
"tedditNormalRedirectsChecks",
|
||||
"tedditNormalCustomRedirects",
|
||||
], (result) => {
|
||||
disableReddit = result.disableReddit ?? false;
|
||||
redditFrontend = result.redditFrontend ?? 'libreddit';
|
||||
if (result.redditRedirects)
|
||||
redirects = result.redditRedirects;
|
||||
|
||||
libredditRedirectsChecks = result.libredditRedirectsChecks ?? [...redirects.libreddit.normal];
|
||||
libredditCustomRedirects = result.libredditCustomRedirects ?? [];
|
||||
libredditNormalRedirectsChecks = result.libredditNormalRedirectsChecks ?? [...redirects.libreddit.normal];
|
||||
libredditNormalCustomRedirects = result.libredditNormalCustomRedirects ?? [];
|
||||
|
||||
tedditRedirectsChecks = result.tedditRedirectsChecks ?? [...redirects.teddit.normal];
|
||||
tedditCustomRedirects = result.tedditCustomRedirects ?? [];
|
||||
tedditNormalRedirectsChecks = result.tedditNormalRedirectsChecks ?? [...redirects.teddit.normal];
|
||||
tedditNormalCustomRedirects = result.tedditNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -247,17 +247,17 @@ export default {
|
|||
getRedditFrontend,
|
||||
setRedditFrontend,
|
||||
|
||||
getLibredditRedirectsChecks,
|
||||
setLibredditRedirectsChecks,
|
||||
getLibredditNormalRedirectsChecks,
|
||||
setLibredditNormalRedirectsChecks,
|
||||
|
||||
getLibredditCustomRedirects,
|
||||
setLibredditCustomRedirects,
|
||||
getLibredditNormalCustomRedirects,
|
||||
setLibredditNormalCustomRedirects,
|
||||
|
||||
getTedditRedirectsChecks,
|
||||
setTedditRedirectsChecks,
|
||||
getTedditNormalRedirectsChecks,
|
||||
setTedditNormalRedirectsChecks,
|
||||
|
||||
getTedditCustomRedirects,
|
||||
setTedditCustomRedirects,
|
||||
getTedditNormalCustomRedirects,
|
||||
setTedditNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
isReddit,
|
||||
|
|
|
@ -3,136 +3,17 @@ window.browser = window.browser || window.chrome;
|
|||
import commonHelper from './common.js'
|
||||
|
||||
const targets = [
|
||||
/https?:\/\/(www\.|maps\.|search\.|)google\.com(\/search\?..*|\/$)/,
|
||||
/https?:\/\/(www\.|maps\.|search\.|)google\.com(\...|)(\/search\?..*|\/$)/,
|
||||
// /https?:\/\/yandex\.com(\...|)(\/search\/..*|\/$)/,
|
||||
];
|
||||
let redirects = {
|
||||
"searx": {
|
||||
"normal": [
|
||||
"https://anon.sx",
|
||||
"https://darmarit.org/searx",
|
||||
"https://dynabyte.ca",
|
||||
"https://engo.mint.lgbt",
|
||||
"https://jsearch.pw",
|
||||
"https://metasearch.nl",
|
||||
"https://nibblehole.com",
|
||||
"https://northboot.xyz",
|
||||
"https://paulgo.io",
|
||||
"https://procurx.pt",
|
||||
"https://s.zhaocloud.net",
|
||||
"https://search.antonkling.se",
|
||||
"https://search.asynchronousexchange.com",
|
||||
"https://search.biboumail.fr",
|
||||
"https://search.bus-hit.me",
|
||||
"https://search.disroot.org",
|
||||
"https://search.ethibox.fr",
|
||||
"https://search.jpope.org",
|
||||
"https://search.mdosch.de",
|
||||
"https://search.neet.works",
|
||||
"https://search.ononoki.org",
|
||||
"https://search.snopyta.org",
|
||||
"https://search.st8.at",
|
||||
"https://search.stinpriza.org",
|
||||
"https://search.trom.tf",
|
||||
"https://search.zdechov.net",
|
||||
"https://searx-private-search.de",
|
||||
"https://searx.bar",
|
||||
"https://searx.be",
|
||||
"https://searx.bissisoft.com",
|
||||
"https://searx.divided-by-zero.eu",
|
||||
"https://searx.dresden.network",
|
||||
"https://searx.esmailelbob.xyz",
|
||||
"https://searx.everdot.org",
|
||||
"https://searx.fmac.xyz",
|
||||
"https://searx.fossencdi.org",
|
||||
"https://searx.gnous.eu",
|
||||
"https://searx.gnu.style",
|
||||
"https://searx.hardwired.link",
|
||||
"https://searx.hummel-web.at",
|
||||
"https://searx.lavatech.top",
|
||||
"https://searx.mastodontech.de",
|
||||
"https://searx.mha.fi",
|
||||
"https://searx.mxchange.org",
|
||||
"https://searx.nakhan.net",
|
||||
"https://searx.netzspielplatz.de",
|
||||
"https://searx.nevrlands.de",
|
||||
"https://searx.ninja",
|
||||
"https://searx.nixnet.services",
|
||||
"https://searx.openhoofd.nl",
|
||||
"https://searx.operationtulip.com",
|
||||
"https://searx.org",
|
||||
"https://searx.prvcy.eu",
|
||||
"https://searx.pwoss.org",
|
||||
"https://searx.rasp.fr",
|
||||
"https://searx.roughs.ru",
|
||||
"https://searx.ru",
|
||||
"https://searx.run",
|
||||
"https://searx.sadblog.xyz",
|
||||
"https://searx.semipvt.com",
|
||||
"https://searx.slash-dev.de",
|
||||
"https://searx.solusar.de",
|
||||
"https://searx.sp-codes.de",
|
||||
"https://searx.stuehieyr.com",
|
||||
"https://searx.theanonymouse.xyz",
|
||||
"https://searx.thegreenwebfoundation.org",
|
||||
"https://searx.tiekoetter.com",
|
||||
"https://searx.tk",
|
||||
"https://searx.tux.land",
|
||||
"https://searx.tuxcloud.net",
|
||||
"https://searx.tyil.nl",
|
||||
"https://searx.vitanetworks.link",
|
||||
"https://searx.webheberg.info",
|
||||
"https://searx.xkek.net",
|
||||
"https://searx.xyz",
|
||||
"https://searx.zackptg5.com",
|
||||
"https://searx.zapashcanon.fr",
|
||||
"https://searx.zecircle.xyz",
|
||||
"https://serx.cf",
|
||||
"https://spot.ecloud.global",
|
||||
"https://suche.dasnetzundich.de",
|
||||
"https://suche.uferwerk.org",
|
||||
"https://swag.pw",
|
||||
"https://sx.catgirl.cloud",
|
||||
"https://sx.fedi.tech",
|
||||
"https://timdor.noip.me/searx",
|
||||
"https://trovu.komun.org",
|
||||
"https://www.gruble.de",
|
||||
"https://www.webrats.xyz",
|
||||
"https://xeek.com",
|
||||
"https://searx.roflcopter.fr",
|
||||
],
|
||||
"tor": [
|
||||
"http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion",
|
||||
"http://searxbgetrkiwxhdwi6svpgh7eotopqyxhbqiokrwzg7dcte44t36kyd.onion",
|
||||
"http://suche.xyzco456vwisukfg.onion",
|
||||
"http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion",
|
||||
"http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion",
|
||||
"http://z34ambyi6makk6ta7ksog2sljly2ctt2sa3apekb7wkllk72sxecdtad.onion",
|
||||
"http://search.4bkxscubgtxwvhpe.onion",
|
||||
"http://juy4e6eicawzdrz7.onion",
|
||||
"http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion",
|
||||
"http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion",
|
||||
"http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion",
|
||||
"http://searx.cwuzdtzlubq5uual.onion",
|
||||
"http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion",
|
||||
"http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion",
|
||||
"http://searx.bsbvtqi5oq2cqzn32zt4cr2f2z2rwots3dq7gmdcnlyqoxko2wx6reqd.onion"
|
||||
],
|
||||
"i2p": [
|
||||
"http://ransack.i2p",
|
||||
"http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p"
|
||||
]
|
||||
"normal": [],
|
||||
"tor": [],
|
||||
"i2p": []
|
||||
},
|
||||
"whoogle": {
|
||||
"normal": [
|
||||
"https://s.alefvanoon.xyz",
|
||||
"https://search.albony.xyz",
|
||||
"https://search.garudalinux.org",
|
||||
"https://search.sethforprivacy.com",
|
||||
"https://whoogle.fossho.st",
|
||||
"https://whooglesearch.net",
|
||||
"https://www.whooglesearch.ml",
|
||||
"https://whoogle.dcs0.hu"
|
||||
],
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
};
|
||||
|
@ -140,10 +21,12 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = () => {
|
||||
return {
|
||||
"searx": {
|
||||
"normal": [...searxRedirectsChecks, ...searxCustomRedirects]
|
||||
"normal": [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects],
|
||||
"tor": [...searxTorRedirectsChecks, ...searxTorCustomRedirects],
|
||||
},
|
||||
"whoogle": {
|
||||
"normal": [...whoogleRedirectsChecks, ...whoogleCustomRedirects]
|
||||
"normal": [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects],
|
||||
"normal": [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -152,54 +35,98 @@ function setSearxRedirects(val) {
|
|||
redirects.searx = val;
|
||||
browser.storage.sync.set({ searchRedirects: redirects })
|
||||
console.log("searxRedirects:", val)
|
||||
for (const item of searxRedirectsChecks) if (!redirects.searx.normal.includes(item)) {
|
||||
var index = searxRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) searxRedirectsChecks.splice(index, 1);
|
||||
for (const item of searxNormalRedirectsChecks) if (!redirects.searx.normal.includes(item)) {
|
||||
var index = searxNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) searxNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setSearxRedirectsChecks(searxRedirectsChecks);
|
||||
setSearxNormalRedirectsChecks(searxNormalRedirectsChecks);
|
||||
|
||||
for (const item of searxTorRedirectsChecks) if (!redirects.searx.tor.includes(item)) {
|
||||
var index = searxTorRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) searxTorRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setSearxTorRedirectsChecks(searxTorRedirectsChecks);
|
||||
}
|
||||
|
||||
function setWhoogleRedirects(val) {
|
||||
redirects.whoogle = val;
|
||||
browser.storage.sync.set({ searchRedirects: redirects })
|
||||
console.log("whoogleRedirects:", val)
|
||||
for (const item of whoogleRedirectsChecks) if (!redirects.whoogle.normal.includes(item)) {
|
||||
var index = whoogleRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) whoogleRedirectsChecks.splice(index, 1);
|
||||
for (const item of whoogleNormalRedirectsChecks) if (!redirects.whoogle.normal.includes(item)) {
|
||||
var index = whoogleNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) whoogleNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setWhoogleRedirectsChecks(whoogleRedirectsChecks);
|
||||
setWhoogleNormalRedirectsChecks(whoogleNormalRedirectsChecks);
|
||||
|
||||
for (const item of whoogleTorRedirectsChecks) if (!redirects.whoogle.tor.includes(item)) {
|
||||
var index = whoogleTorRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) whoogleTorRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setWhoogleTorRedirectsChecks(whoogleTorRedirectsChecks);
|
||||
}
|
||||
|
||||
let whoogleRedirectsChecks;
|
||||
const getWhoogleRedirectsChecks = () => whoogleRedirectsChecks;
|
||||
function setWhoogleRedirectsChecks(val) {
|
||||
whoogleRedirectsChecks = val;
|
||||
browser.storage.sync.set({ whoogleRedirectsChecks })
|
||||
console.log("whoogleRedirectsChecks: ", val)
|
||||
let whoogleNormalRedirectsChecks;
|
||||
const getWhoogleNormalRedirectsChecks = () => whoogleNormalRedirectsChecks;
|
||||
function setWhoogleNormalRedirectsChecks(val) {
|
||||
whoogleNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ whoogleNormalRedirectsChecks })
|
||||
console.log("whoogleNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let whoogleCustomRedirects = [];
|
||||
const getWhoogleCustomRedirects = () => whoogleCustomRedirects;
|
||||
function setWhoogleCustomRedirects(val) {
|
||||
whoogleCustomRedirects = val;
|
||||
browser.storage.sync.set({ whoogleCustomRedirects })
|
||||
console.log("whoogleCustomRedirects: ", val)
|
||||
let whoogleTorRedirectsChecks;
|
||||
const getWhoogleTorRedirectsChecks = () => whoogleTorRedirectsChecks;
|
||||
function setWhoogleTorRedirectsChecks(val) {
|
||||
whoogleTorRedirectsChecks = val;
|
||||
browser.storage.sync.set({ whoogleTorRedirectsChecks })
|
||||
console.log("whoogleTorRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let searxRedirectsChecks;
|
||||
const getSearxRedirectsChecks = () => searxRedirectsChecks;
|
||||
function setSearxRedirectsChecks(val) {
|
||||
searxRedirectsChecks = val;
|
||||
browser.storage.sync.set({ searxRedirectsChecks })
|
||||
console.log("searxRedirectsChecks: ", val)
|
||||
let whoogleNormalCustomRedirects = [];
|
||||
const getWhoogleNormalCustomRedirects = () => whoogleNormalCustomRedirects;
|
||||
function setWhoogleNormalCustomRedirects(val) {
|
||||
whoogleNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ whoogleNormalCustomRedirects })
|
||||
console.log("whoogleNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let searxCustomRedirects = [];
|
||||
const getSearxCustomRedirects = () => searxCustomRedirects;
|
||||
function setSearxCustomRedirects(val) {
|
||||
searxCustomRedirects = val;
|
||||
browser.storage.sync.set({ searxCustomRedirects })
|
||||
console.log("searxCustomRedirects: ", val)
|
||||
let whoogleTorCustomRedirects = [];
|
||||
const getWhoogleTorCustomRedirects = () => whoogleTorCustomRedirects;
|
||||
function setWhoogleTorCustomRedirects(val) {
|
||||
whoogleTorCustomRedirects = val;
|
||||
browser.storage.sync.set({ whoogleTorCustomRedirects })
|
||||
console.log("whoogleTorCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let searxNormalRedirectsChecks;
|
||||
const getSearxNormalRedirectsChecks = () => searxNormalRedirectsChecks;
|
||||
function setSearxNormalRedirectsChecks(val) {
|
||||
searxNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ searxNormalRedirectsChecks })
|
||||
console.log("searxNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let searxTorRedirectsChecks;
|
||||
const getSearxTorRedirectsChecks = () => searxTorRedirectsChecks;
|
||||
function setSearxTorRedirectsChecks(val) {
|
||||
searxTorRedirectsChecks = val;
|
||||
browser.storage.sync.set({ searxTorRedirectsChecks })
|
||||
console.log("searxTorRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let searxNormalCustomRedirects = [];
|
||||
const getSearxNormalCustomRedirects = () => searxNormalCustomRedirects;
|
||||
function setSearxNormalCustomRedirects(val) {
|
||||
searxNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ searxNormalCustomRedirects })
|
||||
console.log("searxNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let searxTorCustomRedirects = [];
|
||||
const getSearxTorCustomRedirects = () => searxTorCustomRedirects;
|
||||
function setSearxTorCustomRedirects(val) {
|
||||
searxTorCustomRedirects = val;
|
||||
browser.storage.sync.set({ searxTorCustomRedirects })
|
||||
console.log("searxTorCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -218,6 +145,14 @@ function setFrontend(val) {
|
|||
console.log("searchFrontend: ", frontend)
|
||||
};
|
||||
|
||||
let protocol;
|
||||
const getprotocol = () => protocol;
|
||||
function setProtocol(val) {
|
||||
protocol = val;
|
||||
browser.storage.sync.set({ searchProtocol: val })
|
||||
console.log("searchProtocol: ", val)
|
||||
}
|
||||
|
||||
function isSearch(url, initiator) {
|
||||
if (disable) return false;
|
||||
return targets.some((rx) => rx.test(url.href));
|
||||
|
@ -227,13 +162,17 @@ function redirect(url) {
|
|||
let randomInstance;
|
||||
let path;
|
||||
if (frontend == 'searx') {
|
||||
let instancesList = [...searxRedirectsChecks, ...searxCustomRedirects];
|
||||
let instancesList;
|
||||
if (protocol == 'normal') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
path = "/";
|
||||
}
|
||||
if (frontend == 'whoogle') {
|
||||
let instancesList = [...whoogleRedirectsChecks, ...whoogleCustomRedirects];
|
||||
let instancesList
|
||||
if (protocol == 'normal') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects];
|
||||
if (protocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
path = "/search";
|
||||
|
@ -249,32 +188,55 @@ function redirect(url) {
|
|||
|
||||
async function init() {
|
||||
return new Promise((resolve) => {
|
||||
browser.storage.sync.get(
|
||||
[
|
||||
"disableSearch",
|
||||
"searchFrontend",
|
||||
"searchRedirects",
|
||||
"whoogleRedirectsChecks",
|
||||
"whoogleCustomRedirects",
|
||||
"searxRedirectsChecks",
|
||||
"searxCustomRedirects",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableSearch ?? false;
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
browser.storage.sync.get(
|
||||
[
|
||||
"disableSearch",
|
||||
"searchFrontend",
|
||||
"searchRedirects",
|
||||
|
||||
frontend = result.searchFrontend ?? 'searx';
|
||||
"whoogleNormalRedirectsChecks",
|
||||
"whoogleNormalCustomRedirects",
|
||||
|
||||
"whoogleTorRedirectsChecks",
|
||||
"whoogleTorCustomRedirects",
|
||||
|
||||
if (result.searchRedirects) redirects = result.searchRedirects;
|
||||
"searxNormalRedirectsChecks",
|
||||
"searxNormalCustomRedirects",
|
||||
|
||||
"searxTorRedirectsChecks",
|
||||
"searxTorCustomRedirects",
|
||||
|
||||
whoogleRedirectsChecks = result.whoogleRedirectsChecks ?? [...redirects.whoogle.normal];
|
||||
whoogleCustomRedirects = result.whoogleCustomRedirects ?? [];
|
||||
"searchProtocol",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableSearch ?? false;
|
||||
|
||||
searxRedirectsChecks = result.searxRedirectsChecks ?? [...redirects.searx.normal];
|
||||
searxCustomRedirects = result.searxCustomRedirects ?? [];
|
||||
protocol = result.searchProtocol ?? 'normal';
|
||||
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
frontend = result.searchFrontend ?? 'searx';
|
||||
|
||||
redirects.searx = dataJson.searx;
|
||||
redirects.whoogle = dataJson.whoogle;
|
||||
if (result.searchRedirects) redirects = result.searchRedirects;
|
||||
|
||||
whoogleNormalRedirectsChecks = result.whoogleNormalRedirectsChecks ?? [...redirects.whoogle.normal];
|
||||
whoogleNormalCustomRedirects = result.whoogleNormalCustomRedirects ?? [];
|
||||
|
||||
whoogleTorRedirectsChecks = result.whoogleTorRedirectsChecks ?? [...redirects.whoogle.tor];
|
||||
whoogleTorCustomRedirects = result.whoogleTorCustomRedirects ?? [];
|
||||
|
||||
searxNormalRedirectsChecks = result.searxNormalRedirectsChecks ?? [...redirects.searx.normal];
|
||||
searxNormalCustomRedirects = result.searxNormalCustomRedirects ?? [];
|
||||
|
||||
searxTorRedirectsChecks = result.searxTorRedirectsChecks ?? [...redirects.searx.tor];
|
||||
searxTorCustomRedirects = result.searxTorCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -292,17 +254,28 @@ export default {
|
|||
getFrontend,
|
||||
setFrontend,
|
||||
|
||||
getWhoogleRedirectsChecks,
|
||||
setWhoogleRedirectsChecks,
|
||||
getWhoogleNormalRedirectsChecks,
|
||||
setWhoogleNormalRedirectsChecks,
|
||||
getWhoogleNormalCustomRedirects,
|
||||
setWhoogleNormalCustomRedirects,
|
||||
|
||||
getWhoogleCustomRedirects,
|
||||
setWhoogleCustomRedirects,
|
||||
getWhoogleTorRedirectsChecks,
|
||||
setWhoogleTorRedirectsChecks,
|
||||
getWhoogleTorCustomRedirects,
|
||||
setWhoogleTorCustomRedirects,
|
||||
|
||||
getSearxRedirectsChecks,
|
||||
setSearxRedirectsChecks,
|
||||
getSearxNormalRedirectsChecks,
|
||||
setSearxNormalRedirectsChecks,
|
||||
getSearxNormalCustomRedirects,
|
||||
setSearxNormalCustomRedirects,
|
||||
|
||||
getSearxCustomRedirects,
|
||||
setSearxCustomRedirects,
|
||||
getSearxTorRedirectsChecks,
|
||||
setSearxTorRedirectsChecks,
|
||||
getSearxTorCustomRedirects,
|
||||
setSearxTorCustomRedirects,
|
||||
|
||||
getprotocol,
|
||||
setProtocol,
|
||||
|
||||
redirect,
|
||||
init,
|
||||
|
|
|
@ -18,7 +18,7 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"proxiTok": {
|
||||
"normal": [...proxiTokRedirectsChecks, ...proxiTokCustomRedirects]
|
||||
"normal": [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -27,28 +27,28 @@ function setRedirects(val) {
|
|||
redirects.proxiTok = val;
|
||||
browser.storage.sync.set({ tiktokRedirects: redirects })
|
||||
console.log("tiktokRedirects: ", val)
|
||||
for (const item of proxiTokRedirectsChecks)
|
||||
for (const item of proxiTokNormalRedirectsChecks)
|
||||
if (!redirects.proxiTok.normal.includes(item)) {
|
||||
var index = proxiTokRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) proxiTokRedirectsChecks.splice(index, 1);
|
||||
var index = proxiTokNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) proxiTokNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setProxiTokRedirectsChecks(proxiTokRedirectsChecks);
|
||||
setProxiTokNormalRedirectsChecks(proxiTokNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let proxiTokRedirectsChecks;
|
||||
const getProxiTokRedirectsChecks = () => proxiTokRedirectsChecks;
|
||||
function setProxiTokRedirectsChecks(val) {
|
||||
proxiTokRedirectsChecks = val;
|
||||
browser.storage.sync.set({ proxiTokRedirectsChecks })
|
||||
console.log("proxiTokRedirectsChecks: ", val)
|
||||
let proxiTokNormalRedirectsChecks;
|
||||
const getProxiTokNormalRedirectsChecks = () => proxiTokNormalRedirectsChecks;
|
||||
function setProxiTokNormalRedirectsChecks(val) {
|
||||
proxiTokNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ proxiTokNormalRedirectsChecks })
|
||||
console.log("proxiTokNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let proxiTokCustomRedirects = [];
|
||||
const getProxiTokCustomRedirects = () => proxiTokCustomRedirects;
|
||||
function setProxiTokCustomRedirects(val) {
|
||||
proxiTokCustomRedirects = val;
|
||||
browser.storage.sync.set({ proxiTokCustomRedirects })
|
||||
console.log("proxiTokCustomRedirects: ", val)
|
||||
let proxiTokNormalCustomRedirects = [];
|
||||
const getProxiTokNormalCustomRedirects = () => proxiTokNormalCustomRedirects;
|
||||
function setProxiTokNormalCustomRedirects(val) {
|
||||
proxiTokNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ proxiTokNormalCustomRedirects })
|
||||
console.log("proxiTokNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -60,7 +60,7 @@ function setDisable(val) {
|
|||
|
||||
function isTiktok(url, initiator) {
|
||||
if (disable) return false;
|
||||
if (initiator && ([...redirects.proxiTok.normal, ...proxiTokCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))) return false;
|
||||
if (initiator && ([...redirects.proxiTok.normal, ...proxiTokNormalCustomRedirects].includes(initiator.origin) || targets.includes(initiator.host))) return false;
|
||||
return targets.some((rx) => rx.test(url.href));
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ function redirect(url, type) {
|
|||
|
||||
if (type != "main_frame" && "sub_frame" && "xmlhttprequest") return null;
|
||||
|
||||
let instancesList = [...proxiTokRedirectsChecks, ...proxiTokCustomRedirects];
|
||||
let instancesList = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList);
|
||||
|
||||
|
@ -85,16 +85,16 @@ async function init() {
|
|||
[
|
||||
"disableTiktok",
|
||||
"tiktokRedirects",
|
||||
"proxiTokRedirectsChecks",
|
||||
"proxiTokCustomRedirects",
|
||||
"proxiTokNormalRedirectsChecks",
|
||||
"proxiTokNormalCustomRedirects",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableTiktok ?? false;
|
||||
|
||||
if (result.tiktokRedirects) redirects = result.tiktokRedirects;
|
||||
|
||||
proxiTokRedirectsChecks = result.proxiTokRedirectsChecks ?? [...redirects.proxiTok.normal];
|
||||
proxiTokCustomRedirects = result.proxiTokCustomRedirects ?? [];
|
||||
proxiTokNormalRedirectsChecks = result.proxiTokNormalRedirectsChecks ?? [...redirects.proxiTok.normal];
|
||||
proxiTokNormalCustomRedirects = result.proxiTokNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -111,11 +111,11 @@ export default {
|
|||
getDisable,
|
||||
setDisable,
|
||||
|
||||
getProxiTokRedirectsChecks,
|
||||
setProxiTokRedirectsChecks,
|
||||
getProxiTokNormalRedirectsChecks,
|
||||
setProxiTokNormalRedirectsChecks,
|
||||
|
||||
getProxiTokCustomRedirects,
|
||||
setProxiTokCustomRedirects,
|
||||
getProxiTokNormalCustomRedirects,
|
||||
setProxiTokNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
isTiktok,
|
||||
|
|
|
@ -42,10 +42,10 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"simplyTranslate": {
|
||||
"normal": [...simplyTranslateRedirectsChecks, ...simplyTranslateCustomRedirects]
|
||||
"normal": [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects]
|
||||
},
|
||||
"lingva": {
|
||||
"normal": [...lingvaRedirectsChecks, ...lingvaCustomRedirects]
|
||||
"normal": [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -54,56 +54,56 @@ function setSimplyTranslateRedirects(val) {
|
|||
redirects.simplyTranslate = val;
|
||||
browser.storage.sync.set({ translateRedirects: redirects })
|
||||
console.log("simplyTranslateRedirects:", val)
|
||||
for (const item of simplyTranslateRedirectsChecks)
|
||||
for (const item of simplyTranslateNormalRedirectsChecks)
|
||||
if (!redirects.simplyTranslate.normal.includes(item)) {
|
||||
var index = simplyTranslateRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) simplyTranslateRedirectsChecks.splice(index, 1);
|
||||
var index = simplyTranslateNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) simplyTranslateNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setSimplyTranslateRedirectsChecks(simplyTranslateRedirectsChecks);
|
||||
setSimplyTranslateNormalRedirectsChecks(simplyTranslateNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let simplyTranslateRedirectsChecks;
|
||||
const getSimplyTranslateRedirectsChecks = () => simplyTranslateRedirectsChecks;
|
||||
function setSimplyTranslateRedirectsChecks(val) {
|
||||
simplyTranslateRedirectsChecks = val;
|
||||
browser.storage.sync.set({ simplyTranslateRedirectsChecks })
|
||||
console.log("simplyTranslateRedirectsChecks: ", val)
|
||||
let simplyTranslateNormalRedirectsChecks;
|
||||
const getSimplyTranslateNormalRedirectsChecks = () => simplyTranslateNormalRedirectsChecks;
|
||||
function setSimplyTranslateNormalRedirectsChecks(val) {
|
||||
simplyTranslateNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ simplyTranslateNormalRedirectsChecks })
|
||||
console.log("simplyTranslateNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let simplyTranslateCustomRedirects = [];
|
||||
const getSimplyTranslateCustomRedirects = () => simplyTranslateCustomRedirects;
|
||||
function setSimplyTranslateCustomRedirects(val) {
|
||||
simplyTranslateCustomRedirects = val;
|
||||
browser.storage.sync.set({ simplyTranslateCustomRedirects })
|
||||
console.log("simplyTranslateCustomRedirects: ", val)
|
||||
let simplyTranslateNormalCustomRedirects = [];
|
||||
const getSimplyTranslateNormalCustomRedirects = () => simplyTranslateNormalCustomRedirects;
|
||||
function setSimplyTranslateNormalCustomRedirects(val) {
|
||||
simplyTranslateNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ simplyTranslateNormalCustomRedirects })
|
||||
console.log("simplyTranslateNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
function setLingvaRedirects(val) {
|
||||
redirects.lingva = val;
|
||||
browser.storage.sync.set({ translateRedirects: redirects })
|
||||
console.log("lingvaRedirects:", val)
|
||||
for (const item of lingvaRedirectsChecks)
|
||||
for (const item of lingvaNormalRedirectsChecks)
|
||||
if (!redirects.lingva.normal.includes(item)) {
|
||||
var index = lingvaRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) lingvaRedirectsChecks.splice(index, 1);
|
||||
var index = lingvaNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) lingvaNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setLingvaRedirectsChecks(lingvaRedirectsChecks);
|
||||
setLingvaNormalRedirectsChecks(lingvaNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let lingvaRedirectsChecks;
|
||||
const getLingvaRedirectsChecks = () => lingvaRedirectsChecks;
|
||||
function setLingvaRedirectsChecks(val) {
|
||||
lingvaRedirectsChecks = val;
|
||||
browser.storage.sync.set({ lingvaRedirectsChecks })
|
||||
console.log("lingvaRedirectsChecks: ", val)
|
||||
let lingvaNormalRedirectsChecks;
|
||||
const getLingvaNormalRedirectsChecks = () => lingvaNormalRedirectsChecks;
|
||||
function setLingvaNormalRedirectsChecks(val) {
|
||||
lingvaNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ lingvaNormalRedirectsChecks })
|
||||
console.log("lingvaNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let lingvaCustomRedirects = [];
|
||||
const getLingvaCustomRedirects = () => lingvaCustomRedirects;
|
||||
function setLingvaCustomRedirects(val) {
|
||||
lingvaCustomRedirects = val;
|
||||
browser.storage.sync.set({ lingvaCustomRedirects })
|
||||
console.log("lingvaCustomRedirects: ", val)
|
||||
let lingvaNormalCustomRedirects = [];
|
||||
const getLingvaNormalCustomRedirects = () => lingvaNormalCustomRedirects;
|
||||
function setLingvaNormalCustomRedirects(val) {
|
||||
lingvaNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ lingvaNormalCustomRedirects })
|
||||
console.log("lingvaNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -152,7 +152,7 @@ function redirect(url) {
|
|||
myMap[pair[0]] = pair[1];
|
||||
}
|
||||
if (frontend == 'simplyTranslate') {
|
||||
let instancesList = [...simplyTranslateRedirectsChecks, ...simplyTranslateCustomRedirects];
|
||||
let instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -162,7 +162,7 @@ function redirect(url) {
|
|||
return `${randomInstance}/?sl=${from}&tl=${to}`
|
||||
}
|
||||
else if (frontend == 'lingva') {
|
||||
let instancesList = [...lingvaRedirectsChecks, ...lingvaCustomRedirects];
|
||||
let instancesList = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -180,10 +180,10 @@ async function init() {
|
|||
"translateDisable",
|
||||
"translateFrontend",
|
||||
"translateRedirects",
|
||||
"simplyTranslateRedirectsChecks",
|
||||
"simplyTranslateCustomRedirects",
|
||||
"lingvaRedirectsChecks",
|
||||
"lingvaCustomRedirects",
|
||||
"simplyTranslateNormalRedirectsChecks",
|
||||
"simplyTranslateNormalCustomRedirects",
|
||||
"lingvaNormalRedirectsChecks",
|
||||
"lingvaNormalCustomRedirects",
|
||||
"translateFrom",
|
||||
"translateTo",
|
||||
],
|
||||
|
@ -196,11 +196,11 @@ async function init() {
|
|||
|
||||
if (result.translateRedirects) redirects = result.translateRedirects
|
||||
|
||||
simplyTranslateRedirectsChecks = result.simplyTranslateRedirectsChecks ?? [...redirects.simplyTranslate.normal];
|
||||
simplyTranslateCustomRedirects = result.simplyTranslateCustomRedirects ?? [];
|
||||
simplyTranslateNormalRedirectsChecks = result.simplyTranslateNormalRedirectsChecks ?? [...redirects.simplyTranslate.normal];
|
||||
simplyTranslateNormalCustomRedirects = result.simplyTranslateNormalCustomRedirects ?? [];
|
||||
|
||||
lingvaRedirectsChecks = result.lingvaRedirectsChecks ?? [...redirects.lingva.normal];
|
||||
lingvaCustomRedirects = result.lingvaCustomRedirects ?? [];
|
||||
lingvaNormalRedirectsChecks = result.lingvaNormalRedirectsChecks ?? [...redirects.lingva.normal];
|
||||
lingvaNormalCustomRedirects = result.lingvaNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
});
|
||||
|
@ -227,17 +227,17 @@ export default {
|
|||
getTo,
|
||||
setTo,
|
||||
|
||||
getSimplyTranslateRedirectsChecks,
|
||||
setSimplyTranslateRedirectsChecks,
|
||||
getSimplyTranslateNormalRedirectsChecks,
|
||||
setSimplyTranslateNormalRedirectsChecks,
|
||||
|
||||
getSimplyTranslateCustomRedirects,
|
||||
setSimplyTranslateCustomRedirects,
|
||||
getSimplyTranslateNormalCustomRedirects,
|
||||
setSimplyTranslateNormalCustomRedirects,
|
||||
|
||||
getLingvaRedirectsChecks,
|
||||
setLingvaRedirectsChecks,
|
||||
getLingvaNormalRedirectsChecks,
|
||||
setLingvaNormalRedirectsChecks,
|
||||
|
||||
getLingvaCustomRedirects,
|
||||
setLingvaCustomRedirects,
|
||||
getLingvaNormalCustomRedirects,
|
||||
setLingvaNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
init,
|
||||
|
|
|
@ -2,11 +2,6 @@ window.browser = window.browser || window.chrome;
|
|||
|
||||
import commonHelper from './common.js'
|
||||
|
||||
/*
|
||||
Please remember to also update the src/manifest.json file
|
||||
(content_scripts > matches, 'remove-twitter-sw.js')
|
||||
when updating this list:
|
||||
*/
|
||||
const targets = [
|
||||
"twitter.com",
|
||||
"www.twitter.com",
|
||||
|
@ -18,68 +13,8 @@ const targets = [
|
|||
|
||||
let redirects = {
|
||||
"nitter": {
|
||||
"normal": [
|
||||
"https://nitter.net",
|
||||
"https://nitter.42l.fr",
|
||||
"https://nitter.pussthecat.org",
|
||||
"https://nitter.nixnet.services",
|
||||
"https://nitter.fdn.fr",
|
||||
"https://nitter.1d4.us",
|
||||
"https://nitter.kavin.rocks",
|
||||
"https://nitter.unixfox.eu",
|
||||
"https://nitter.domain.glass",
|
||||
"https://nitter.eu",
|
||||
"https://nitter.namazso.eu",
|
||||
"https://nitter.actionsack.com",
|
||||
"https://birdsite.xanny.family",
|
||||
"https://nitter.hu",
|
||||
"https://twitr.gq",
|
||||
"https://nitter.moomoo.me",
|
||||
"https://nittereu.moomoo.me",
|
||||
"https://bird.trom.tf",
|
||||
"https://nitter.it",
|
||||
"https://twitter.censors.us",
|
||||
"https://nitter.grimneko.de",
|
||||
"https://nitter.alefvanoon.xyz",
|
||||
"https://n.hyperborea.cloud",
|
||||
"https://nitter.ca",
|
||||
"https://twitter.076.ne.jp",
|
||||
"https://nitter.mstdn.social",
|
||||
"https://nitter.fly.dev",
|
||||
"https://notabird.site",
|
||||
"https://nitter.weiler.rocks",
|
||||
"https://nitter.silkky.cloud",
|
||||
"https://nitter.sethforprivacy.com",
|
||||
"https://nttr.stream",
|
||||
"https://nitter.cutelab.space",
|
||||
"https://nitter.nl",
|
||||
"https://nitter.mint.lgbt",
|
||||
"https://nitter.tokhmi.xyz",
|
||||
"https://nitter.bus-hit.me",
|
||||
"https://fuckthesacklers.network",
|
||||
"https://nitter.govt.land",
|
||||
"https://nitter.datatunnel.xyz",
|
||||
"https://nitter.esmailelbob.xyz",
|
||||
"https://tw.artemislena.eu",
|
||||
"https://nitter.eu.org"
|
||||
],
|
||||
"tor": [
|
||||
"http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion",
|
||||
"http://nitter.l4qlywnpwqsluw65ts7md3khrivpirse744un3x7mlskqauz5pyuzgqd.onion",
|
||||
"http://nitter7bryz3jv7e3uekphigvmoyoem4al3fynerxkj22dmoxoq553qd.onion",
|
||||
"http://npf37k3mtzwxreiw52ccs5ay4e6qt2fkcs2ndieurdyn2cuzzsfyfvid.onion",
|
||||
"http://nitter.v6vgyqpa7yefkorazmg5d5fimstmvm2vtbirt6676mt7qmllrcnwycqd.onion",
|
||||
"http://i23nv6w3juvzlw32xzoxcqzktegd4i4fu3nmnc2ewv4ggiu4ledwklad.onion",
|
||||
"http://26oq3gioiwcmfojub37nz5gzbkdiqp7fue5kvye7d4txv4ny6fb4wwid.onion",
|
||||
"http://vfaomgh4jxphpbdfizkm5gbtjahmei234giqj4facbwhrfjtcldauqad.onion",
|
||||
"http://iwgu3cv7ywf3gssed5iqtavmrlszgsxazkmwwnt4h2kdait75thdyrqd.onion",
|
||||
"http://erpnncl5nhyji3c32dcfmztujtl3xaddqb457jsbkulq24zqq7ifdgad.onion",
|
||||
"http://ckzuw5misyahmg7j5t5xwwuj3bwy62jfolxyux4brfflramzsvvd3syd.onion",
|
||||
"http://jebqj47jgxleaiosfcxfibx2xdahjettuydlxbg64azd4khsxv6kawid.onion",
|
||||
"http://nttr2iupbb6fazdpr2rgbooon2tzbbsvvkagkgkwohhodjzj43stxhad.onion",
|
||||
"http://nitraeju2mipeziu2wtcrqsxg7h62v5y4eqgwi75uprynkj74gevvuqd.onion",
|
||||
"http://nitter.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion"
|
||||
]
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
};
|
||||
const getRedirects = () => redirects;
|
||||
|
@ -87,7 +22,8 @@ const getRedirects = () => redirects;
|
|||
function getCustomRedirects() {
|
||||
return {
|
||||
"nitter": {
|
||||
"normal": [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects]
|
||||
"normal": [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects],
|
||||
"tor": [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -98,10 +34,17 @@ function setRedirects(val) {
|
|||
console.log("twitterRedirects:", val)
|
||||
for (const item of nitterNormalRedirectsChecks)
|
||||
if (!redirects.nitter.normal.includes(item)) {
|
||||
var index = nitterRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) nitterRedirectsChecks.splice(index, 1);
|
||||
var index = nitterNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) nitterNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setNitterRedirectsChecks(nitterRedirectsChecks);
|
||||
setNitterNormalRedirectsChecks(nitterNormalRedirectsChecks);
|
||||
|
||||
for (const item of nitterTorRedirectsChecks)
|
||||
if (!redirects.nitter.tor.includes(item)) {
|
||||
var index = nitterTorRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) nitterTorRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setNitterTorRedirectsChecks(nitterTorRedirectsChecks);
|
||||
}
|
||||
|
||||
let nitterNormalRedirectsChecks;
|
||||
|
@ -191,33 +134,37 @@ function redirect(url) {
|
|||
|
||||
async function init() {
|
||||
return new Promise((resolve) => {
|
||||
browser.storage.sync.get(
|
||||
[
|
||||
"disableTwitter",
|
||||
"twitterRedirects",
|
||||
"nitterNormalRedirectsChecks",
|
||||
"nitterNormalCustomRedirects",
|
||||
"nitterTorRedirectsChecks",
|
||||
"nitterTorCustomRedirects",
|
||||
"nitterProtocol",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableTwitter ?? false;
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
browser.storage.sync.get(
|
||||
[
|
||||
"disableTwitter",
|
||||
"twitterRedirects",
|
||||
"nitterNormalRedirectsChecks",
|
||||
"nitterNormalCustomRedirects",
|
||||
"nitterTorRedirectsChecks",
|
||||
"nitterTorCustomRedirects",
|
||||
"nitterProtocol",
|
||||
],
|
||||
(result) => {
|
||||
disable = result.disableTwitter ?? false;
|
||||
|
||||
if (result.twitterRedirects) redirects = result.twitterRedirects;
|
||||
redirects.nitter = dataJson.nitter;
|
||||
if (result.twitterRedirects) redirects = result.twitterRedirects;
|
||||
|
||||
nitterNormalRedirectsChecks = result.nitterNormalRedirectsChecks ?? [...redirects.nitter.normal];
|
||||
nitterNormalCustomRedirects = result.nitterNormalCustomRedirects ?? [];
|
||||
nitterNormalRedirectsChecks = result.nitterNormalRedirectsChecks ?? [...redirects.nitter.normal];
|
||||
nitterNormalCustomRedirects = result.nitterNormalCustomRedirects ?? [];
|
||||
|
||||
nitterTorRedirectsChecks = result.nitterTorRedirectsChecks ?? [...redirects.nitter.tor];
|
||||
nitterTorCustomRedirects = result.nitterTorCustomRedirects ?? [];
|
||||
nitterTorRedirectsChecks = result.nitterTorRedirectsChecks ?? [...redirects.nitter.tor];
|
||||
nitterTorCustomRedirects = result.nitterTorCustomRedirects ?? [];
|
||||
|
||||
protocol = result.nitterProtocol ?? "normal";
|
||||
protocol = result.nitterProtocol ?? "normal";
|
||||
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
})
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -21,7 +21,7 @@ const getRedirects = () => redirects;
|
|||
const getCustomRedirects = function () {
|
||||
return {
|
||||
"wikiless": {
|
||||
"normal": [...wikilessRedirectsChecks, ...wikilessCustomRedirects]
|
||||
"normal": [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -29,12 +29,12 @@ function setRedirects(val) {
|
|||
redirects.wikiless = val;
|
||||
browser.storage.sync.set({ wikipediaRedirects: redirects })
|
||||
console.log("wikipediaRedirects: ", val)
|
||||
for (const item of wikilessRedirectsChecks)
|
||||
for (const item of wikilessNormalRedirectsChecks)
|
||||
if (!redirects.wikiless.normal.includes(item)) {
|
||||
var index = wikilessRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) wikilessRedirectsChecks.splice(index, 1);
|
||||
var index = wikilessNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) wikilessNormalRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
setWikilessRedirectsChecks(wikilessRedirectsChecks);
|
||||
setWikilessNormalRedirectsChecks(wikilessNormalRedirectsChecks);
|
||||
}
|
||||
|
||||
let disable;
|
||||
|
@ -44,20 +44,20 @@ function setDisable(val) {
|
|||
browser.storage.sync.set({ disableWikipedia: disable })
|
||||
}
|
||||
|
||||
let wikilessRedirectsChecks;
|
||||
const getWikilessRedirectsChecks = () => wikilessRedirectsChecks;
|
||||
function setWikilessRedirectsChecks(val) {
|
||||
wikilessRedirectsChecks = val;
|
||||
browser.storage.sync.set({ wikilessRedirectsChecks })
|
||||
console.log("wikilessRedirectsChecks: ", val)
|
||||
let wikilessNormalRedirectsChecks;
|
||||
const getWikilessNormalRedirectsChecks = () => wikilessNormalRedirectsChecks;
|
||||
function setWikilessNormalRedirectsChecks(val) {
|
||||
wikilessNormalRedirectsChecks = val;
|
||||
browser.storage.sync.set({ wikilessNormalRedirectsChecks })
|
||||
console.log("wikilessNormalRedirectsChecks: ", val)
|
||||
}
|
||||
|
||||
let wikilessCustomRedirects = [];
|
||||
const getWikilessCustomRedirects = () => wikilessCustomRedirects;
|
||||
function setWikilessCustomRedirects(val) {
|
||||
wikilessCustomRedirects = val;
|
||||
browser.storage.sync.set({ wikilessCustomRedirects })
|
||||
console.log("wikilessCustomRedirects: ", val)
|
||||
let wikilessNormalCustomRedirects = [];
|
||||
const getWikilessNormalCustomRedirects = () => wikilessNormalCustomRedirects;
|
||||
function setWikilessNormalCustomRedirects(val) {
|
||||
wikilessNormalCustomRedirects = val;
|
||||
browser.storage.sync.set({ wikilessNormalCustomRedirects })
|
||||
console.log("wikilessNormalCustomRedirects: ", val)
|
||||
}
|
||||
|
||||
function isWikipedia(url, initiator) {
|
||||
|
@ -76,7 +76,7 @@ function redirect(url) {
|
|||
}
|
||||
}
|
||||
|
||||
let instancesList = [...wikilessRedirectsChecks, ...wikilessCustomRedirects];
|
||||
let instancesList = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
if (instancesList.length === 0) return null;
|
||||
let randomInstance = commonHelper.getRandomInstance(instancesList)
|
||||
|
||||
|
@ -104,15 +104,15 @@ async function init() {
|
|||
[
|
||||
"disableWikipedia",
|
||||
"wikipediaRedirects",
|
||||
"wikilessRedirectsChecks",
|
||||
"wikilessCustomRedirects",
|
||||
"wikilessNormalRedirectsChecks",
|
||||
"wikilessNormalCustomRedirects",
|
||||
], (result) => {
|
||||
disable = result.disableWikipedia ?? false;
|
||||
|
||||
if (result.wikipediaRedirects) redirects = result.wikipediaRedirects;
|
||||
|
||||
wikilessRedirectsChecks = result.wikilessRedirectsChecks ?? [...redirects.wikiless.normal];
|
||||
wikilessCustomRedirects = result.wikilessCustomRedirects ?? [];
|
||||
wikilessNormalRedirectsChecks = result.wikilessNormalRedirectsChecks ?? [...redirects.wikiless.normal];
|
||||
wikilessNormalCustomRedirects = result.wikilessNormalCustomRedirects ?? [];
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
@ -128,11 +128,11 @@ export default {
|
|||
setDisable,
|
||||
getDisable,
|
||||
|
||||
getWikilessRedirectsChecks,
|
||||
setWikilessRedirectsChecks,
|
||||
getWikilessNormalRedirectsChecks,
|
||||
setWikilessNormalRedirectsChecks,
|
||||
|
||||
getWikilessCustomRedirects,
|
||||
setWikilessCustomRedirects,
|
||||
getWikilessNormalCustomRedirects,
|
||||
setWikilessNormalCustomRedirects,
|
||||
|
||||
redirect,
|
||||
isWikipedia,
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
"https://tube.cthd.icu",
|
||||
"https://invidious.flokinet.to",
|
||||
"https://yt.artemislena.eu",
|
||||
"https://invidious.privacy.gd",
|
||||
"https://youtube.076.ne.jp",
|
||||
"https://invidious.privacy.gd",
|
||||
"https://invidious.namazso.eu"
|
||||
],
|
||||
"tor": [
|
||||
|
@ -313,7 +313,8 @@
|
|||
"https://www.whooglesearch.ml",
|
||||
"https://whoogle.dcs0.hu",
|
||||
"https://whoogle.esmailelbob.xyz"
|
||||
]
|
||||
],
|
||||
"tor": []
|
||||
},
|
||||
"rimgo": {
|
||||
"normal": [
|
||||
|
|
|
@ -22,7 +22,7 @@ invidiousList['tor'] = []
|
|||
for instance in rJson:
|
||||
if instance[1]['type'] == 'https':
|
||||
invidiousList['normal'].append(instance[1]['uri'])
|
||||
elif instance[1]['type'] == 'tor':
|
||||
elif instance[1]['type'] == 'onion':
|
||||
invidiousList['tor'].append(instance[1]['uri'])
|
||||
mightyList['invidious'] = invidiousList
|
||||
print('fetched Invidious')
|
||||
|
@ -76,8 +76,8 @@ for item in rJson:
|
|||
url = item['url']
|
||||
if url != '':
|
||||
tedditList['normal'].append(url)
|
||||
if 'tor' in item:
|
||||
onion = item['tor']
|
||||
if 'onion' in item:
|
||||
onion = item['onion']
|
||||
if onion != '':
|
||||
tedditList['tor'].append(onion)
|
||||
|
||||
|
@ -163,6 +163,7 @@ r = requests.get(
|
|||
tmpList = r.text.strip().split('\n')
|
||||
whoogleList = {}
|
||||
whoogleList['normal'] = []
|
||||
whoogleList['tor'] = []
|
||||
for item in tmpList:
|
||||
whoogleList['normal'].append(item)
|
||||
mightyList['whoogle'] = whoogleList
|
||||
|
@ -188,7 +189,7 @@ print('fetched Rimgo')
|
|||
|
||||
# Writing to file
|
||||
json_object = json.dumps(mightyList, ensure_ascii=False, indent=2)
|
||||
with open('src/instances/data.json', 'w') as outfile:
|
||||
with open('./src/instances/data.json', 'w') as outfile:
|
||||
outfile.write(json_object)
|
||||
# print(json_object)
|
||||
print('wrote instances/data.json')
|
||||
|
|
|
@ -118,15 +118,15 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="rimgo-checklist"></div>
|
||||
<div class="checklist" id="rimgo-normal-checklist"></div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-rimgo-instance-form">
|
||||
<form id="custom-rimgo-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="rimgo-custom-instance" placeholder="https://rimgo.com" type="url" />
|
||||
<button type="submit" class="add" id="rimgo-add-instance">
|
||||
<input id="rimgo-normal-custom-instance" placeholder="https://rimgo.com" type="url" />
|
||||
<button type="submit" class="add" id="rimgo-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -135,7 +135,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="rimgo-custom-checklist"></div>
|
||||
<div class="checklist" id="rimgo-normal-custom-checklist"></div>
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ imgurHelper.init().then(() => {
|
|||
'normal',
|
||||
imgurHelper,
|
||||
document,
|
||||
imgurHelper.getRimgoRedirectsChecks,
|
||||
imgurHelper.setRimgoRedirectsChecks,
|
||||
imgurHelper.getRimgoCustomRedirects,
|
||||
imgurHelper.setRimgoCustomRedirects
|
||||
imgurHelper.getRimgoNormalRedirectsChecks,
|
||||
imgurHelper.setRimgoNormalRedirectsChecks,
|
||||
imgurHelper.getRimgoNormalCustomRedirects,
|
||||
imgurHelper.setRimgoNormalCustomRedirects
|
||||
)
|
||||
})
|
|
@ -119,15 +119,15 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="bibliogram-checklist"></div>
|
||||
<div class="checklist" id="bibliogram-normal-checklist"></div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-bibliogram-instance-form">
|
||||
<form id="custom-bibliogram-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="bibliogram-custom-instance" placeholder="https://bibliogram.com" type="url" />
|
||||
<button type="submit" class="add" id="bibliogram-add-instance">
|
||||
<input id="bibliogram-normal-custom-instance" placeholder="https://bibliogram.com" type="url" />
|
||||
<button type="submit" class="add" id="bibliogram-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -136,7 +136,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="bibliogram-custom-checklist"></div>
|
||||
<div class="checklist" id="bibliogram-normal-custom-checklist"></div>
|
||||
|
||||
</section>
|
||||
<script type="module" src="../init.js"></script>
|
||||
|
|
|
@ -14,9 +14,9 @@ instagramHelper.init().then(() => {
|
|||
'normal',
|
||||
instagramHelper,
|
||||
document,
|
||||
instagramHelper.getBibliogramRedirectsChecks,
|
||||
instagramHelper.setBibliogramRedirectsChecks,
|
||||
instagramHelper.getBibliogramCustomRedirects,
|
||||
instagramHelper.setBibliogramCustomRedirects
|
||||
instagramHelper.getBibliogramNormalRedirectsChecks,
|
||||
instagramHelper.setBibliogramNormalRedirectsChecks,
|
||||
instagramHelper.getBibliogramNormalCustomRedirects,
|
||||
instagramHelper.setBibliogramNormalCustomRedirects
|
||||
)
|
||||
})
|
|
@ -118,15 +118,15 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="scribe-checklist"></div>
|
||||
<div class="checklist" id="scribe-normal-checklist"></div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-scribe-instance-form">
|
||||
<form id="custom-scribe-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="scribe-custom-instance" placeholder="https://scribe.com" type="url" />
|
||||
<button type="submit" class="add" id="scribe-add-instance">
|
||||
<input id="scribe-normal-custom-instance" placeholder="https://scribe.com" type="url" />
|
||||
<button type="submit" class="add" id="scribe-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -135,7 +135,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="scribe-custom-checklist"></div>
|
||||
<div class="checklist" id="scribe-normal-custom-checklist"></div>
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ mediumHelper.init().then(() => {
|
|||
'normal',
|
||||
mediumHelper,
|
||||
document,
|
||||
mediumHelper.getScribeRedirectsChecks,
|
||||
mediumHelper.setScribeRedirectsChecks,
|
||||
mediumHelper.getScribeCustomRedirects,
|
||||
mediumHelper.setScribeCustomRedirects
|
||||
mediumHelper.getScribeNormalRedirectsChecks,
|
||||
mediumHelper.setScribeNormalRedirectsChecks,
|
||||
mediumHelper.getScribeNormalCustomRedirects,
|
||||
mediumHelper.setScribeNormalCustomRedirects
|
||||
)
|
||||
})
|
|
@ -136,16 +136,16 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="libreddit-checklist">
|
||||
<div class="checklist" id="libreddit-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-libreddit-instance-form">
|
||||
<form id="custom-libreddit-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="libreddit-custom-instance" placeholder="https://libreddit.com" type="url" />
|
||||
<button type="submit" class="add" id="libreddit-add-instance">
|
||||
<input id="libreddit-normal-custom-instance" placeholder="https://libreddit.com" type="url" />
|
||||
<button type="submit" class="add" id="libreddit-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -154,23 +154,23 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="libreddit-custom-checklist"></div>
|
||||
<div class="checklist" id="libreddit-normal-custom-checklist"></div>
|
||||
</div>
|
||||
|
||||
<div id="teddit">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="teddit-checklist">
|
||||
<div class="checklist" id="teddit-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-teddit-instance-form">
|
||||
<form id="custom-teddit-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="teddit-custom-instance" placeholder="https://teddit.com" type="url" />
|
||||
<button type="submit" class="add" id="teddit-add-instance">
|
||||
<input id="teddit-normal-custom-instance" placeholder="https://teddit.com" type="url" />
|
||||
<button type="submit" class="add" id="teddit-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -179,7 +179,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="teddit-custom-checklist"></div>
|
||||
<div class="checklist" id="teddit-normal-custom-checklist"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ redditHelper.init().then(() => {
|
|||
'normal',
|
||||
redditHelper,
|
||||
document,
|
||||
redditHelper.getLibredditRedirectsChecks,
|
||||
redditHelper.setLibredditRedirectsChecks,
|
||||
redditHelper.getLibredditCustomRedirects,
|
||||
redditHelper.setLibredditCustomRedirects
|
||||
redditHelper.getLibredditNormalRedirectsChecks,
|
||||
redditHelper.setLibredditNormalRedirectsChecks,
|
||||
redditHelper.getLibredditNormalCustomRedirects,
|
||||
redditHelper.setLibredditNormalCustomRedirects
|
||||
)
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
|
@ -51,10 +51,10 @@ redditHelper.init().then(() => {
|
|||
'normal',
|
||||
redditHelper,
|
||||
document,
|
||||
redditHelper.getTedditRedirectsChecks,
|
||||
redditHelper.setTedditRedirectsChecks,
|
||||
redditHelper.getTedditCustomRedirects,
|
||||
redditHelper.setTedditCustomRedirects
|
||||
redditHelper.getTedditNormalRedirectsChecks,
|
||||
redditHelper.setTedditNormalRedirectsChecks,
|
||||
redditHelper.getTedditNormalCustomRedirects,
|
||||
redditHelper.setTedditNormalCustomRedirects
|
||||
);
|
||||
|
||||
})
|
|
@ -2,181 +2,244 @@
|
|||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||
<title>LibRedirect Options: Search</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||
<title>LibRedirect Options: Search</title>
|
||||
</head>
|
||||
|
||||
<body class="option">
|
||||
<section class="links">
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z" />
|
||||
</svg>
|
||||
<a href="../general/general.html">General</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/youtube-icon.png" />
|
||||
<a href="../youtube/youtube.html">YouTube</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/twitter-icon.png" />
|
||||
<a href="../twitter/twitter.html">Twitter</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/instagram-icon.png" />
|
||||
<a href="../instagram/instagram.html">Instagram</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/tiktok-icon.png" />
|
||||
<a href="../tiktok/tiktok.html">TikTok</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/reddit-icon.png" />
|
||||
<a href="../reddit/reddit.html">Reddit</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/imgur-icon.png" />
|
||||
<a href="../imgur/imgur.html">Imgur</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<section class="links">
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z" />
|
||||
</svg>
|
||||
<a href="../general/general.html">General</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/youtube-icon.png" />
|
||||
<a href="../youtube/youtube.html">YouTube</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/twitter-icon.png" />
|
||||
<a href="../twitter/twitter.html">Twitter</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/instagram-icon.png" />
|
||||
<a href="../instagram/instagram.html">Instagram</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/tiktok-icon.png" />
|
||||
<a href="../tiktok/tiktok.html">TikTok</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/reddit-icon.png" />
|
||||
<a href="../reddit/reddit.html">Reddit</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="../../../assets/images/imgur-icon.png" />
|
||||
<a href="../imgur/imgur.html">Imgur</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path
|
||||
d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
|
||||
</svg>
|
||||
<a href="../search/search.html" class="selected">Search</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path
|
||||
d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" />
|
||||
</svg>
|
||||
<a href="../translate/translate.html">Translate</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path
|
||||
d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z" />
|
||||
</svg>
|
||||
<a href="../maps/maps.html">Maps</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24"
|
||||
width="24px" fill="currentColor">
|
||||
<g>
|
||||
<rect fill="none" height="24" width="24" />
|
||||
</g>
|
||||
<g>
|
||||
<g />
|
||||
<g>
|
||||
<path
|
||||
d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
|
||||
</svg>
|
||||
<a href="../search/search.html" class="selected">Search</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
d="M21,5c-1.11-0.35-2.33-0.5-3.5-0.5c-1.95,0-4.05,0.4-5.5,1.5c-1.45-1.1-3.55-1.5-5.5-1.5S2.45,4.9,1,6v14.65 c0,0.25,0.25,0.5,0.5,0.5c0.1,0,0.15-0.05,0.25-0.05C3.1,20.45,5.05,20,6.5,20c1.95,0,4.05,0.4,5.5,1.5c1.35-0.85,3.8-1.5,5.5-1.5 c1.65,0,3.35,0.3,4.75,1.05c0.1,0.05,0.15,0.05,0.25,0.05c0.25,0,0.5-0.25,0.5-0.5V6C22.4,5.55,21.75,5.25,21,5z M21,18.5 c-1.1-0.35-2.3-0.5-3.5-0.5c-1.7,0-4.15,0.65-5.5,1.5V8c1.35-0.85,3.8-1.5,5.5-1.5c1.2,0,2.4,0.15,3.5,0.5V18.5z" />
|
||||
<g>
|
||||
<path
|
||||
d="M17.5,10.5c0.88,0,1.73,0.09,2.5,0.26V9.24C19.21,9.09,18.36,9,17.5,9c-1.7,0-3.24,0.29-4.5,0.83v1.66 C14.13,10.85,15.7,10.5,17.5,10.5z" />
|
||||
<path
|
||||
d="M13,12.49v1.66c1.13-0.64,2.7-0.99,4.5-0.99c0.88,0,1.73,0.09,2.5,0.26V11.9c-0.79-0.15-1.64-0.24-2.5-0.24 C15.8,11.66,14.26,11.96,13,12.49z" />
|
||||
<path
|
||||
d="M17.5,14.33c-1.7,0-3.24,0.29-4.5,0.83v1.66c1.13-0.64,2.7-0.99,4.5-0.99c0.88,0,1.73,0.09,2.5,0.26v-1.52 C19.21,14.41,18.36,14.33,17.5,14.33z" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<a href="../wikipedia/wikipedia.html">Wikipedia</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24"
|
||||
width="24px" fill="currentColor">
|
||||
<g>
|
||||
<rect fill="none" height="24" width="24" />
|
||||
<g>
|
||||
<path
|
||||
d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" />
|
||||
</svg>
|
||||
<a href="../translate/translate.html">Translate</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path
|
||||
d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z" />
|
||||
</svg>
|
||||
<a href="../maps/maps.html">Maps</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24"
|
||||
width="24px" fill="currentColor">
|
||||
<g>
|
||||
<rect fill="none" height="24" width="24" />
|
||||
</g>
|
||||
<g>
|
||||
<g />
|
||||
<g>
|
||||
<path
|
||||
d="M21,5c-1.11-0.35-2.33-0.5-3.5-0.5c-1.95,0-4.05,0.4-5.5,1.5c-1.45-1.1-3.55-1.5-5.5-1.5S2.45,4.9,1,6v14.65 c0,0.25,0.25,0.5,0.5,0.5c0.1,0,0.15-0.05,0.25-0.05C3.1,20.45,5.05,20,6.5,20c1.95,0,4.05,0.4,5.5,1.5c1.35-0.85,3.8-1.5,5.5-1.5 c1.65,0,3.35,0.3,4.75,1.05c0.1,0.05,0.15,0.05,0.25,0.05c0.25,0,0.5-0.25,0.5-0.5V6C22.4,5.55,21.75,5.25,21,5z M21,18.5 c-1.1-0.35-2.3-0.5-3.5-0.5c-1.7,0-4.15,0.65-5.5,1.5V8c1.35-0.85,3.8-1.5,5.5-1.5c1.2,0,2.4,0.15,3.5,0.5V18.5z" />
|
||||
<g>
|
||||
<path
|
||||
d="M17.5,10.5c0.88,0,1.73,0.09,2.5,0.26V9.24C19.21,9.09,18.36,9,17.5,9c-1.7,0-3.24,0.29-4.5,0.83v1.66 C14.13,10.85,15.7,10.5,17.5,10.5z" />
|
||||
<path
|
||||
d="M13,12.49v1.66c1.13-0.64,2.7-0.99,4.5-0.99c0.88,0,1.73,0.09,2.5,0.26V11.9c-0.79-0.15-1.64-0.24-2.5-0.24 C15.8,11.66,14.26,11.96,13,12.49z" />
|
||||
<path
|
||||
d="M17.5,14.33c-1.7,0-3.24,0.29-4.5,0.83v1.66c1.13-0.64,2.7-0.99,4.5-0.99c0.88,0,1.73,0.09,2.5,0.26v-1.52 C19.21,14.41,18.36,14.33,17.5,14.33z" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<a href="../wikipedia/wikipedia.html">Wikipedia</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24"
|
||||
width="24px" fill="currentColor">
|
||||
<g>
|
||||
<rect fill="none" height="24" width="24" />
|
||||
<g>
|
||||
<path
|
||||
d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z" />
|
||||
</g>
|
||||
<path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z" />
|
||||
</g>
|
||||
</svg>
|
||||
<a href="../medium/medium.html">Medium</a>
|
||||
</div>
|
||||
</section>
|
||||
d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z" />
|
||||
</g>
|
||||
<path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z" />
|
||||
</g>
|
||||
</svg>
|
||||
<a href="../medium/medium.html">Medium</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="option-block">
|
||||
<section class="option-block">
|
||||
<div class="some-block option-block">
|
||||
<h4>Enable</h4>
|
||||
<input id="disable-search" type="checkbox" checked />
|
||||
</div>
|
||||
<div class="some-block option-block">
|
||||
<h4>Frontend</h4>
|
||||
<select id="search-frontend">
|
||||
<option value="searx">SearX</option>
|
||||
<option value="whoogle">Whoogle</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="some-block option-block">
|
||||
<h4>Protocol</h4>
|
||||
<select id="protocol">
|
||||
<option value="normal">Normal</option>
|
||||
<option value="tor">Tor</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div id="searx">
|
||||
<div id="searx-normal">
|
||||
<div class="some-block option-block">
|
||||
<h4>Enable</h4>
|
||||
<input id="disable-search" type="checkbox" checked />
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="some-block option-block">
|
||||
<h4>Frontend</h4>
|
||||
<select id="search-frontend">
|
||||
<option value="searx">SearX</option>
|
||||
<option value="whoogle">Whoogle</option>
|
||||
</select>
|
||||
<div class="checklist" id="searx-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div id="searx">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="searx-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-searx-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="searx-custom-instance" placeholder="https://searx.com" type="url" />
|
||||
<button type="submit" class="add" id="searx-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="searx-custom-checklist"></div>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
|
||||
<div id="whoogle">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="whoogle-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-whoogle-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="whoogle-custom-instance" placeholder="https://whoogle.com" type="url" />
|
||||
<button type="submit" class="add" id="whoogle-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="whoogle-custom-checklist"></div>
|
||||
<form id="custom-searx-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="searx-normal-custom-instance" placeholder="https://searx.com" type="url" />
|
||||
<button type="submit" class="add" id="searx-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="searx-normal-custom-checklist"></div>
|
||||
</div>
|
||||
<div id="searx-tor">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
</section>
|
||||
<div class="checklist" id="searx-tor-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-searx-tor-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="searx-tor-custom-instance" placeholder="https://searx.com" type="url" />
|
||||
<button type="submit" class="add" id="searx-tor-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="searx-tor-custom-checklist"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="whoogle">
|
||||
|
||||
<div id="whoogle-normal">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="whoogle-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-whoogle-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="whoogle-normal-custom-instance" placeholder="https://whoogle.com" type="url" />
|
||||
<button type="submit" class="add" id="whoogle-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="whoogle-normal-custom-checklist"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="whoogle-tor">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="whoogle-tor-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-whoogle-tor-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="whoogle-tor-custom-instance" placeholder="https://whoogle.com" type="url" />
|
||||
<button type="submit" class="add" id="whoogle-tor-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="whoogle-tor-custom-checklist"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<script type="module" src="../init.js"></script>
|
||||
<script type="module" src="../init.js"></script>
|
||||
<script type="module" src="./search.js"></script>
|
||||
<!-- <script src="../../assets/javascripts/localise.js"></script> -->
|
||||
<script type="module" src="../init.js"></script>
|
||||
<script type="module" src="./search.js"></script>
|
||||
<!-- <script src="../../assets/javascripts/localise.js"></script> -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
|
@ -30,31 +30,86 @@ searchFrontendElement.addEventListener("change",
|
|||
}
|
||||
);
|
||||
|
||||
let protocolElement = document.getElementById("protocol")
|
||||
protocolElement.addEventListener("change",
|
||||
(event) => {
|
||||
let protocol = event.target.options[protocolElement.selectedIndex].value
|
||||
searchHelper.setProtocol(protocol);
|
||||
changeProtocolSettings(protocol);
|
||||
}
|
||||
);
|
||||
|
||||
function changeProtocolSettings(protocol) {
|
||||
let normalsearxDiv = document.getElementById("searx-normal");
|
||||
let torsearxDiv = document.getElementById("searx-tor");
|
||||
|
||||
let normalwhoogleDiv = document.getElementById("whoogle-normal");
|
||||
let torwhoogleDiv = document.getElementById("whoogle-tor");
|
||||
if (protocol == 'normal') {
|
||||
normalsearxDiv.style.display = 'block';
|
||||
normalwhoogleDiv.style.display = 'block';
|
||||
torwhoogleDiv.style.display = 'none';
|
||||
torsearxDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol == 'tor') {
|
||||
normalsearxDiv.style.display = 'none';
|
||||
normalwhoogleDiv.style.display = 'none';
|
||||
torwhoogleDiv.style.display = 'block';
|
||||
torsearxDiv.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
searchHelper.init().then(() => {
|
||||
disableSearchElement.checked = !searchHelper.getDisable();
|
||||
let frontend = searchHelper.getFrontend();
|
||||
searchFrontendElement.value = frontend;
|
||||
changeFrontendsSettings(frontend);
|
||||
|
||||
let protocol = searchHelper.getprotocol();
|
||||
protocolElement.value = protocol;
|
||||
changeProtocolSettings(protocol);
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
'searx',
|
||||
'normal',
|
||||
searchHelper,
|
||||
document,
|
||||
searchHelper.getSearxRedirectsChecks,
|
||||
searchHelper.setSearxRedirectsChecks,
|
||||
searchHelper.getSearxCustomRedirects,
|
||||
searchHelper.setSearxCustomRedirects
|
||||
)
|
||||
searchHelper.getSearxNormalRedirectsChecks,
|
||||
searchHelper.setSearxNormalRedirectsChecks,
|
||||
searchHelper.getSearxNormalCustomRedirects,
|
||||
searchHelper.setSearxNormalCustomRedirects
|
||||
);
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
'searx',
|
||||
'tor',
|
||||
searchHelper,
|
||||
document,
|
||||
searchHelper.getSearxTorRedirectsChecks,
|
||||
searchHelper.setSearxTorRedirectsChecks,
|
||||
searchHelper.getSearxTorCustomRedirects,
|
||||
searchHelper.setSearxTorCustomRedirects
|
||||
);
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
'whoogle',
|
||||
'normal',
|
||||
searchHelper,
|
||||
document,
|
||||
searchHelper.getWhoogleRedirectsChecks,
|
||||
searchHelper.setWhoogleRedirectsChecks,
|
||||
searchHelper.getWhoogleCustomRedirects,
|
||||
searchHelper.setWhoogleCustomRedirects
|
||||
)
|
||||
searchHelper.getWhoogleNormalRedirectsChecks,
|
||||
searchHelper.setWhoogleNormalRedirectsChecks,
|
||||
searchHelper.getWhoogleNormalCustomRedirects,
|
||||
searchHelper.setWhoogleNormalCustomRedirects
|
||||
);
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
'whoogle',
|
||||
'tor',
|
||||
searchHelper,
|
||||
document,
|
||||
searchHelper.getWhoogleTorRedirectsChecks,
|
||||
searchHelper.setWhoogleTorRedirectsChecks,
|
||||
searchHelper.getWhoogleTorCustomRedirects,
|
||||
searchHelper.setWhoogleTorCustomRedirects
|
||||
);
|
||||
});
|
||||
|
|
|
@ -118,15 +118,15 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="proxiTok-checklist"></div>
|
||||
<div class="checklist" id="proxiTok-normal-checklist"></div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-proxiTok-instance-form">
|
||||
<form id="custom-proxiTok-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="proxiTok-custom-instance" placeholder="https://proxiTok.com" type="url" />
|
||||
<button type="submit" class="add" id="proxiTok-add-instance">
|
||||
<input id="proxiTok-normal-custom-instance" placeholder="https://proxiTok.com" type="url" />
|
||||
<button type="submit" class="add" id="proxiTok-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -135,7 +135,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="proxiTok-custom-checklist"></div>
|
||||
<div class="checklist" id="proxiTok-normal-custom-checklist"></div>
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ tiktokHelper.init().then(() => {
|
|||
'normal',
|
||||
tiktokHelper,
|
||||
document,
|
||||
tiktokHelper.getProxiTokRedirectsChecks,
|
||||
tiktokHelper.setProxiTokRedirectsChecks,
|
||||
tiktokHelper.getProxiTokCustomRedirects,
|
||||
tiktokHelper.setProxiTokCustomRedirects
|
||||
tiktokHelper.getProxiTokNormalRedirectsChecks,
|
||||
tiktokHelper.setProxiTokNormalRedirectsChecks,
|
||||
tiktokHelper.getProxiTokNormalCustomRedirects,
|
||||
tiktokHelper.setProxiTokNormalCustomRedirects
|
||||
)
|
||||
})
|
|
@ -357,16 +357,17 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="simplyTranslate-checklist">
|
||||
<div class="checklist" id="simplyTranslate-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-simplyTranslate-instance-form">
|
||||
<form id="custom-simplyTranslate-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="simplyTranslate-custom-instance" placeholder="https://simplyTranslate.com" type="url" />
|
||||
<button type="submit" class="add" id="simplyTranslate-add-instance">
|
||||
<input id="simplyTranslate-normal-custom-instance" placeholder="https://simplyTranslate.com"
|
||||
type="url" />
|
||||
<button type="submit" class="add" id="simplyTranslate-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -375,23 +376,23 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="simplyTranslate-custom-checklist"></div>
|
||||
<div class="checklist" id="simplyTranslate-normal-custom-checklist"></div>
|
||||
</div>
|
||||
|
||||
<div id="lingva">
|
||||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="lingva-checklist">
|
||||
<div class="checklist" id="lingva-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-lingva-instance-form">
|
||||
<form id="custom-lingva-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="lingva-custom-instance" placeholder="https://lingva.com" type="url" />
|
||||
<button type="submit" class="add" id="lingva-add-instance">
|
||||
<input id="lingva-normal-custom-instance" placeholder="https://lingva.com" type="url" />
|
||||
<button type="submit" class="add" id="lingva-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -400,7 +401,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="lingva-custom-checklist"></div>
|
||||
<div class="checklist" id="lingva-normal-custom-checklist"></div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
@ -410,4 +411,4 @@
|
|||
<!-- <script src="../../assets/javascripts/localise.js"></script> -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
|
@ -61,10 +61,10 @@ translateHelper.init().then(() => {
|
|||
'normal',
|
||||
translateHelper,
|
||||
document,
|
||||
translateHelper.getSimplyTranslateRedirectsChecks,
|
||||
translateHelper.setSimplyTranslateRedirectsChecks,
|
||||
translateHelper.getSimplyTranslateCustomRedirects,
|
||||
translateHelper.setSimplyTranslateCustomRedirects
|
||||
translateHelper.getSimplyTranslateNormalRedirectsChecks,
|
||||
translateHelper.setSimplyTranslateNormalRedirectsChecks,
|
||||
translateHelper.getSimplyTranslateNormalCustomRedirects,
|
||||
translateHelper.setSimplyTranslateNormalCustomRedirects
|
||||
)
|
||||
|
||||
commonHelper.processDefaultCustomInstances(
|
||||
|
@ -72,9 +72,9 @@ translateHelper.init().then(() => {
|
|||
'normal',
|
||||
translateHelper,
|
||||
document,
|
||||
translateHelper.getLingvaRedirectsChecks,
|
||||
translateHelper.setLingvaRedirectsChecks,
|
||||
translateHelper.getLingvaCustomRedirects,
|
||||
translateHelper.setLingvaCustomRedirects
|
||||
translateHelper.getLingvaNormalRedirectsChecks,
|
||||
translateHelper.setLingvaNormalRedirectsChecks,
|
||||
translateHelper.getLingvaNormalCustomRedirects,
|
||||
translateHelper.setLingvaNormalCustomRedirects
|
||||
)
|
||||
});
|
|
@ -117,16 +117,16 @@
|
|||
<div class="some-block option-block">
|
||||
<h4>Default Instances</h4>
|
||||
</div>
|
||||
<div class="checklist" id="wikiless-checklist">
|
||||
<div class="checklist" id="wikiless-normal-checklist">
|
||||
</div>
|
||||
<hr>
|
||||
<div class="some-block option-block">
|
||||
<h4>Custom Instances</h4>
|
||||
</div>
|
||||
<form id="custom-wikiless-instance-form">
|
||||
<form id="custom-wikiless-normal-instance-form">
|
||||
<div class="some-block option-block">
|
||||
<input id="wikiless-custom-instance" placeholder="https://wikiless.com" type="url" />
|
||||
<button type="submit" class="add" id="wikiless-add-instance">
|
||||
<input id="wikiless-normal-custom-instance" placeholder="https://wikiless.com" type="url" />
|
||||
<button type="submit" class="add" id="wikiless-normal-add-instance">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
|
||||
fill="currentColor">
|
||||
<path d="M0 0h24v24H0V0z" fill="none" />
|
||||
|
@ -135,7 +135,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="checklist" id="wikiless-custom-checklist"></div>
|
||||
<div class="checklist" id="wikiless-normal-custom-checklist"></div>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ wikipediaHelper.init().then(() => {
|
|||
'normal',
|
||||
wikipediaHelper,
|
||||
document,
|
||||
wikipediaHelper.getWikilessRedirectsChecks,
|
||||
wikipediaHelper.setWikilessRedirectsChecks,
|
||||
wikipediaHelper.getWikilessCustomRedirects,
|
||||
wikipediaHelper.setWikilessCustomRedirects
|
||||
wikipediaHelper.getWikilessNormalRedirectsChecks,
|
||||
wikipediaHelper.setWikilessNormalRedirectsChecks,
|
||||
wikipediaHelper.getWikilessNormalCustomRedirects,
|
||||
wikipediaHelper.setWikilessNormalCustomRedirects
|
||||
)
|
||||
})
|
Loading…
Reference in New Issue