Merge branch 'BobIsMyManager-librex'
This commit is contained in:
commit
ccfcccd53e
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -Am "update instances" || :
|
||||
git commit -am "update instances" || :
|
||||
- name: push changes
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,5 +3,3 @@ web-ext-artifacts/
|
||||
nod
|
||||
node_modules
|
||||
package-lock.json
|
||||
src/instances/blacklist.json
|
||||
src/instances/data.json
|
||||
|
@ -32,7 +32,7 @@ Quora => [Quetre](https://github.com/zyachel/quetre)\
|
||||
IMDb => [Libremdb](https://github.com/zyachel/libremdb)\
|
||||
PeerTube => [SimpleerTube](https://git.sr.ht/~metalune/simpleweb_peertube)\
|
||||
LBRY/Odysee => [Librarian](https://codeberg.org/librarian/librarian)\
|
||||
Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/)\
|
||||
Search => [SearXNG](https://github.com/searxng/searxng), [SearX](https://searx.github.io/searx/), [Whoogle](https://benbusby.com/projects/whoogle-search/), [Librex](https://github.com/hnhx/librex/)\
|
||||
Translate => [SimplyTranslate](https://git.sr.ht/~metalune/simplytranslate_web), [LingvaTranslate](https://github.com/TheDavidDelta/lingva-translate)\
|
||||
Maps => [OpenStreetMap](https://www.openstreetmap.org/), [FacilMap](https://github.com/FacilMap/facilmap)\
|
||||
Send Files => [Send](https://gitlab.com/timvisee/send)
|
||||
|
@ -75,10 +75,6 @@
|
||||
"message": "Medium",
|
||||
"description": "used in the settings page"
|
||||
},
|
||||
"tor": {
|
||||
"message": "Tor",
|
||||
"description": "used in the settings page"
|
||||
},
|
||||
"theme": {
|
||||
"message": "Theme",
|
||||
"description": "used in the settings page"
|
||||
@ -206,13 +202,10 @@
|
||||
"lbry": {
|
||||
"message": "LBRY"
|
||||
},
|
||||
"i2p": {
|
||||
"message": "I2P"
|
||||
},
|
||||
"loki": {
|
||||
"message": "Lokinet"
|
||||
},
|
||||
"testInstancesLatency": {
|
||||
"message": "Test Instances Latency"
|
||||
},
|
||||
"protocolFallback": {
|
||||
"message": "Fallback to normal if no instances are available for the current protocol"
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ async function initDefaults() {
|
||||
],
|
||||
autoRedirect: false,
|
||||
firstPartyIsolate: false,
|
||||
protocol: "normal",
|
||||
protocolFallback: true
|
||||
}, () => resolve())
|
||||
)
|
||||
}
|
||||
|
@ -3,15 +3,21 @@ window.browser = window.browser || window.chrome;
|
||||
import utils from './utils.js'
|
||||
|
||||
const targets = [
|
||||
/^https?:\/{2}(www\.|)imdb\.com.*/
|
||||
/^https?:\/{2}(?:www\.|)imdb\.com.*/
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"libremdb": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
const frontends = new Array("libremdb")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.libremdb = val;
|
||||
@ -29,33 +35,42 @@ function setRedirects(val) {
|
||||
|
||||
let
|
||||
disableImdb,
|
||||
imdbProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
imdbRedirects,
|
||||
libremdbNormalRedirectsChecks,
|
||||
libremdbNormalCustomRedirects,
|
||||
libremdbTorRedirectsChecks,
|
||||
libremdbTorCustomRedirects;
|
||||
libremdbTorCustomRedirects,
|
||||
libremdbI2pCustomRedirects,
|
||||
libremdbLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableImdb",
|
||||
"imdbProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"imdbRedirects",
|
||||
"libremdbNormalRedirectsChecks",
|
||||
"libremdbNormalCustomRedirects",
|
||||
"libremdbTorRedirectsChecks",
|
||||
"libremdbTorCustomRedirects",
|
||||
"libremdbI2pCustomRedirects",
|
||||
"libremdbLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableImdb = r.disableImdb;
|
||||
imdbProtocol = r.imdbProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
imdbRedirects = r.imdbRedirects;
|
||||
libremdbNormalRedirectsChecks = r.libremdbNormalRedirectsChecks;
|
||||
libremdbNormalCustomRedirects = r.libremdbNormalCustomRedirects;
|
||||
libremdbTorRedirectsChecks = r.libremdbTorRedirectsChecks;
|
||||
libremdbTorCustomRedirects = r.libremdbTorCustomRedirects;
|
||||
libremdbI2pCustomRedirects = r.libremdbI2pCustomRedirects;
|
||||
libremdbLokiCustomRedirects = r.libremdbLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -76,10 +91,14 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (initiator && (all.includes(initiator.origin) || targets.includes(initiator.host))) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList;
|
||||
if (imdbProtocol == 'normal') instancesList = [...libremdbNormalRedirectsChecks, ...libremdbNormalCustomRedirects];
|
||||
if (imdbProtocol == 'tor') instancesList = [...libremdbTorRedirectsChecks, ...libremdbTorCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...libremdbLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...libremdbI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...libremdbTorRedirectsChecks, ...libremdbTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...libremdbNormalRedirectsChecks, ...libremdbNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}`;
|
||||
@ -93,7 +112,9 @@ function reverse(url) {
|
||||
...imdbRedirects.libremdb.normal,
|
||||
...imdbRedirects.libremdb.tor,
|
||||
...libremdbNormalCustomRedirects,
|
||||
...libremdbTorCustomRedirects
|
||||
...libremdbTorCustomRedirects,
|
||||
...libremdbI2pCustomRedirects,
|
||||
...libremdbLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
@ -112,12 +133,18 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...libremdbNormalCustomRedirects,
|
||||
...libremdbTorCustomRedirects,
|
||||
...libremdbI2pCustomRedirects,
|
||||
...libremdbLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (imdbProtocol == 'normal') instancesList = [...libremdbNormalCustomRedirects, ...libremdbNormalRedirectsChecks];
|
||||
else if (imdbProtocol == 'tor') instancesList = [...libremdbTorCustomRedirects, ...libremdbTorRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...libremdbLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...libremdbI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...libremdbTorRedirectsChecks, ...libremdbTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...libremdbNormalRedirectsChecks, ...libremdbNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -132,11 +159,11 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.libremdb = dataJson.libremdb;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableImdb: true,
|
||||
imdbProtocol: "normal",
|
||||
|
||||
imdbRedirects: redirects,
|
||||
|
||||
libremdbNormalRedirectsChecks: [...redirects.libremdb.normal],
|
||||
@ -144,6 +171,12 @@ function initDefaults() {
|
||||
|
||||
libremdbTorRedirectsChecks: [...redirects.libremdb.tor],
|
||||
libremdbTorCustomRedirects: [],
|
||||
|
||||
libremdbI2pRedirectsChecks: [],
|
||||
libremdbI2pCustomRedirects: [],
|
||||
|
||||
libremdbLokiRedirectsChecks: [],
|
||||
libremdbLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
})
|
||||
|
@ -4,13 +4,18 @@ import utils from './utils.js'
|
||||
|
||||
const targets = /^https?:\/{2}([im]\.)?imgur\.(com|io)(\/|$)/
|
||||
|
||||
let redirects = {
|
||||
"rimgo": {
|
||||
"normal": [],
|
||||
"tor": [],
|
||||
"i2p": []
|
||||
const frontends = new Array("rimgo")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
@ -45,13 +50,15 @@ function setRedirects() {
|
||||
let
|
||||
disableImgur,
|
||||
imgurRedirects,
|
||||
imgurProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
rimgoNormalRedirectsChecks,
|
||||
rimgoNormalCustomRedirects,
|
||||
rimgoTorRedirectsChecks,
|
||||
rimgoTorCustomRedirects,
|
||||
rimgoI2pRedirectsChecks,
|
||||
rimgoI2pCustomRedirects;
|
||||
rimgoI2pCustomRedirects,
|
||||
rimgoLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
@ -59,24 +66,28 @@ function init() {
|
||||
[
|
||||
"disableImgur",
|
||||
"imgurRedirects",
|
||||
"imgurProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"rimgoNormalRedirectsChecks",
|
||||
"rimgoNormalCustomRedirects",
|
||||
"rimgoTorRedirectsChecks",
|
||||
"rimgoTorCustomRedirects",
|
||||
"rimgoI2pRedirectsChecks",
|
||||
"rimgoI2pCustomRedirects",
|
||||
"rimgoLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableImgur = r.disableImgur;
|
||||
imgurRedirects = r.imgurRedirects;
|
||||
imgurProtocol = r.imgurProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
rimgoNormalRedirectsChecks = r.rimgoNormalRedirectsChecks;
|
||||
rimgoNormalCustomRedirects = r.rimgoNormalCustomRedirects;
|
||||
rimgoTorRedirectsChecks = r.rimgoTorRedirectsChecks;
|
||||
rimgoTorCustomRedirects = r.rimgoTorCustomRedirects;
|
||||
rimgoI2pRedirectsChecks = r.rimgoI2pRedirectsChecks;
|
||||
rimgoI2pCustomRedirects = r.rimgoI2pCustomRedirects;
|
||||
rimgoLokiCustomRedirects = r.rimgoLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -100,6 +111,7 @@ function all() {
|
||||
...rimgoNormalCustomRedirects,
|
||||
...rimgoTorCustomRedirects,
|
||||
...rimgoI2pCustomRedirects,
|
||||
...rimgoLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -111,11 +123,14 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (!targets.test(url.href)) return;
|
||||
if (url.pathname.includes("delete/")) return;
|
||||
|
||||
let instancesList;
|
||||
if (imgurProtocol == 'normal') instancesList = [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects];
|
||||
if (imgurProtocol == 'tor') instancesList = [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects];
|
||||
if (imgurProtocol == 'i2p') instancesList = [...rimgoI2pRedirectsChecks, ...rimgoI2pCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...rimgoLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...rimgoI2pCustomRedirects, ...rimgoI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
@ -136,10 +151,13 @@ function switchInstance(url, disableOverride) {
|
||||
if (disableImgur && !disableOverride) { resolve(); return; }
|
||||
let protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
let instancesList;
|
||||
if (imgurProtocol == 'normal') instancesList = [...rimgoNormalCustomRedirects, ...rimgoNormalRedirectsChecks];
|
||||
else if (imgurProtocol == 'tor') instancesList = [...rimgoTorCustomRedirects, ...rimgoTorRedirectsChecks];
|
||||
else if (imgurProtocol == 'i2p') instancesList = [...rimgoI2pCustomRedirects, ...rimgoI2pRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...rimgoLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...rimgoI2pCustomRedirects, ...rimgoI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...rimgoTorRedirectsChecks, ...rimgoTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...rimgoNormalRedirectsChecks, ...rimgoNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -154,7 +172,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.rimgo = dataJson.rimgo;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
rimgoNormalRedirectsChecks = [...redirects.rimgo.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
@ -163,7 +183,6 @@ function initDefaults() {
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableImgur: false,
|
||||
imgurProtocol: 'normal',
|
||||
imgurRedirects: redirects,
|
||||
|
||||
rimgoNormalRedirectsChecks: rimgoNormalRedirectsChecks,
|
||||
@ -174,6 +193,9 @@ function initDefaults() {
|
||||
|
||||
rimgoI2pRedirectsChecks: [...redirects.rimgo.i2p],
|
||||
rimgoI2pCustomRedirects: [],
|
||||
|
||||
rimgoLokiRedirectsChecks: [...redirects.rimgo.loki],
|
||||
rimgoLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
});
|
||||
|
@ -5,12 +5,19 @@ const targets = [
|
||||
"instagram.com",
|
||||
"www.instagram.com",
|
||||
];
|
||||
let redirects = {
|
||||
"bibliogram": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
}
|
||||
};
|
||||
|
||||
const frontends = new Array("bibliogram")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {};
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
redirects.bibliogram = val;
|
||||
@ -28,33 +35,42 @@ function setRedirects(val) {
|
||||
|
||||
let
|
||||
disableInstagram,
|
||||
instagramProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
instagramRedirects,
|
||||
bibliogramNormalRedirectsChecks,
|
||||
bibliogramTorRedirectsChecks,
|
||||
bibliogramNormalCustomRedirects,
|
||||
bibliogramTorCustomRedirects;
|
||||
bibliogramTorCustomRedirects,
|
||||
bibliogramI2pCustomRedirects,
|
||||
bibliogramLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableInstagram",
|
||||
"instagramProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"instagramRedirects",
|
||||
"bibliogramNormalRedirectsChecks",
|
||||
"bibliogramTorRedirectsChecks",
|
||||
"bibliogramNormalCustomRedirects",
|
||||
"bibliogramTorCustomRedirects",
|
||||
"bibliogramI2pCustomRedirects",
|
||||
"bibliogramLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableInstagram = r.disableInstagram;
|
||||
instagramProtocol = r.instagramProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
instagramRedirects = r.instagramRedirects;
|
||||
bibliogramNormalRedirectsChecks = r.bibliogramNormalRedirectsChecks;
|
||||
bibliogramTorRedirectsChecks = r.bibliogramTorRedirectsChecks;
|
||||
bibliogramNormalCustomRedirects = r.bibliogramNormalCustomRedirects;
|
||||
bibliogramTorCustomRedirects = r.bibliogramTorCustomRedirects;
|
||||
bibliogramI2pCustomRedirects = r.bibliogramI2pCustomRedirects;
|
||||
bibliogramLokiCustomRedirects = r.bibliogramLokiCustomRedirects
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -70,6 +86,8 @@ function all() {
|
||||
...instagramRedirects.bibliogram.tor,
|
||||
...bibliogramNormalCustomRedirects,
|
||||
...bibliogramTorCustomRedirects,
|
||||
...bibliogramI2pCustomRedirects,
|
||||
...bibliogramLokiCustomRedirects
|
||||
]
|
||||
}
|
||||
|
||||
@ -82,10 +100,14 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
const bypassPaths = [/about/, /explore/, /support/, /press/, /api/, /privacy/, /safety/, /admin/, /\/(accounts\/|embeds?.js)/];
|
||||
if (bypassPaths.some(rx => rx.test(url.pathname))) return;
|
||||
|
||||
let instancesList;
|
||||
if (instagramProtocol == 'normal') instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
||||
else if (instagramProtocol == 'tor') instancesList = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...bibliogramLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...bibliogramI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
let randomInstance = utils.getRandomInstance(instancesList)
|
||||
|
||||
const reservedPaths = ["u", "p", "privacy",];
|
||||
@ -116,9 +138,13 @@ function switchInstance(url, disableOverride) {
|
||||
let protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (instagramProtocol == 'normal') instancesList = [...bibliogramNormalCustomRedirects, ...bibliogramNormalRedirectsChecks];
|
||||
else if (instagramProtocol == 'tor') instancesList = [...bibliogramTorCustomRedirects, ...bibliogramTorRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...bibliogramLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...bibliogramI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...bibliogramTorRedirectsChecks, ...bibliogramTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -133,7 +159,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.bibliogram = dataJson.bibliogram;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
bibliogramNormalRedirectsChecks = [...redirects.bibliogram.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
@ -145,11 +173,16 @@ function initDefaults() {
|
||||
instagramRedirects: redirects,
|
||||
|
||||
bibliogramNormalRedirectsChecks: bibliogramNormalRedirectsChecks,
|
||||
bibliogramTorRedirectsChecks: [],
|
||||
bibliogramNormalCustomRedirects: [],
|
||||
|
||||
bibliogramNormalCustomRedirects: [...redirects.bibliogram.tor],
|
||||
bibliogramTorRedirectsChecks: [...redirects.bibliogram.tor],
|
||||
bibliogramTorCustomRedirects: [],
|
||||
instagramProtocol: "normal",
|
||||
|
||||
bibliogramI2pRedirectsChecks: [...redirects.bibliogram.i2p],
|
||||
bibliogramI2pCustomRedirects: [],
|
||||
|
||||
bibliogramLokiRedirectsChecks: [...redirects.bibliogram.loki],
|
||||
bibliogramLokiCustomRedirects: []
|
||||
})
|
||||
resolve();
|
||||
}
|
||||
|
@ -4,70 +4,74 @@ import utils from './utils.js'
|
||||
|
||||
let targets = ["odysee.com"];
|
||||
|
||||
let redirects = {
|
||||
"librarian": {
|
||||
"normal": [
|
||||
"https://lbry.bcow.xyz",
|
||||
"https://odysee.076.ne.jp",
|
||||
"https://lbry.ix.tc",
|
||||
"https://librarian.pussthecat.org",
|
||||
"https://lbry.mutahar.rocks",
|
||||
"https://librarian.esmailelbob.xyz",
|
||||
],
|
||||
"tor": [
|
||||
"http://ecc5mi5ncdw6mxhjz6re6g2uevtpbzxjvxgrxia2gyvrlnil3srbnhyd.onion",
|
||||
"http://vrmbc4brkgkaysmi3fenbzkayobxjh24slmhtocambn3ewe62iuqt3yd.onion",
|
||||
]
|
||||
const frontends = new Array("librarian")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
redirects.librarian = val;
|
||||
browser.storage.local.set({ lbryTargetsRedirects: redirects })
|
||||
for (const item of librarianNormalRedirectsChecks)
|
||||
if (!redirects.librarian.normal.includes(item)) {
|
||||
var index = librarianNormalRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) librarianNormalRedirectsChecks.splice(index, 1);
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.librarian = val;
|
||||
librarianNormalRedirectsChecks = [...redirects.librarian.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
const a = librarianNormalRedirectsChecks.indexOf(instance);
|
||||
if (a > -1) librarianNormalRedirectsChecks.splice(a, 1);
|
||||
}
|
||||
browser.storage.local.set(librarianNormalRedirectsChecks);
|
||||
|
||||
for (const item of librarianTorRedirectsChecks)
|
||||
if (!redirects.librarian.normal.includes(item)) {
|
||||
var index = librarianTorRedirectsChecks.indexOf(item);
|
||||
if (index !== -1) librarianTorRedirectsChecks.splice(index, 1);
|
||||
}
|
||||
browser.storage.local.set(librarianTorRedirectsChecks)
|
||||
browser.storage.local.set({
|
||||
lbryTargetsRedirects: redirects,
|
||||
librarianNormalRedirectsChecks
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
let
|
||||
disableLbryTargets,
|
||||
lbryTargetsProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
lbryTargetsRedirects,
|
||||
librarianNormalRedirectsChecks,
|
||||
librarianNormalCustomRedirects,
|
||||
librarianTorRedirectsChecks,
|
||||
librarianTorCustomRedirects;
|
||||
librarianTorCustomRedirects,
|
||||
librarianI2pRedirectsChecks,
|
||||
librarianI2pCustomRedirects,
|
||||
librarianLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableLbryTargets",
|
||||
"lbryTargetsProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"lbryTargetsRedirects",
|
||||
"librarianNormalRedirectsChecks",
|
||||
"librarianNormalCustomRedirects",
|
||||
"librarianTorRedirectsChecks",
|
||||
"librarianTorCustomRedirects",
|
||||
"librarianI2pRedirectsChecks",
|
||||
"librarianI2pCustomRedirects",
|
||||
"librarianLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableLbryTargets = r.disableLbryTargets;
|
||||
lbryTargetsProtocol = r.lbryTargetsProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
lbryTargetsRedirects = r.lbryTargetsRedirects;
|
||||
librarianNormalRedirectsChecks = r.librarianNormalRedirectsChecks;
|
||||
librarianNormalCustomRedirects = r.librarianNormalCustomRedirects;
|
||||
librarianTorRedirectsChecks = r.librarianTorRedirectsChecks;
|
||||
librarianTorCustomRedirects = r.librarianTorCustomRedirects;
|
||||
librarianI2pRedirectsChecks = r.librarianI2pRedirectsChecks;
|
||||
librarianI2pCustomRedirects = r.librarianI2pCustomRedirects;
|
||||
librarianLokiCustomRedirects = r.librarianLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -82,6 +86,8 @@ function all() {
|
||||
...redirects.librarian.tor,
|
||||
...librarianNormalCustomRedirects,
|
||||
...librarianTorCustomRedirects,
|
||||
...librarianI2pCustomRedirects,
|
||||
...librarianLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -92,9 +98,13 @@ function switchInstance(url, disableOverride) {
|
||||
const protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (lbryTargetsProtocol == 'normal') instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects];
|
||||
else if (lbryTargetsProtocol == 'tor') instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...librarianLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...librarianI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -111,9 +121,13 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (!targets.includes(url.host)) return;
|
||||
if (type != "main_frame") return;
|
||||
|
||||
let instancesList;
|
||||
if (lbryTargetsProtocol == 'normal') instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects];
|
||||
if (lbryTargetsProtocol == 'tor') instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...librarianLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...librarianI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...librarianTorRedirectsChecks, ...librarianTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...librarianNormalRedirectsChecks, ...librarianNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
@ -121,31 +135,29 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
}
|
||||
|
||||
function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
librarianNormalRedirectsChecks = [...redirects.librarian.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
let i;
|
||||
|
||||
i = librarianNormalRedirectsChecks.indexOf(instance);
|
||||
if (i > -1) librarianNormalRedirectsChecks.splice(i, 1);
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableLbryTargets: true,
|
||||
lbryTargetsRedirects: {
|
||||
'librarian': redirects.librarian
|
||||
},
|
||||
lbryTargetsRedirects: redirects,
|
||||
|
||||
librarianNormalRedirectsChecks: librarianNormalRedirectsChecks,
|
||||
librarianNormalRedirectsChecks: [...redirects.librarian.normal],
|
||||
librarianNormalCustomRedirects: [],
|
||||
|
||||
librarianTorRedirectsChecks: [...redirects.librarian.tor],
|
||||
librarianTorCustomRedirects: [],
|
||||
|
||||
lbryTargetsProtocol: "normal",
|
||||
}, () => resolve())
|
||||
librarianI2pRedirectsChecks: [...redirects.librarian.i2p],
|
||||
librarianI2pCustomRedirects: [],
|
||||
|
||||
})
|
||||
librarianLokiRedirectsChecks: [...redirects.librarian.loki],
|
||||
librarianLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,10 @@ let redirects = {
|
||||
'facil': {
|
||||
"normal": [
|
||||
"https://facilmap.org"
|
||||
]
|
||||
],
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
}
|
||||
};
|
||||
|
||||
@ -22,22 +25,37 @@ let redirects = {
|
||||
let
|
||||
disableMaps,
|
||||
mapsFrontend,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
facilNormalRedirectsChecks,
|
||||
facilNormalCustomRedirects;
|
||||
facilNormalCustomRedirects,
|
||||
facilTorCustomRedirects,
|
||||
facilI2pCustomRedirects,
|
||||
facilLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableMaps",
|
||||
"mapsFrontend",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"facilNormalRedirectsChecks",
|
||||
"facilNormalCustomRedirects",
|
||||
"facilTorCustomRedirects",
|
||||
"facilI2pCustomRedirects",
|
||||
"facilLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableMaps = r.disableMaps;
|
||||
mapsFrontend = r.mapsFrontend;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
facilNormalRedirectsChecks = r.facilNormalRedirectsChecks;
|
||||
facilNormalCustomRedirects = r.facilNormalCustomRedirects;
|
||||
facilTorCustomRedirects = r.facilTorCustomRedirects;
|
||||
facilI2pCustomRedirects = r.facilI2pCustomRedirects;
|
||||
facilLokiCustomRedirects = r.facilLokiCustomRedirects;
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -89,7 +107,15 @@ function redirect(url, initiator) {
|
||||
|
||||
let randomInstance;
|
||||
if (mapsFrontend == 'osm') randomInstance = utils.getRandomInstance(redirects.osm.normal);
|
||||
if (mapsFrontend == 'facil') randomInstance = utils.getRandomInstance([...facilNormalRedirectsChecks, ...facilNormalCustomRedirects]);
|
||||
|
||||
if (mapsFrontend == 'facil') {
|
||||
if (protocol == 'loki') randomInstance = utils.getRandomInstance(...facilLokiCustomRedirects);
|
||||
else if (protocol == 'i2p') randomInstance = utils.getRandomInstance(...facilI2pCustomRedirects);
|
||||
else if (protocol == 'tor') randomInstance = utils.getRandomInstance(...facilTorCustomRedirects);
|
||||
if ((randomInstance == "" && protocolFallback) || protocol == 'normal') {
|
||||
randomInstance = utils.getRandomInstance([...facilNormalRedirectsChecks, ...facilNormalCustomRedirects]);
|
||||
}
|
||||
}
|
||||
|
||||
let mapCentre = "#";
|
||||
let prefs = {};
|
||||
@ -201,6 +227,15 @@ async function initDefaults() {
|
||||
mapsRedirects: redirects,
|
||||
facilNormalRedirectsChecks: [...redirects.facil.normal],
|
||||
facilNormalCustomRedirects: [],
|
||||
|
||||
facilTorRedirectsChecks: [...redirects.facil.tor],
|
||||
facilTorCustomRedirects: [],
|
||||
|
||||
facilI2pRedirectsChecks: [...redirects.facil.i2p],
|
||||
facilI2pCustomRedirects: [],
|
||||
|
||||
facilLokiRedirectsChecks: [...redirects.facil.loki],
|
||||
facilLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
window.browser = window.browser || window.chrome;
|
||||
import utils from './utils.js'
|
||||
|
||||
|
||||
const targets = [
|
||||
// /(?:.*\.)*(?<!(link\.|cdn\-images\-\d+\.))medium\.com(\/.*)?$/,
|
||||
/^medium\.com/,
|
||||
@ -28,12 +27,18 @@ const targets = [
|
||||
/^ writingcooperative\.com /,
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"scribe": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
}
|
||||
};
|
||||
const frontends = new Array("scribe")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {};
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.scribe = val;
|
||||
@ -56,7 +61,10 @@ let
|
||||
scribeNormalCustomRedirects,
|
||||
scribeTorRedirectsChecks,
|
||||
scribeTorCustomRedirects,
|
||||
mediumProtocol;
|
||||
scribeI2pCustomRedirects,
|
||||
scribeLokiCustomRedirects,
|
||||
protocol,
|
||||
protocolFallback;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -68,7 +76,10 @@ function init() {
|
||||
"scribeNormalCustomRedirects",
|
||||
"scribeTorRedirectsChecks",
|
||||
"scribeTorCustomRedirects",
|
||||
"mediumProtocol"
|
||||
"scribeI2pCustomRedirects",
|
||||
"scribeLokiCustomRedirects",
|
||||
"protocol",
|
||||
"protocolFallback"
|
||||
],
|
||||
r => {
|
||||
disableMedium = r.disableMedium;
|
||||
@ -77,7 +88,10 @@ function init() {
|
||||
scribeNormalCustomRedirects = r.scribeNormalCustomRedirects;
|
||||
scribeTorRedirectsChecks = r.scribeTorRedirectsChecks;
|
||||
scribeTorCustomRedirects = r.scribeTorCustomRedirects;
|
||||
mediumProtocol = r.mediumProtocol;
|
||||
scribeI2pCustomRedirects = r.scribeI2pCustomRedirects;
|
||||
scribeLokiCustomRedirects = r.scribeLokiCustomRedirects;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -97,15 +111,21 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
...mediumRedirects.scribe.tor,
|
||||
...scribeNormalCustomRedirects,
|
||||
...scribeTorCustomRedirects,
|
||||
...scribeI2pCustomRedirects,
|
||||
...scribeLokiCustomRedirects
|
||||
].includes(initiator.origin))) return;
|
||||
|
||||
if (!targets.some(rx => rx.test(url.host))) return;
|
||||
if (/^\/(@[a-zA-Z.]{0,}(\/|)$)/.test(url.pathname)) return;
|
||||
|
||||
let instancesList;
|
||||
if (mediumProtocol == 'normal') instancesList = [...scribeNormalRedirectsChecks, ...scribeNormalCustomRedirects];
|
||||
else if (mediumProtocol == 'tor') instancesList = [...scribeTorRedirectsChecks, ...scribeTorCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...scribeLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...scribeI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...scribeTorRedirectsChecks, ...scribeTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...scribeNormalRedirectsChecks, ...scribeNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList)
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
@ -122,12 +142,18 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...scribeNormalCustomRedirects,
|
||||
...scribeTorCustomRedirects,
|
||||
...scribeI2pCustomRedirects,
|
||||
...scribeLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (mediumProtocol == 'normal') instancesList = [...scribeNormalCustomRedirects, ...scribeNormalRedirectsChecks];
|
||||
else if (mediumProtocol == 'tor') instancesList = [...scribeTorCustomRedirects, ...scribeTorRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...scribeLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...scribeI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...scribeTorRedirectsChecks, ...scribeTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...scribeNormalRedirectsChecks, ...scribeNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -142,7 +168,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.scribe = dataJson.scribe;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList',
|
||||
async r => {
|
||||
scribeNormalRedirectsChecks = [...redirects.scribe.normal];
|
||||
@ -160,7 +188,11 @@ function initDefaults() {
|
||||
scribeTorRedirectsChecks: [...redirects.scribe.tor],
|
||||
scribeTorCustomRedirects: [],
|
||||
|
||||
mediumProtocol: "normal",
|
||||
scribeI2pRedirectsChecks: [...redirects.scribe.i2p],
|
||||
scribeI2pCustomRedirects: [],
|
||||
|
||||
scribeLokiRedirectsChecks: [...redirects.scribe.loki],
|
||||
scribeLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
})
|
||||
})
|
||||
|
@ -11,7 +11,9 @@ let redirects = {
|
||||
"https://st.phreedom.club",
|
||||
"https://simpleertube.esmailelbob.xyz",
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
}
|
||||
}
|
||||
function setRedirects(val) {
|
||||
@ -39,8 +41,11 @@ let
|
||||
simpleertubeNormalCustomRedirects,
|
||||
simpleertubeTorRedirectsChecks,
|
||||
simpleertubeTorCustomRedirects,
|
||||
simpleertubeI2pCustomRedirects,
|
||||
simpleertubeLokiCustomRedirects,
|
||||
peerTubeTargets,
|
||||
peertubeTargetsProtocol;
|
||||
protocol,
|
||||
protocolFallback;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -52,8 +57,11 @@ function init() {
|
||||
"simpleertubeNormalCustomRedirects",
|
||||
"simpleertubeTorRedirectsChecks",
|
||||
"simpleertubeTorCustomRedirects",
|
||||
"simpleertubeI2pCustomRedirects",
|
||||
"simpleertubeLokiCustomRedirects",
|
||||
"peerTubeTargets",
|
||||
"peertubeTargetsProtocol"
|
||||
"protocol",
|
||||
"protocolFallback"
|
||||
],
|
||||
r => {
|
||||
disablePeertubeTargets = r.disablePeertubeTargets;
|
||||
@ -62,8 +70,11 @@ function init() {
|
||||
simpleertubeNormalCustomRedirects = r.simpleertubeNormalCustomRedirects;
|
||||
simpleertubeTorRedirectsChecks = r.simpleertubeTorRedirectsChecks;
|
||||
simpleertubeTorCustomRedirects = r.simpleertubeTorCustomRedirects;
|
||||
simpleertubeI2pCustomRedirects = r.simpleertubeI2pCustomRedirects;
|
||||
simpleertubeLokiCustomRedirects = r.simpleertubeLokiCustomRedirects;
|
||||
peerTubeTargets = r.peerTubeTargets;
|
||||
peertubeTargetsProtocol = r.peertubeTargetsProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -79,6 +90,8 @@ function all() {
|
||||
...redirects.simpleertube.tor,
|
||||
...simpleertubeNormalCustomRedirects,
|
||||
...simpleertubeTorCustomRedirects,
|
||||
...simpleertubeI2pCustomRedirects,
|
||||
...simpleertubeLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -89,10 +102,14 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (!peerTubeTargets.includes(protocolHost)) return;
|
||||
if (type != "main_frame") return;
|
||||
|
||||
let instancesList;
|
||||
if (peertubeTargetsProtocol == 'normal') instancesList = [...simpleertubeNormalRedirectsChecks, ...simpleertubeNormalCustomRedirects];
|
||||
if (peertubeTargetsProtocol == 'tor') instancesList = [...simpleertubeTorRedirectsChecks, ...simpleertubeTorCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...simpleertubeLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...simpleertubeI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...simpleertubeTorRedirectsChecks, ...simpleertubeTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...simpleertubeNormalRedirectsChecks, ...simpleertubeNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
if (url.host == 'search.joinpeertube.org' || url.host == 'sepiasearch.org') return randomInstance;
|
||||
@ -106,9 +123,13 @@ function switchInstance(url, disableOverride) {
|
||||
const protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (peertubeTargetsProtocol == 'normal') instancesList = [...simpleertubeNormalRedirectsChecks, ...simpleertubeNormalCustomRedirects];
|
||||
else if (peertubeTargetsProtocol == 'tor') instancesList = [...simpleertubeTorRedirectsChecks, ...simpleertubeTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...simpleertubeLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...simpleertubeI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...simpleertubeTorRedirectsChecks, ...simpleertubeTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...simpleertubeNormalRedirectsChecks, ...simpleertubeNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -140,7 +161,11 @@ function initDefaults() {
|
||||
simpleertubeTorRedirectsChecks: [...redirects.simpleertube.tor],
|
||||
simpleertubeTorCustomRedirects: [],
|
||||
|
||||
peertubeTargetsProtocol: "normal",
|
||||
simpleertubeI2pRedirectsChecks: [...redirects.simpleertube.i2p],
|
||||
simpleertubeI2pCustomRedirects: [],
|
||||
|
||||
simpleertubeLokiRedirectsChecks: [...redirects.simpleertube.loki],
|
||||
simpleertubeLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
})
|
||||
})
|
||||
|
@ -6,12 +6,18 @@ const targets = [
|
||||
/^https?:\/{2}(www\.|)quora\.com.*/
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"quetre": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
let redirects = {}
|
||||
|
||||
const frontends = new Array("quetre")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.quetre = val;
|
||||
@ -29,33 +35,42 @@ function setRedirects(val) {
|
||||
|
||||
let
|
||||
disableQuora,
|
||||
quoraProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
quoraRedirects,
|
||||
quetreNormalRedirectsChecks,
|
||||
quetreNormalCustomRedirects,
|
||||
quetreTorRedirectsChecks,
|
||||
quetreTorCustomRedirects;
|
||||
quetreTorCustomRedirects,
|
||||
quetreI2pCustomRedirects,
|
||||
quetreLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableQuora",
|
||||
"quoraProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"quoraRedirects",
|
||||
"quetreNormalRedirectsChecks",
|
||||
"quetreNormalCustomRedirects",
|
||||
"quetreTorRedirectsChecks",
|
||||
"quetreTorCustomRedirects",
|
||||
"quetreI2pCustomRedirects",
|
||||
"quetreLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableQuora = r.disableQuora;
|
||||
quoraProtocol = r.quoraProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
quoraRedirects = r.quoraRedirects;
|
||||
quetreNormalRedirectsChecks = r.quetreNormalRedirectsChecks;
|
||||
quetreNormalCustomRedirects = r.quetreNormalCustomRedirects;
|
||||
quetreTorRedirectsChecks = r.quetreTorRedirectsChecks;
|
||||
quetreTorCustomRedirects = r.quetreTorCustomRedirects;
|
||||
quetreI2pCustomRedirects = r.quetreI2pCustomRedirects;
|
||||
quetreLokiCustomRedirects = r.quetreLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -76,10 +91,14 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (initiator && (all.includes(initiator.origin) || targets.includes(initiator.host))) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList;
|
||||
if (quoraProtocol == 'normal') instancesList = [...quetreNormalRedirectsChecks, ...quetreNormalCustomRedirects];
|
||||
if (quoraProtocol == 'tor') instancesList = [...quetreTorRedirectsChecks, ...quetreTorCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...quetreLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...quetreI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...quetreTorRedirectsChecks, ...quetreTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...quetreNormalRedirectsChecks, ...quetreNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}`;
|
||||
@ -93,7 +112,9 @@ function reverse(url) {
|
||||
...quoraRedirects.quetre.normal,
|
||||
...quoraRedirects.quetre.tor,
|
||||
...quetreNormalCustomRedirects,
|
||||
...quetreTorCustomRedirects
|
||||
...quetreTorCustomRedirects,
|
||||
...quetreI2pCustomRedirects,
|
||||
...quetreLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
@ -112,12 +133,18 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...quetreNormalCustomRedirects,
|
||||
...quetreTorCustomRedirects,
|
||||
...quetreI2pCustomRedirects,
|
||||
...quetreLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (quoraProtocol == 'normal') instancesList = [...quetreNormalCustomRedirects, ...quetreNormalRedirectsChecks];
|
||||
else if (quoraProtocol == 'tor') instancesList = [...quetreTorCustomRedirects, ...quetreTorRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...quetreLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...quetreI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...quetreTorRedirectsChecks, ...quetreTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...quetreNormalRedirectsChecks, ...quetreNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -132,10 +159,11 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.quetre = dataJson.quetre;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableQuora: false,
|
||||
quoraProtocol: "normal",
|
||||
|
||||
quoraRedirects: redirects,
|
||||
|
||||
@ -144,6 +172,12 @@ function initDefaults() {
|
||||
|
||||
quetreTorRedirectsChecks: [...redirects.quetre.tor],
|
||||
quetreTorCustomRedirects: [],
|
||||
|
||||
quetreI2pRedirectsChecks: [...redirects.quetre.i2p],
|
||||
quetreI2pCustomRedirects: [],
|
||||
|
||||
quetreLokiRedirectsChecks: [...redirects.quetre.loki],
|
||||
quetreLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
})
|
||||
|
@ -6,16 +6,18 @@ const targets = [
|
||||
/^https?:\/{2}(www\.|old\.|np\.|new\.|amp\.|)reddit\.com/,
|
||||
/^https?:\/{2}(i\.|preview\.)redd\.it/,
|
||||
];
|
||||
let redirects = {
|
||||
"libreddit": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
"teddit": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
};
|
||||
let redirects = {};
|
||||
|
||||
const frontends = new Array("libreddit", "teddit")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects = val;
|
||||
@ -40,15 +42,27 @@ let
|
||||
disableReddit,
|
||||
redditFrontend,
|
||||
redditRedirects,
|
||||
redditProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
|
||||
libredditNormalRedirectsChecks,
|
||||
libredditNormalCustomRedirects,
|
||||
|
||||
libredditTorRedirectsChecks,
|
||||
libredditTorCustomRedirects,
|
||||
|
||||
libredditI2pCustomRedirects,
|
||||
|
||||
libredditLokiCustomRedirects,
|
||||
|
||||
tedditNormalRedirectsChecks,
|
||||
tedditNormalCustomRedirects,
|
||||
|
||||
tedditTorRedirectsChecks,
|
||||
tedditTorCustomRedirects;
|
||||
tedditTorCustomRedirects,
|
||||
|
||||
tedditI2pCustomRedirects,
|
||||
tedditLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -57,29 +71,39 @@ function init() {
|
||||
"disableReddit",
|
||||
"redditFrontend",
|
||||
"redditRedirects",
|
||||
"redditProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"libredditNormalRedirectsChecks",
|
||||
"libredditNormalCustomRedirects",
|
||||
"libredditTorRedirectsChecks",
|
||||
"libredditTorCustomRedirects",
|
||||
"libredditI2pCustomRedirects",
|
||||
"libredditLokiCustomRedirects",
|
||||
"tedditNormalRedirectsChecks",
|
||||
"tedditNormalCustomRedirects",
|
||||
"tedditTorRedirectsChecks",
|
||||
"tedditTorCustomRedirects",
|
||||
"tedditI2pCustomRedirects",
|
||||
"tedditLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableReddit = r.disableReddit;
|
||||
redditFrontend = r.redditFrontend;
|
||||
redditRedirects = r.redditRedirects;
|
||||
redditProtocol = r.redditProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
libredditNormalRedirectsChecks = r.libredditNormalRedirectsChecks;
|
||||
libredditNormalCustomRedirects = r.libredditNormalCustomRedirects;
|
||||
libredditTorRedirectsChecks = r.libredditTorRedirectsChecks;
|
||||
libredditTorCustomRedirects = r.libredditTorCustomRedirects;
|
||||
libredditI2pCustomRedirects = r.libredditI2pCustomRedirects;
|
||||
libredditLokiCustomRedirects = r.libredditLokiCustomRedirects;
|
||||
tedditNormalRedirectsChecks = r.tedditNormalRedirectsChecks;
|
||||
tedditNormalCustomRedirects = r.tedditNormalCustomRedirects;
|
||||
tedditTorRedirectsChecks = r.tedditTorRedirectsChecks;
|
||||
tedditTorCustomRedirects = r.tedditTorCustomRedirects;
|
||||
tedditI2pCustomRedirects = r.tedditI2pCustomRedirects;
|
||||
tedditLokiCustomRedirects = r.tedditLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -98,12 +122,18 @@ function initLibredditCookies(test, from) {
|
||||
...libredditTorRedirectsChecks,
|
||||
...libredditNormalCustomRedirects,
|
||||
...libredditTorCustomRedirects,
|
||||
...libredditI2pCustomRedirects,
|
||||
...libredditLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (redditProtocol == 'normal') checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
else if (redditProtocol == 'tor') checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...libredditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...libredditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('libreddit', from, checkedInstances, "theme");
|
||||
await utils.copyCookie('libreddit', from, checkedInstances, "front_page");
|
||||
await utils.copyCookie('libreddit', from, checkedInstances, "layout");
|
||||
@ -124,10 +154,14 @@ function initLibredditCookies(test, from) {
|
||||
function pasteLibredditCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableReddit || redditFrontend != 'libreddit' || redditProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (redditProtocol == 'normal') checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects]
|
||||
else if (redditProtocol == 'tor') checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects]
|
||||
if (disableReddit || redditFrontend != 'libreddit' || protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...libredditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...libredditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('libreddit', checkedInstances, "theme");
|
||||
utils.getCookiesFromStorage('libreddit', checkedInstances, "front_page");
|
||||
utils.getCookiesFromStorage('libreddit', checkedInstances, "layout");
|
||||
@ -153,12 +187,19 @@ function initTedditCookies(test, from) {
|
||||
...tedditTorRedirectsChecks,
|
||||
...tedditNormalCustomRedirects,
|
||||
...tedditTorCustomRedirects,
|
||||
...tedditI2pCustomRedirects,
|
||||
...tedditI2pCustomRedirects
|
||||
|
||||
].includes(protocolHost)) resolve();
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (redditProtocol == 'normal') checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects]
|
||||
else if (redditProtocol == 'tor') checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...tedditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...tedditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('teddit', from, checkedInstances, 'collapse_child_comments')
|
||||
await utils.copyCookie('teddit', from, checkedInstances, 'domain_instagram')
|
||||
await utils.copyCookie('teddit', from, checkedInstances, 'domain_twitter')
|
||||
@ -179,10 +220,14 @@ function initTedditCookies(test, from) {
|
||||
function pasteTedditCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableReddit || redditFrontend != 'teddit' || redditProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (redditProtocol == 'normal') checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects]
|
||||
else if (redditProtocol == 'tor') checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects]
|
||||
if (disableReddit || redditFrontend != 'teddit' || protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...tedditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...tedditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('teddit', checkedInstances, 'collapse_child_comments')
|
||||
utils.getCookiesFromStorage('teddit', checkedInstances, 'domain_instagram')
|
||||
utils.getCookiesFromStorage('teddit', checkedInstances, 'domain_twitter')
|
||||
@ -207,8 +252,12 @@ function all() {
|
||||
...redditRedirects.teddit.tor,
|
||||
...libredditNormalCustomRedirects,
|
||||
...libredditTorCustomRedirects,
|
||||
...libredditI2pCustomRedirects,
|
||||
...libredditLokiCustomRedirects,
|
||||
...tedditNormalCustomRedirects,
|
||||
...tedditTorCustomRedirects,
|
||||
...tedditI2pCustomRedirects,
|
||||
...tedditLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -230,15 +279,25 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
const bypassPaths = /\/(gallery\/poll\/rpan\/settings\/topics)/;
|
||||
if (url.pathname.match(bypassPaths)) return;
|
||||
|
||||
let libredditInstancesList;
|
||||
let tedditInstancesList;
|
||||
if (redditProtocol == 'normal') {
|
||||
libredditInstancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
tedditInstancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
} else if (redditProtocol == 'tor') {
|
||||
let libredditInstancesList = [];
|
||||
let tedditInstancesList = [];
|
||||
|
||||
if (protocol == 'loki') {
|
||||
libredditInstancesList = [...libredditLokiCustomRedirects];
|
||||
tedditInstancesList = [...tedditLokiCustomRedirects];
|
||||
}
|
||||
else if (protocol == 'i2p') {
|
||||
libredditInstancesList = [...libredditI2pCustomRedirects];
|
||||
tedditInstancesList = [...tedditI2pCustomRedirects];
|
||||
}
|
||||
else if (protocol == 'tor') {
|
||||
libredditInstancesList = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
tedditInstancesList = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects];
|
||||
}
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
libredditInstancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
tedditInstancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
}
|
||||
|
||||
if (url.host === "i.redd.it") {
|
||||
if (redditFrontend == 'teddit') {
|
||||
@ -293,18 +352,26 @@ function switchInstance(url, disableOverride) {
|
||||
if (disableReddit && !disableOverride) { resolve(); return; }
|
||||
const protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
let instancesList;
|
||||
let instancesList = [];
|
||||
if (redditFrontend == 'libreddit') {
|
||||
if (redditProtocol == 'normal') instancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
else if (redditProtocol == 'tor') instancesList = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
if (protocol == 'loki') instancesList = [...libredditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...libredditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...libredditTorRedirectsChecks, ...libredditTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...libredditNormalRedirectsChecks, ...libredditNormalCustomRedirects];
|
||||
}
|
||||
if ([
|
||||
...redditRedirects.teddit.normal,
|
||||
...redditRedirects.teddit.tor
|
||||
].includes(protocolHost)) url.pathname = url.pathname.replace("/pics/w:null_", "/img/");
|
||||
}
|
||||
else if (redditFrontend == 'teddit') {
|
||||
if (redditProtocol == 'normal') instancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
else if (redditProtocol == 'tor') instancesList = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects];
|
||||
if (protocol == 'loki') instancesList = [...tedditLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...tedditI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...tedditTorRedirectsChecks, ...tedditTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...tedditNormalRedirectsChecks, ...tedditNormalCustomRedirects];
|
||||
}
|
||||
if ([
|
||||
...redditRedirects.libreddit.normal,
|
||||
...redditRedirects.libreddit.tor
|
||||
@ -325,8 +392,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.teddit = dataJson.teddit;
|
||||
redirects.libreddit = dataJson.libreddit;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
libredditNormalRedirectsChecks = [...redirects.libreddit.normal];
|
||||
tedditNormalRedirectsChecks = [...redirects.teddit.normal]
|
||||
@ -341,7 +409,6 @@ function initDefaults() {
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableReddit: false,
|
||||
redditProtocol: 'normal',
|
||||
redditFrontend: 'libreddit',
|
||||
redditRedirects: redirects,
|
||||
|
||||
@ -351,11 +418,23 @@ function initDefaults() {
|
||||
libredditTorRedirectsChecks: [...redirects.libreddit.tor],
|
||||
libredditTorCustomRedirects: [],
|
||||
|
||||
libredditI2pRedirectsChecks: [...redirects.libreddit.i2p],
|
||||
libredditI2pCustomRedirects: [],
|
||||
|
||||
libredditLokiRedirectsChecks: [...redirects.libreddit.loki],
|
||||
libredditLokiCustomRedirects: [],
|
||||
|
||||
tedditNormalRedirectsChecks: tedditNormalRedirectsChecks,
|
||||
tedditNormalCustomRedirects: [],
|
||||
|
||||
tedditTorRedirectsChecks: [...redirects.teddit.tor],
|
||||
tedditTorCustomRedirects: [],
|
||||
|
||||
tedditI2pRedirectsChecks: [...redirects.teddit.i2p],
|
||||
tedditI2pCustomRedirects: [],
|
||||
|
||||
tedditLokiRedirectsChecks: [...redirects.teddit.loki],
|
||||
tedditLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
});
|
||||
|
@ -9,41 +9,77 @@ const targets = [
|
||||
let redirects = {
|
||||
"neuters": {
|
||||
"normal": [
|
||||
'https://neuters.de',
|
||||
"https://neuters.de"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
}
|
||||
}
|
||||
|
||||
// const frontends = new Array("neuters")
|
||||
// const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
// for (let i = 0; i < frontends.length; i++) {
|
||||
// redirects[frontends[i]] = {}
|
||||
// for (let x = 0; x < protocols.length; x++) {
|
||||
// redirects[frontends[i]][protocols[x]] = []
|
||||
// }
|
||||
// }
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.neuters = val;
|
||||
neutersNormalRedirectsChecks = [...redirects.neuters.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
const a = neutersNormalRedirectsChecks.indexOf(instance);
|
||||
if (a > -1) neutersNormalRedirectsChecks.splice(a, 1);
|
||||
}
|
||||
browser.storage.local.set({
|
||||
neutersRedirects: redirects,
|
||||
neutersNormalRedirectsChecks
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
let
|
||||
disableReuters,
|
||||
reutersProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
reutersRedirects,
|
||||
neutersNormalRedirectsChecks,
|
||||
neutersNormalCustomRedirects,
|
||||
neutersTorRedirectsChecks,
|
||||
neutersTorCustomRedirects;
|
||||
neutersTorCustomRedirects,
|
||||
neutersI2pCustomRedirects,
|
||||
neutersLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableReuters",
|
||||
"reutersProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"reutersRedirects",
|
||||
"neutersNormalRedirectsChecks",
|
||||
"neutersNormalCustomRedirects",
|
||||
"neutersTorRedirectsChecks",
|
||||
"neutersTorCustomRedirects",
|
||||
"neutersI2pCustomRedirects",
|
||||
"neutersLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableReuters = r.disableReuters;
|
||||
reutersProtocol = r.reutersProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
reutersRedirects = r.reutersRedirects;
|
||||
neutersNormalRedirectsChecks = r.neutersNormalRedirectsChecks;
|
||||
neutersNormalCustomRedirects = r.neutersNormalCustomRedirects;
|
||||
neutersTorRedirectsChecks = r.neutersTorRedirectsChecks;
|
||||
neutersTorCustomRedirects = r.neutersTorCustomRedirects;
|
||||
neutersI2pCustomRedirects = r.neutersI2pCustomRedirects;
|
||||
neutersLokiCustomRedirects = r.neutersLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -63,9 +99,13 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (initiator && (all.includes(initiator.origin) || targets.includes(initiator.host))) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList;
|
||||
if (reutersProtocol == 'normal') instancesList = [...neutersNormalRedirectsChecks, ...neutersNormalCustomRedirects];
|
||||
if (reutersProtocol == 'tor') instancesList = [...neutersTorRedirectsChecks, ...neutersTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...neutersLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...neutersI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...neutersTorRedirectsChecks, ...neutersTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...neutersNormalRedirectsChecks, ...neutersNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
@ -87,7 +127,6 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
browser.storage.local.set({
|
||||
disableReuters: true,
|
||||
reutersProtocol: "normal",
|
||||
|
||||
reutersRedirects: redirects,
|
||||
|
||||
@ -96,11 +135,18 @@ function initDefaults() {
|
||||
|
||||
neutersTorRedirectsChecks: [...redirects.neuters.tor],
|
||||
neutersTorCustomRedirects: [],
|
||||
|
||||
neutersI2pRedirectsChecks: [...redirects.neuters.i2p],
|
||||
neutersI2pCustomRedirects: [],
|
||||
|
||||
neutersLokiRedirectsChecks: [...redirects.neuters.loki],
|
||||
neutersLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
setRedirects,
|
||||
redirect,
|
||||
initDefaults
|
||||
};
|
||||
|
@ -5,8 +5,12 @@ import utils from './utils.js'
|
||||
const targets = [
|
||||
/^https?:\/{2}search\.libredirect\.invalid/,
|
||||
];
|
||||
// Ill optimise all of assets/javascripts at a later date. For now, I'll just add librex and optimse options javascript
|
||||
const frontends = new Array("searx", "searxng", "whoogle", "librex")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {
|
||||
const redirects = {}
|
||||
/*
|
||||
"searx": {
|
||||
"normal": [],
|
||||
"tor": [],
|
||||
@ -22,7 +26,27 @@ let redirects = {
|
||||
"tor": [],
|
||||
"i2p": []
|
||||
}
|
||||
};
|
||||
*/
|
||||
//};
|
||||
|
||||
//let tmp = "{"
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
//redirects.frontends[i] = {}
|
||||
//redirects.push(frontends[i])
|
||||
//tmp = frontends[i]
|
||||
//tmp = tmp + '\n"' + frontends[i] + '": {'
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
//redirects.frontends[i].protocols = []
|
||||
//tmp = tmp + '\n"' + protocols[x] + '": [],'
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
//tmp = tmp + "\n},"
|
||||
}
|
||||
//tmp = tmp + "\n}"
|
||||
|
||||
//const redirects = JSON.parse(tmp)
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
@ -30,6 +54,7 @@ function setRedirects(val) {
|
||||
searxNormalRedirectsChecks = [...redirects.searx.normal];
|
||||
searxngNormalRedirectsChecks = [...redirects.searxng.normal];
|
||||
whoogleNormalRedirectsChecks = [...redirects.whoogle.normal];
|
||||
librexNormalRedirectsChecks = [...redirects.librex.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
const a = searxNormalRedirectsChecks.indexOf(instance);
|
||||
if (a > -1) searxNormalRedirectsChecks.splice(a, 1);
|
||||
@ -39,12 +64,16 @@ function setRedirects(val) {
|
||||
|
||||
const c = whoogleNormalRedirectsChecks.indexOf(instance);
|
||||
if (c > -1) whoogleNormalRedirectsChecks.splice(c, 1);
|
||||
|
||||
const d = librexNormalRedirectsChecks.indexOf(instance);
|
||||
if (d > -1) librexNormalRedirectsChecks.splice(d, 1);
|
||||
}
|
||||
browser.storage.local.set({
|
||||
searchRedirects: redirects,
|
||||
searxNormalRedirectsChecks,
|
||||
searxngNormalRedirectsChecks,
|
||||
whoogleNormalRedirectsChecks,
|
||||
librexNormalRedirectsChecks,
|
||||
});
|
||||
})
|
||||
}
|
||||
@ -53,25 +82,36 @@ let
|
||||
disableSearch,
|
||||
searchFrontend,
|
||||
searchRedirects,
|
||||
searchProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
whoogleNormalRedirectsChecks,
|
||||
whoogleNormalCustomRedirects,
|
||||
whoogleTorRedirectsChecks,
|
||||
whoogleTorCustomRedirects,
|
||||
whoogleI2pRedirectsChecks,
|
||||
whoogleI2pCustomRedirects,
|
||||
whoogleLokiCustomRedirects,
|
||||
searxNormalRedirectsChecks,
|
||||
searxNormalCustomRedirects,
|
||||
searxTorRedirectsChecks,
|
||||
searxTorCustomRedirects,
|
||||
searxI2pRedirectsChecks,
|
||||
searxI2pCustomRedirects,
|
||||
searxLokiCustomRedirects,
|
||||
searxngNormalRedirectsChecks,
|
||||
searxngNormalCustomRedirects,
|
||||
searxngTorRedirectsChecks,
|
||||
searxngTorCustomRedirects,
|
||||
searxngI2pRedirectsChecks,
|
||||
searxngI2pCustomRedirects;
|
||||
searxngI2pCustomRedirects,
|
||||
searxngLokiCustomRedirects,
|
||||
librexNormalRedirectsChecks,
|
||||
librexNormalCustomRedirects,
|
||||
librexTorRedirectsChecks,
|
||||
librexTorCustomRedirects,
|
||||
librexI2pRedirectsChecks,
|
||||
librexI2pCustomRedirects,
|
||||
librexLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
@ -80,49 +120,71 @@ function init() {
|
||||
"disableSearch",
|
||||
"searchFrontend",
|
||||
"searchRedirects",
|
||||
"searchProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"whoogleNormalRedirectsChecks",
|
||||
"whoogleNormalCustomRedirects",
|
||||
"whoogleTorRedirectsChecks",
|
||||
"whoogleTorCustomRedirects",
|
||||
"whoogleI2pRedirectsChecks",
|
||||
"whoogleI2pCustomRedirects",
|
||||
"whoogleLokiCustomRedirects",
|
||||
"searxNormalRedirectsChecks",
|
||||
"searxNormalCustomRedirects",
|
||||
"searxTorRedirectsChecks",
|
||||
"searxTorCustomRedirects",
|
||||
"searxI2pRedirectsChecks",
|
||||
"searxI2pCustomRedirects",
|
||||
"searxLokiCustomRedirects",
|
||||
"searxngNormalRedirectsChecks",
|
||||
"searxngNormalCustomRedirects",
|
||||
"searxngTorRedirectsChecks",
|
||||
"searxngTorCustomRedirects",
|
||||
"searxngI2pRedirectsChecks",
|
||||
"searxngI2pCustomRedirects",
|
||||
"searxngLokiCustomRedirects",
|
||||
"librexNormalRedirectsChecks",
|
||||
"librexNormalCustomRedirects",
|
||||
"librexTorRedirectsChecks",
|
||||
"librexTorCustomRedirects",
|
||||
"librexI2pRedirectsChecks",
|
||||
"librexI2pCustomRedirects",
|
||||
"librexLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableSearch = r.disableSearch;
|
||||
searchFrontend = r.searchFrontend;
|
||||
searchRedirects = r.searchRedirects;
|
||||
searchProtocol = r.searchProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
whoogleNormalRedirectsChecks = r.whoogleNormalRedirectsChecks;
|
||||
whoogleNormalCustomRedirects = r.whoogleNormalCustomRedirects;
|
||||
whoogleTorRedirectsChecks = r.whoogleTorRedirectsChecks;
|
||||
whoogleTorCustomRedirects = r.whoogleTorCustomRedirects;
|
||||
whoogleI2pRedirectsChecks = r.whoogleI2pRedirectsChecks;
|
||||
whoogleI2pCustomRedirects = r.whoogleI2pCustomRedirects;
|
||||
whoogleLokiCustomRedirects = r.whoogleLokiCustomRedirects;
|
||||
searxNormalRedirectsChecks = r.searxNormalRedirectsChecks;
|
||||
searxNormalCustomRedirects = r.searxNormalCustomRedirects;
|
||||
searxTorRedirectsChecks = r.searxTorRedirectsChecks;
|
||||
searxTorCustomRedirects = r.searxTorCustomRedirects;
|
||||
searxI2pRedirectsChecks = r.searxI2pRedirectsChecks;
|
||||
searxI2pCustomRedirects = r.searxI2pCustomRedirects;
|
||||
searxLokiCustomRedirects = r.searxLokiCustomRedirects;
|
||||
searxngNormalRedirectsChecks = r.searxngNormalRedirectsChecks;
|
||||
searxngNormalCustomRedirects = r.searxngNormalCustomRedirects;
|
||||
searxngTorRedirectsChecks = r.searxngTorRedirectsChecks;
|
||||
searxngTorCustomRedirects = r.searxngTorCustomRedirects;
|
||||
searxngI2pRedirectsChecks = r.searxngI2pRedirectsChecks;
|
||||
searxngI2pCustomRedirects = r.searxngI2pCustomRedirects;
|
||||
searxngLokiCustomRedirects = r.searxngLokiCustomRedirects;
|
||||
librexNormalRedirectsChecks = r.librexNormalRedirectsChecks;
|
||||
librexNormalCustomRedirects = r.librexNormalCustomRedirects;
|
||||
librexTorRedirectsChecks = r.librexTorRedirectsChecks;
|
||||
librexTorCustomRedirects = r.librexTorCustomRedirects;
|
||||
librexI2pRedirectsChecks = r.librexI2pRedirectsChecks;
|
||||
librexI2pCustomRedirects = r.librexI2pCustomRedirects;
|
||||
librexLokiCustomRedirects = r.librexLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -143,13 +205,17 @@ function initSearxCookies(test, from) {
|
||||
...searxTorCustomRedirects,
|
||||
...searxI2pRedirectsChecks,
|
||||
...searxI2pCustomRedirects,
|
||||
...searxLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (searchProtocol == 'normal') checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
else if (searchProtocol == 'tor') checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
else if (searchProtocol == 'i2p') checkedInstances = [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects];
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...searxLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...searxI2pCustomRedirects, ...searxI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('searx', from, checkedInstances, 'advanced_search');
|
||||
await utils.copyCookie('searx', from, checkedInstances, 'autocomplete');
|
||||
await utils.copyCookie('searx', from, checkedInstances, 'categories');
|
||||
@ -176,9 +242,13 @@ function pasteSearxCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableSearch || searchFrontend != 'searx') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (searchProtocol == 'normal') checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects]
|
||||
else if (searchProtocol == 'tor') checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...searxLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...searxI2pCustomRedirects, ...searxI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('searx', checkedInstances, 'advanced_search');
|
||||
utils.getCookiesFromStorage('searx', checkedInstances, 'autocomplete');
|
||||
utils.getCookiesFromStorage('searx', checkedInstances, 'categories');
|
||||
@ -211,13 +281,17 @@ function initSearxngCookies(test, from) {
|
||||
...searxngTorCustomRedirects,
|
||||
...searxngI2pRedirectsChecks,
|
||||
...searxngI2pCustomRedirects,
|
||||
...searxngLokiCustomRedirects,
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (searchProtocol == 'normal') checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
else if (searchProtocol == 'tor') checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
else if (searchProtocol == 'i2p') checkedInstances = [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects];
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...searxngLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...searxngI2pCustomRedirects, ...searxngI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('searxng', from, checkedInstances, 'autocomplete');
|
||||
await utils.copyCookie('searxng', from, checkedInstances, 'categories');
|
||||
await utils.copyCookie('searxng', from, checkedInstances, 'disabled_engines');
|
||||
@ -245,10 +319,14 @@ function initSearxngCookies(test, from) {
|
||||
function pasteSearxngCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableSearch || searchFrontend != 'searxng', searchProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (searchProtocol == 'normal') checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects]
|
||||
else if (searchProtocol == 'tor') checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects]
|
||||
if (disableSearch || searchFrontend != 'searxng', protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...searxngLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...searxngI2pCustomRedirects, ...searxngI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('searxng', checkedInstances, 'autocomplete');
|
||||
utils.getCookiesFromStorage('searxng', checkedInstances, 'categories');
|
||||
utils.getCookiesFromStorage('searxng', checkedInstances, 'disabled_engines');
|
||||
@ -272,6 +350,63 @@ function pasteSearxngCookies() {
|
||||
})
|
||||
}
|
||||
|
||||
function initLibrexCookies(test, from) {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
let protocolHost = utils.protocolHost(from);
|
||||
if (![
|
||||
...librexNormalRedirectsChecks,
|
||||
...librexNormalCustomRedirects,
|
||||
...librexTorRedirectsChecks,
|
||||
...librexTorCustomRedirects,
|
||||
...librexI2pRedirectsChecks,
|
||||
...librexI2pCustomRedirects,
|
||||
...librexLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if(!test) {
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...librexLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...librexI2pCustomRedirects, ...librexI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...librexTorRedirectsChecks, ...librexTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'bibliogram');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'disable_special');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'invidious');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'libreddit');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'nitter');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'proxitok');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'theme');
|
||||
await utils.copyCookie('librex', from, checkedInstances, 'wikiless');
|
||||
}
|
||||
resolve(true);
|
||||
})
|
||||
}
|
||||
|
||||
function pasteLibrexCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableSearch || searchFrontend != 'librex', protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...librexLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...librexI2pCustomRedirects, ...librexI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...librexTorRedirectsChecks, ...librexTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'bibliogram');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'disable_special');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'invidious');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'libreddit');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'nitter');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'proxitok');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'theme');
|
||||
utils.getCookiesFromStorage('librex', checkedInstances, 'wikiless');
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
|
||||
function redirect(url, disableOverride) {
|
||||
if (disableSearch && !disableOverride) return;
|
||||
@ -281,32 +416,57 @@ function redirect(url, disableOverride) {
|
||||
let randomInstance;
|
||||
let path;
|
||||
if (searchFrontend == 'searx') {
|
||||
let instancesList;
|
||||
if (searchProtocol == 'normal') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
else if (searchProtocol == 'tor') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
else if (searchProtocol == 'i2p') instancesList = [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...searxLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...searxI2pCustomRedirects, ...searxI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
randomInstance = utils.getRandomInstance(instancesList)
|
||||
path = "/";
|
||||
}
|
||||
else if (searchFrontend == 'searxng') {
|
||||
let instancesList;
|
||||
if (searchProtocol == 'normal') instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
else if (searchProtocol == 'tor') instancesList = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
else if (searchProtocol == 'i2p') instancesList = [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...searxngLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...searxngI2pCustomRedirects, ...searxngI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
randomInstance = utils.getRandomInstance(instancesList)
|
||||
path = "/";
|
||||
}
|
||||
else if (searchFrontend == 'whoogle') {
|
||||
let instancesList;
|
||||
if (searchProtocol == 'normal') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects];
|
||||
if (searchProtocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects];
|
||||
if (searchProtocol == 'i2p') instancesList = [...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects];
|
||||
if (instancesList.length === 0) return;
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...whoogleLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...whoogleI2pCustomRedirects, ...whoogleI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
randomInstance = utils.getRandomInstance(instancesList)
|
||||
path = "/search";
|
||||
}
|
||||
else if (searchFrontend == 'librex') {
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...librexLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...librexI2pCustomRedirects, ...librexI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...librexTorRedirectsChecks, ...librexTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) { return; }
|
||||
|
||||
randomInstance = utils.getRandomInstance(instancesList)
|
||||
path = "/search.php";
|
||||
}
|
||||
|
||||
if (
|
||||
((url.hostname.includes('google') || url.hostname.includes('bing')) && !url.searchParams.has('q')) ||
|
||||
@ -345,36 +505,57 @@ function switchInstance(url, disableOverride) {
|
||||
...searchRedirects.whoogle.tor,
|
||||
...searchRedirects.whoogle.i2p,
|
||||
|
||||
...searchRedirects.librex.normal,
|
||||
...searchRedirects.librex.tor,
|
||||
...searchRedirects.librex.i2p,
|
||||
|
||||
...searxNormalCustomRedirects,
|
||||
...searxTorCustomRedirects,
|
||||
...searxI2pCustomRedirects,
|
||||
...searxLokiCustomRedirects,
|
||||
|
||||
...searxngNormalCustomRedirects,
|
||||
...searxngTorCustomRedirects,
|
||||
...searxngI2pCustomRedirects,
|
||||
...searxngLokiCustomRedirects,
|
||||
|
||||
...whoogleNormalCustomRedirects,
|
||||
...whoogleTorCustomRedirects,
|
||||
...whoogleI2pCustomRedirects,
|
||||
...whoogleLokiCustomRedirects,
|
||||
|
||||
...librexNormalCustomRedirects,
|
||||
...librexTorCustomRedirects,
|
||||
...librexI2pCustomRedirects,
|
||||
...librexLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (searchProtocol == 'normal') {
|
||||
if (searchFrontend == 'searx') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
else if (searchFrontend == 'searxng') instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
else if (searchFrontend == 'whoogle') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects];
|
||||
|
||||
if (protocol == 'loki') {
|
||||
if (searchFrontend == 'searx') instancesList = [...searxLokiCustomRedirects];
|
||||
else if (searchFrontend == 'searxng') instancesList = [...searxngLokiCustomRedirects];
|
||||
else if (searchFrontend == 'whoogle') instancesList = [...whoogleLokiCustomRedirects];
|
||||
else if (searchFrontend == 'librex') instancesList = [...librexLokiCustomRedirects];
|
||||
}
|
||||
else if (searchProtocol == 'tor') {
|
||||
else if (protocol == 'tor') {
|
||||
if (searchFrontend == 'searx') instancesList = [...searxTorRedirectsChecks, ...searxTorCustomRedirects];
|
||||
else if (searchFrontend == 'searxng') instancesList = [...searxngTorRedirectsChecks, ...searxngTorCustomRedirects];
|
||||
else if (searchFrontend == 'whoogle') instancesList = [...whoogleTorRedirectsChecks, ...whoogleTorCustomRedirects];
|
||||
else if (searchFrontend == 'librex') instancesList = [...librexTorRedirectsChecks, ...librexTorCustomRedirects];
|
||||
}
|
||||
else if (searchProtocol == 'i2p') {
|
||||
else if (protocol == 'i2p') {
|
||||
if (searchFrontend == 'searx') instancesList = [...searxI2pRedirectsChecks, ...searxI2pCustomRedirects];
|
||||
else if (searchFrontend == 'searxng') instancesList = [...searxngI2pRedirectsChecks, ...searxngI2pCustomRedirects];
|
||||
else if (searchFrontend == 'whoogle') instancesList = [...whoogleI2pRedirectsChecks, ...whoogleI2pCustomRedirects];
|
||||
else if (searchFrontend == 'librex') instancesList = [...librexI2pRedirectsChecks, ...librexI2pCustomRedirects];
|
||||
}
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
if (searchFrontend == 'searx') instancesList = [...searxNormalRedirectsChecks, ...searxNormalCustomRedirects];
|
||||
else if (searchFrontend == 'searxng') instancesList = [...searxngNormalRedirectsChecks, ...searxngNormalCustomRedirects];
|
||||
else if (searchFrontend == 'whoogle') instancesList = [...whoogleNormalRedirectsChecks, ...whoogleNormalCustomRedirects];
|
||||
else if (searchFrontend == 'librex') instancesList = [...librexNormalRedirectsChecks, ...librexNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
if (instancesList.length === 0) { resolve(); return; }
|
||||
@ -388,14 +569,20 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
/*
|
||||
redirects.searx = dataJson.searx;
|
||||
redirects.searxng = dataJson.searxng;
|
||||
redirects.whoogle = dataJson.whoogle;
|
||||
*/
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
whoogleNormalRedirectsChecks = [...redirects.whoogle.normal];
|
||||
searxNormalRedirectsChecks = [...redirects.searx.normal];
|
||||
searxngNormalRedirectsChecks = [...redirects.searxng.normal];
|
||||
librexNormalRedirectsChecks = [...redirects.librex.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
let i;
|
||||
|
||||
@ -407,13 +594,15 @@ function initDefaults() {
|
||||
|
||||
i = searxngNormalRedirectsChecks.indexOf(instance);
|
||||
if (i > -1) searxngNormalRedirectsChecks.splice(i, 1);
|
||||
|
||||
i = librexNormalRedirectsChecks.indexOf(instance);
|
||||
if (i > -1) librexNormalRedirectsChecks.splice(i, 1)
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableSearch: false,
|
||||
searchFrontend: 'searxng',
|
||||
searchRedirects: redirects,
|
||||
searxngCustomSettings: false,
|
||||
searchProtocol: 'normal',
|
||||
|
||||
whoogleNormalRedirectsChecks: whoogleNormalRedirectsChecks,
|
||||
whoogleNormalCustomRedirects: [],
|
||||
@ -424,6 +613,9 @@ function initDefaults() {
|
||||
whoogleI2pRedirectsChecks: [...redirects.whoogle.i2p],
|
||||
whoogleI2pCustomRedirects: [],
|
||||
|
||||
whoogleLokiRedirectsChecks: [...redirects.whoogle.loki],
|
||||
whoogleLokiCustomRedirects: [],
|
||||
|
||||
searxNormalRedirectsChecks: searxNormalRedirectsChecks,
|
||||
searxNormalCustomRedirects: [],
|
||||
|
||||
@ -433,6 +625,9 @@ function initDefaults() {
|
||||
searxI2pRedirectsChecks: [...redirects.searx.i2p],
|
||||
searxI2pCustomRedirects: [],
|
||||
|
||||
searxLokiRedirectsChecks: [...redirects.searx.loki],
|
||||
searxLokiCustomRedirects: [],
|
||||
|
||||
searxngNormalRedirectsChecks: searxngNormalRedirectsChecks,
|
||||
searxngNormalCustomRedirects: [],
|
||||
|
||||
@ -441,6 +636,21 @@ function initDefaults() {
|
||||
|
||||
searxngI2pRedirectsChecks: [...redirects.searxng.i2p],
|
||||
searxngI2pCustomRedirects: [],
|
||||
|
||||
searxngLokiRedirectsChecks: [...redirects.searxng.loki],
|
||||
searxngLokiCustomRedirects: [],
|
||||
|
||||
librexNormalRedirectsChecks: librexNormalRedirectsChecks,
|
||||
librexNormalCustomRedirects: [],
|
||||
|
||||
librexTorRedirectsChecks: [...redirects.librex.tor],
|
||||
librexTorCustomRedirects: [],
|
||||
|
||||
librexI2pRedirectsChecks: [...redirects.librex.i2p],
|
||||
librexI2pCustomRedirects: [],
|
||||
|
||||
librexLokiRedirectsChecks: [...redirects.librex.loki],
|
||||
librexLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
})
|
||||
})
|
||||
@ -453,6 +663,8 @@ export default {
|
||||
pasteSearxCookies,
|
||||
initSearxngCookies,
|
||||
pasteSearxngCookies,
|
||||
initLibrexCookies,
|
||||
pasteLibrexCookies,
|
||||
redirect,
|
||||
initDefaults,
|
||||
switchInstance,
|
||||
|
@ -8,12 +8,18 @@ const targets = [
|
||||
/^https?:\/{2}sendfiles\.online\/$/
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"send": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
const frontends = new Array("send")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.send = val;
|
||||
@ -36,7 +42,10 @@ let
|
||||
sendNormalCustomRedirects,
|
||||
sendTorRedirectsChecks,
|
||||
sendTorCustomRedirects,
|
||||
sendTargetsProtocol;
|
||||
sendI2pCustomRedirects,
|
||||
sendLokiCustomRedirects,
|
||||
protocol,
|
||||
protocolFallback;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -44,11 +53,14 @@ function init() {
|
||||
[
|
||||
"disableSendTarget",
|
||||
"sendTargetsRedirects",
|
||||
"sendTargetsProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"sendNormalRedirectsChecks",
|
||||
"sendNormalCustomRedirects",
|
||||
"sendTorRedirectsChecks",
|
||||
"sendTorCustomRedirects",
|
||||
"sendI2pCustomRedirects",
|
||||
"sendLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableSendTarget = r.disableSendTarget;
|
||||
@ -57,7 +69,10 @@ function init() {
|
||||
sendNormalCustomRedirects = r.sendNormalCustomRedirects;
|
||||
sendTorRedirectsChecks = r.sendTorRedirectsChecks;
|
||||
sendTorCustomRedirects = r.sendTorCustomRedirects;
|
||||
sendTargetsProtocol = r.sendTargetsProtocol;
|
||||
sendI2pCustomRedirects = r.sendI2pCustomRedirects;
|
||||
sendLokiCustomRedirects = r.sendLokiCustomRedirects;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -74,6 +89,8 @@ function all() {
|
||||
...sendNormalCustomRedirects,
|
||||
...sendTorRedirectsChecks,
|
||||
...sendTorCustomRedirects,
|
||||
...sendI2pCustomRedirects,
|
||||
...sendLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -85,9 +102,13 @@ function switchInstance(url, disableOverride) {
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
if (url.pathname != '/') { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (sendTargetsProtocol == 'normal') instancesList = [...sendNormalRedirectsChecks, ...sendNormalCustomRedirects];
|
||||
else if (sendTargetsProtocol == 'tor') instancesList = [...sendTorRedirectsChecks, ...sendTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...sendLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...sendI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...sendTorRedirectsChecks, ...sendTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...sendNormalRedirectsChecks, ...sendNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -104,9 +125,13 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (initiator && (all().includes(initiator.origin) || targets.includes(initiator.host))) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList;
|
||||
if (sendTargetsProtocol == 'normal') instancesList = [...sendNormalRedirectsChecks, ...sendNormalCustomRedirects];
|
||||
if (sendTargetsProtocol == 'tor') instancesList = [...sendTorRedirectsChecks, ...sendTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...sendLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...sendI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...sendTorRedirectsChecks, ...sendTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...sendNormalRedirectsChecks, ...sendNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
@ -117,7 +142,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.send = dataJson.send;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
sendNormalRedirectsChecks = [...redirects.send.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
@ -134,7 +161,11 @@ function initDefaults() {
|
||||
sendTorRedirectsChecks: [...redirects.send.tor],
|
||||
sendTorCustomRedirects: [],
|
||||
|
||||
sendTargetsProtocol: "normal",
|
||||
sendI2pRedirectsChecks: [...redirects.send.i2p],
|
||||
sendI2pCustomRedirects: [],
|
||||
|
||||
sendLokiRedirectsChecks: [...redirects.send.loki],
|
||||
sendLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
})
|
||||
})
|
||||
|
@ -6,12 +6,18 @@ const targets = [
|
||||
/^https?:\/{2}(www\.|)tiktok\.com.*/
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"proxiTok": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
const frontends = new Array("proxiTok")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.proxiTok = val;
|
||||
@ -36,12 +42,18 @@ function initProxiTokCookies(test, from) {
|
||||
...proxiTokNormalCustomRedirects,
|
||||
...proxiTokTorRedirectsChecks,
|
||||
...proxiTokTorCustomRedirects,
|
||||
...proxiTokI2pCustomRedirects,
|
||||
...proxiTokLokiCustomRedirects,
|
||||
].includes(protocolHost)) resolve();
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (tiktokProtocol == 'normal') checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects]
|
||||
else if (tiktokProtocol == 'tor') checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...proxiTokI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...proxiTokLokiCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('proxitok', from, checkedInstances, 'theme');
|
||||
await utils.copyCookie('proxitok', from, checkedInstances, 'api-legacy');
|
||||
}
|
||||
@ -52,10 +64,14 @@ function initProxiTokCookies(test, from) {
|
||||
function pasteProxiTokCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableTiktok || tiktokProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (tiktokProtocol == 'normal') checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects]
|
||||
else if (tiktokProtocol == 'tor') checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects]
|
||||
if (disableTiktok || protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...proxiTokI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...proxiTokLokiCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('proxitok', checkedInstances, 'theme');
|
||||
utils.getCookiesFromStorage('proxitok', checkedInstances, 'api-legacy');
|
||||
resolve();
|
||||
@ -64,33 +80,42 @@ function pasteProxiTokCookies() {
|
||||
|
||||
let
|
||||
disableTiktok,
|
||||
tiktokProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
tiktokRedirects,
|
||||
proxiTokNormalRedirectsChecks,
|
||||
proxiTokNormalCustomRedirects,
|
||||
proxiTokTorRedirectsChecks,
|
||||
proxiTokTorCustomRedirects;
|
||||
proxiTokTorCustomRedirects,
|
||||
proxiTokI2pCustomRedirects,
|
||||
proxiTokLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableTiktok",
|
||||
"tiktokProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"tiktokRedirects",
|
||||
"proxiTokNormalRedirectsChecks",
|
||||
"proxiTokNormalCustomRedirects",
|
||||
"proxiTokTorRedirectsChecks",
|
||||
"proxiTokTorCustomRedirects",
|
||||
"proxiTokI2pCustomRedirects",
|
||||
"proxiTokLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableTiktok = r.disableTiktok;
|
||||
tiktokProtocol = r.tiktokProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
tiktokRedirects = r.tiktokRedirects;
|
||||
proxiTokNormalRedirectsChecks = r.proxiTokNormalRedirectsChecks;
|
||||
proxiTokNormalCustomRedirects = r.proxiTokNormalCustomRedirects;
|
||||
proxiTokTorRedirectsChecks = r.proxiTokTorRedirectsChecks;
|
||||
proxiTokTorCustomRedirects = r.proxiTokTorCustomRedirects;
|
||||
proxiTokI2pCustomRedirects = r.proxiTokI2pCustomRedirects;
|
||||
proxiTokLokiCustomRedirects = r.proxiTokLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -112,9 +137,13 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (initiator && (all.includes(initiator.origin) || targets.includes(initiator.host))) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList;
|
||||
if (tiktokProtocol == 'normal') instancesList = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
if (tiktokProtocol == 'tor') instancesList = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...proxiTokI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...proxiTokLokiCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
@ -129,7 +158,9 @@ function reverse(url) {
|
||||
...tiktokRedirects.proxiTok.normal,
|
||||
...tiktokRedirects.proxiTok.tor,
|
||||
...proxiTokNormalCustomRedirects,
|
||||
...proxiTokTorCustomRedirects
|
||||
...proxiTokTorCustomRedirects,
|
||||
...proxiTokI2pCustomRedirects,
|
||||
...proxiTokLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
@ -148,12 +179,18 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...proxiTokNormalCustomRedirects,
|
||||
...proxiTokTorCustomRedirects,
|
||||
...proxiTokI2pCustomRedirects,
|
||||
...proxiTokLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (tiktokProtocol == 'normal') instancesList = [...proxiTokNormalCustomRedirects, ...proxiTokNormalRedirectsChecks];
|
||||
else if (tiktokProtocol == 'tor') instancesList = [...proxiTokTorCustomRedirects, ...proxiTokTorRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...proxiTokI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...proxiTokLokiCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...proxiTokTorRedirectsChecks, ...proxiTokTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...proxiTokNormalRedirectsChecks, ...proxiTokNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -168,10 +205,11 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.proxiTok = dataJson.proxiTok;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.set({
|
||||
disableTiktok: false,
|
||||
tiktokProtocol: "normal",
|
||||
|
||||
tiktokRedirects: redirects,
|
||||
|
||||
@ -180,6 +218,12 @@ function initDefaults() {
|
||||
|
||||
proxiTokTorRedirectsChecks: [...redirects.proxiTok.tor],
|
||||
proxiTokTorCustomRedirects: [],
|
||||
|
||||
proxiTokI2pRedirectsChecks: [...redirects.proxiTok.i2p],
|
||||
proxiTokI2pCustomRedirects: [],
|
||||
|
||||
proxiTokLokiRedirectsChecks: [...redirects.proxiTok.loki],
|
||||
proxiTokLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
});
|
||||
})
|
||||
|
@ -6,36 +6,38 @@ const targets = [
|
||||
/^https?:\/{2}translate\.google(\.[a-z]{2,3}){1,2}\//,
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"simplyTranslate": {
|
||||
"normal": [],
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"lingva": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
}
|
||||
};
|
||||
const frontends = new Array("simplyTranslate", "lingva")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {};
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
let
|
||||
translateDisable,
|
||||
translateFrontend,
|
||||
translateProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
translateRedirects,
|
||||
simplyTranslateNormalRedirectsChecks,
|
||||
simplyTranslateNormalCustomRedirects,
|
||||
simplyTranslateTorRedirectsChecks,
|
||||
simplyTranslateTorCustomRedirects,
|
||||
simplyTranslateI2PRedirectsChecks,
|
||||
simplyTranslateI2PCustomRedirects,
|
||||
simplyTranslateI2pRedirectsChecks,
|
||||
simplyTranslateI2pCustomRedirects,
|
||||
simplyTranslateLokiRedirectsChecks,
|
||||
simplyTranslateLokiCustomReidrects,
|
||||
simplyTranslateLokiCustomRedirects,
|
||||
lingvaNormalRedirectsChecks,
|
||||
lingvaNormalCustomRedirects,
|
||||
lingvaTorRedirectsChecks,
|
||||
lingvaTorCustomRedirects;
|
||||
lingvaTorCustomRedirects,
|
||||
lingvaI2pCustomRedirects,
|
||||
lingvaLokiCustomRedirects
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -43,40 +45,45 @@ function init() {
|
||||
[
|
||||
"translateDisable",
|
||||
"translateFrontend",
|
||||
"translateProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"translateRedirects",
|
||||
|
||||
"simplyTranslateNormalRedirectsChecks",
|
||||
"simplyTranslateNormalCustomRedirects",
|
||||
"simplyTranslateTorRedirectsChecks",
|
||||
"simplyTranslateTorCustomRedirects",
|
||||
"simplyTranslateI2PRedirectsChecks",
|
||||
"simplyTranslateI2PCustomRedirects",
|
||||
"simplyTranslateI2pRedirectsChecks",
|
||||
"simplyTranslateI2pCustomRedirects",
|
||||
"simplyTranslateLokiRedirectsChecks",
|
||||
"simplyTranslateLokiCustomReidrects",
|
||||
"simplyTranslateLokiCustomRedirects",
|
||||
|
||||
"lingvaNormalRedirectsChecks",
|
||||
"lingvaNormalCustomRedirects",
|
||||
"lingvaTorRedirectsChecks",
|
||||
"lingvaTorCustomRedirects",
|
||||
"lingvaI2pCustomRedirects",
|
||||
"lingvaLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
translateDisable = r.translateDisable;
|
||||
translateFrontend = r.translateFrontend;
|
||||
translateProtocol = r.translateProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback
|
||||
translateRedirects = r.translateRedirects;
|
||||
simplyTranslateNormalRedirectsChecks = r.simplyTranslateNormalRedirectsChecks;
|
||||
simplyTranslateNormalCustomRedirects = r.simplyTranslateNormalCustomRedirects;
|
||||
simplyTranslateTorRedirectsChecks = r.simplyTranslateTorRedirectsChecks;
|
||||
simplyTranslateTorCustomRedirects = r.simplyTranslateTorCustomRedirects;
|
||||
simplyTranslateI2PRedirectsChecks = r.simplyTranslateI2PRedirectsChecks;
|
||||
simplyTranslateI2PCustomRedirects = r.simplyTranslateI2PCustomRedirects;
|
||||
simplyTranslateI2pRedirectsChecks = r.simplyTranslateI2pRedirectsChecks;
|
||||
simplyTranslateI2pCustomRedirects = r.simplyTranslateI2pCustomRedirects;
|
||||
simplyTranslateLokiRedirectsChecks = r.simplyTranslateLokiRedirectsChecks;
|
||||
simplyTranslateLokiCustomReidrects = r.simplyTranslateLokiCustomReidrects;
|
||||
simplyTranslateLokiCustomRedirects = r.simplyTranslateLokiCustomRedirects;
|
||||
lingvaNormalRedirectsChecks = r.lingvaNormalRedirectsChecks;
|
||||
lingvaNormalCustomRedirects = r.lingvaNormalCustomRedirects;
|
||||
lingvaTorRedirectsChecks = r.lingvaTorRedirectsChecks;
|
||||
lingvaTorCustomRedirects = r.lingvaTorCustomRedirects;
|
||||
lingvaI2pCustomRedirects = r.lingvaI2pCustomRedirects;
|
||||
lingvaLokiCustomRedirects = r.lingvaLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -98,7 +105,7 @@ function setRedirects(val) {
|
||||
translateRedirects: redirects,
|
||||
simplyTranslateNormalRedirectsChecks: redirects.simplyTranslate.normal,
|
||||
simplyTranslateTorRedirectsChecks: redirects.simplyTranslate.tor,
|
||||
simplyTranslateI2PRedirectsChecks: redirects.simplyTranslate.i2p,
|
||||
simplyTranslateI2pRedirectsChecks: redirects.simplyTranslate.i2p,
|
||||
simplyTranslateLokiRedirectsChecks: redirects.simplyTranslate.loki,
|
||||
lingvaNormalRedirectsChecks,
|
||||
lingvaTorRedirectsChecks: redirects.lingva.tor,
|
||||
@ -116,6 +123,8 @@ function copyPasteLingvaLocalStorage(test, url, tabId) {
|
||||
...lingvaNormalCustomRedirects,
|
||||
...lingvaTorRedirectsChecks,
|
||||
...lingvaTorCustomRedirects,
|
||||
...lingvaI2pCustomRedirects,
|
||||
...lingvaLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
@ -124,9 +133,13 @@ function copyPasteLingvaLocalStorage(test, url, tabId) {
|
||||
{ file: "/assets/javascripts/translate/get_lingva_preferences.js", runAt: "document_start" }
|
||||
);
|
||||
|
||||
let checkedInstances;
|
||||
if (translateProtocol == 'normal') checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
if (translateProtocol == 'tor') checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...lingvaLokiCustomRedirects]; //...lingvaLokiRedirectsChecks,
|
||||
else if (protocol == 'i2p') checkedInstances = [...lingvaI2pCustomRedirects]; //...lingvaI2pRedirectsChecks,
|
||||
else if (protocol == 'tor') checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
}
|
||||
const i = checkedInstances.indexOf(protocolHost);
|
||||
if (i !== -1) checkedInstances.splice(i, 1);
|
||||
if (checkedInstances.length === 0) { resolve(); return; }
|
||||
@ -145,9 +158,13 @@ function pasteLingvaLocalStorage() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (translateDisable || translateFrontend != 'lingva') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (translateProtocol == 'normal') checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
if (translateProtocol == 'tor') checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...lingvaLokiCustomRedirects]; //...lingvaLokiRedirectsChecks,
|
||||
else if (protocol == 'i2p') checkedInstances = [...lingvaI2pCustomRedirects]; //...lingvaI2pRedirectsChecks,
|
||||
else if (protocol == 'tor') checkedInstances = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
}
|
||||
for (const to of checkedInstances)
|
||||
browser.tabs.create({ url: to },
|
||||
tab => browser.tabs.executeScript(tab.id, { file: "/assets/javascripts/translate/set_lingva_preferences.js", runAt: "document_start" }))
|
||||
@ -164,17 +181,19 @@ function copyPasteSimplyTranslateCookies(test, from) {
|
||||
...simplyTranslateNormalCustomRedirects,
|
||||
...simplyTranslateTorRedirectsChecks,
|
||||
...simplyTranslateTorCustomRedirects,
|
||||
...simplyTranslateI2PRedirectsChecks,
|
||||
...simplyTranslateI2PCustomRedirects,
|
||||
...simplyTranslateI2pRedirectsChecks,
|
||||
...simplyTranslateI2pCustomRedirects,
|
||||
...simplyTranslateLokiRedirectsChecks,
|
||||
...simplyTranslateLokiCustomReidrects,
|
||||
...simplyTranslateLokiCustomRedirects,
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (translateProtocol == 'normal') checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects]
|
||||
else if (translateProtocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects]
|
||||
else if (translateProtocol == 'i2p') checkedInstances = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects]
|
||||
else if (translateProtocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects]
|
||||
else if (protocol == 'i2p') checkedInstances = [...simplyTranslateI2pCustomRedirects, ...simplyTranslateI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'from_lang');
|
||||
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'to_lang');
|
||||
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'tts_enabled');
|
||||
@ -189,11 +208,13 @@ function pasteSimplyTranslateCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (translateDisable || translateFrontend != 'simplyTranslate') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (translateProtocol == 'normal') checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects]
|
||||
else if (translateProtocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects]
|
||||
else if (translateProtocol == 'i2p') checkedInstances = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects]
|
||||
else if (translateProtocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects]
|
||||
else if (protocol == 'i2p') checkedInstances = [...simplyTranslateI2pCustomRedirects, ...simplyTranslateI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'from_lang');
|
||||
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'to_lang');
|
||||
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'tts_enabled');
|
||||
@ -208,11 +229,13 @@ function redirect(url, disableOverride) {
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
if (translateFrontend == 'simplyTranslate') {
|
||||
let instancesList;
|
||||
if (translateProtocol == 'normal') instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
if (translateProtocol == 'tor') instancesList = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
|
||||
if (translateProtocol == 'i2p') instancesList = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects];
|
||||
if (translateProtocol == 'loki') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...simplyTranslateI2pRedirectsChecks, ...simplyTranslateI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList)
|
||||
@ -226,9 +249,13 @@ function redirect(url, disableOverride) {
|
||||
let pair = params_arr[i].split('=');
|
||||
params[pair[0]] = pair[1];
|
||||
}
|
||||
let instancesList;
|
||||
if (translateProtocol == 'normal') instancesList = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
if (translateProtocol == 'tor') instancesList = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...lingvaLokiCustomRedirects]; //...lingvaLokiRedirectsChecks,
|
||||
else if (protocol == 'i2p') instancesList = [...lingvaI2pCustomRedirects]; //...lingvaI2pRedirectsChecks,
|
||||
if (protocol == 'tor') instancesList = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList)
|
||||
@ -252,32 +279,35 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...simplyTranslateNormalCustomRedirects,
|
||||
...simplyTranslateTorCustomRedirects,
|
||||
...simplyTranslateI2PCustomRedirects,
|
||||
...simplyTranslateLokiCustomReidrects,
|
||||
...simplyTranslateI2pCustomRedirects,
|
||||
...simplyTranslateLokiCustomRedirects,
|
||||
|
||||
...translateRedirects.lingva.normal,
|
||||
...translateRedirects.lingva.tor,
|
||||
|
||||
...lingvaNormalCustomRedirects,
|
||||
...lingvaTorCustomRedirects,
|
||||
...lingvaI2pCustomRedirects,
|
||||
...lingvaLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (translateProtocol == 'normal') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
else if (translateFrontend == 'lingva') instancesList = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
|
||||
if (protocol == 'loki') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomRedirects];
|
||||
else if (translateFrontend == 'lingva') instancesList = [...lingvaLokiCustomRedirects]; //...lingvaLokiRedirectsChecks,
|
||||
}
|
||||
else if (translateProtocol == 'tor') {
|
||||
else if (protocol == 'i2p') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateI2pRedirectsChecks, ...simplyTranslateI2pCustomRedirects];
|
||||
else if (translateFrontend == 'lingva') instancesList = [...lingvaI2pCustomRedirects]; //...lingvaI2pRedirectsChecks,
|
||||
}
|
||||
else if (protocol == 'tor') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
|
||||
else if (translateFrontend == 'lingva') instancesList = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
|
||||
}
|
||||
else if (translateProtocol == 'i2p') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects];
|
||||
//else if (translateFrontend == 'lingva') instancesList = [...lingvaI2PRedirectsChecks, ...lingvaI2PCustomRedirects];
|
||||
}
|
||||
else if (translateProtocol == 'loki') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects];
|
||||
//else if (translateFrontend == 'lingva') instancesList = [...lingvaLokiRedirectsChecks, ...lingvaLokiCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
|
||||
else if (translateFrontend == 'lingva') instancesList = [...lingvaNormalRedirectsChecks, ...lingvaNormalCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
@ -293,8 +323,9 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.simplyTranslate = dataJson.simplyTranslate;
|
||||
redirects.lingva = dataJson.lingva;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList',
|
||||
async r => {
|
||||
lingvaNormalRedirectsChecks = [...redirects.lingva.normal]
|
||||
@ -305,22 +336,31 @@ function initDefaults() {
|
||||
browser.storage.local.set({
|
||||
translateDisable: false,
|
||||
translateFrontend: "simplyTranslate",
|
||||
translateProtocol: 'normal',
|
||||
translateRedirects: redirects,
|
||||
|
||||
simplyTranslateNormalRedirectsChecks: [...redirects.simplyTranslate.normal],
|
||||
simplyTranslateNormalCustomRedirects: [],
|
||||
|
||||
simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor],
|
||||
simplyTranslateTorCustomRedirects: [],
|
||||
simplyTranslateI2PRedirectsChecks: [...redirects.simplyTranslate.i2p],
|
||||
simplyTranslateI2PCustomRedirects: [],
|
||||
|
||||
simplyTranslateI2pRedirectsChecks: [...redirects.simplyTranslate.i2p],
|
||||
simplyTranslateI2pCustomRedirects: [],
|
||||
|
||||
simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki],
|
||||
simplyTranslateLokiCustomReidrects: [],
|
||||
simplyTranslateLokiCustomRedirects: [],
|
||||
|
||||
lingvaNormalRedirectsChecks: lingvaNormalRedirectsChecks,
|
||||
lingvaNormalCustomRedirects: [],
|
||||
|
||||
lingvaTorRedirectsChecks: [...redirects.lingva.tor],
|
||||
lingvaTorCustomRedirects: [],
|
||||
|
||||
lingvaI2pRedirectsChecks: [...redirects.lingva.i2p],
|
||||
lingvaI2pCustomRedirects: [],
|
||||
|
||||
lingvaLokiRedirectsChecks: [...redirects.lingva.loki],
|
||||
lingvaLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
})
|
||||
})
|
||||
|
@ -9,12 +9,17 @@ const targets = [
|
||||
/^https?:\/{2}t\.co/
|
||||
];
|
||||
|
||||
let redirects = {
|
||||
"nitter": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
};
|
||||
const frontends = new Array("nitter")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {}
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get(['cloudflareBlackList', 'authenticateBlackList'], r => {
|
||||
@ -34,36 +39,45 @@ function setRedirects(val) {
|
||||
|
||||
let
|
||||
disableTwitter,
|
||||
twitterProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
twitterRedirects,
|
||||
twitterRedirectType,
|
||||
nitterNormalRedirectsChecks,
|
||||
nitterNormalCustomRedirects,
|
||||
nitterTorRedirectsChecks,
|
||||
nitterTorCustomRedirects;
|
||||
nitterTorCustomRedirects,
|
||||
nitterI2pCustomRedirects,
|
||||
nitterLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableTwitter",
|
||||
"twitterProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"twitterRedirects",
|
||||
"twitterRedirectType",
|
||||
"nitterNormalRedirectsChecks",
|
||||
"nitterNormalCustomRedirects",
|
||||
"nitterTorRedirectsChecks",
|
||||
"nitterTorCustomRedirects",
|
||||
"nitterI2pCustomRedirects",
|
||||
"nitterLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableTwitter = r.disableTwitter;
|
||||
twitterProtocol = r.twitterProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
twitterRedirects = r.twitterRedirects;
|
||||
twitterRedirectType = r.twitterRedirectType;
|
||||
nitterNormalRedirectsChecks = r.nitterNormalRedirectsChecks;
|
||||
nitterNormalCustomRedirects = r.nitterNormalCustomRedirects;
|
||||
nitterTorRedirectsChecks = r.nitterTorRedirectsChecks;
|
||||
nitterTorCustomRedirects = r.nitterTorCustomRedirects;
|
||||
nitterI2pCustomRedirects = r.nitterI2pCustomRedirects;
|
||||
nitterLokiCustomRedirects = r.nitterLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -79,6 +93,8 @@ function all() {
|
||||
...nitterTorRedirectsChecks,
|
||||
...nitterNormalCustomRedirects,
|
||||
...nitterTorCustomRedirects,
|
||||
...nitterI2pCustomRedirects,
|
||||
...nitterLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -90,9 +106,13 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (twitterRedirectType == 'sub_frame' && type == "main_frame") return;
|
||||
if (twitterRedirectType == 'main_frame' && type != "main_frame") return;
|
||||
|
||||
let instancesList;
|
||||
if (twitterProtocol == 'normal') instancesList = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
else if (twitterProtocol == 'tor') instancesList = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...nitterI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...nitterLokiCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
@ -125,9 +145,13 @@ function switchInstance(url, disableOverride) {
|
||||
if (disableTwitter && !disableOverride) { resolve(); return; }
|
||||
const protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
let instancesList;
|
||||
if (twitterProtocol == 'normal') instancesList = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
else if (twitterProtocol == 'tor') instancesList = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...nitterI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...nitterLokiCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
}
|
||||
|
||||
let index = instancesList.indexOf(protocolHost);
|
||||
if (index > -1) instancesList.splice(index, 1);
|
||||
@ -164,9 +188,13 @@ function initNitterCookies(test, from) {
|
||||
if (!all().includes(protocolHost)
|
||||
) { resolve(); return; }
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (twitterProtocol == 'normal') checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects]
|
||||
else if (twitterProtocol == 'tor') checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...nitterI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...nitterLokiCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('nitter', from, checkedInstances, 'theme');
|
||||
await utils.copyCookie('nitter', from, checkedInstances, 'infiniteScroll');
|
||||
await utils.copyCookie('nitter', from, checkedInstances, 'stickyProfile');
|
||||
@ -194,10 +222,14 @@ function initNitterCookies(test, from) {
|
||||
function pasteNitterCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableTwitter || twitterProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (twitterProtocol == 'normal') checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects]
|
||||
else if (twitterProtocol == 'tor') checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects]
|
||||
if (disableTwitter || protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...nitterI2pCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...nitterLokiCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...nitterTorRedirectsChecks, ...nitterTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...nitterNormalRedirectsChecks, ...nitterNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('nitter', checkedInstances, 'theme');
|
||||
utils.getCookiesFromStorage('nitter', checkedInstances, 'infiniteScroll');
|
||||
utils.getCookiesFromStorage('nitter', checkedInstances, 'stickyProfile');
|
||||
@ -226,7 +258,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.nitter = dataJson.nitter;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get(['cloudflareBlackList', 'authenticateBlackList'], async r => {
|
||||
nitterNormalRedirectsChecks = [...redirects.nitter.normal];
|
||||
for (const instance of [...r.cloudflareBlackList, ...r.authenticateBlackList]) {
|
||||
@ -236,7 +270,6 @@ function initDefaults() {
|
||||
browser.storage.local.set({
|
||||
disableTwitter: false,
|
||||
twitterRedirects: redirects,
|
||||
twitterProtocol: "normal",
|
||||
twitterRedirectType: "both",
|
||||
|
||||
nitterNormalRedirectsChecks: nitterNormalRedirectsChecks,
|
||||
@ -244,6 +277,12 @@ function initDefaults() {
|
||||
|
||||
nitterTorRedirectsChecks: [...redirects.nitter.tor],
|
||||
nitterTorCustomRedirects: [],
|
||||
|
||||
nitterI2pRedirectsChecks: [...redirects.nitter.i2p],
|
||||
nitterI2pCustomRedirects: [],
|
||||
|
||||
nitterLokiRedirectsChecks: [...redirects.nitter.loki],
|
||||
nitterLokiCustomRedirects: []
|
||||
}, () => resolve());
|
||||
})
|
||||
})
|
||||
|
@ -14,6 +14,7 @@ import tiktokHelper from "./tiktok.js";
|
||||
import quoraHelper from "./quora.js"
|
||||
import libremdbHelper from "./imdb.js";
|
||||
import imgurHelper from "./imgur.js";
|
||||
import reutersHelper from './reuters.js';
|
||||
import localise from './localise.js'
|
||||
|
||||
function getRandomInstance(instances) {
|
||||
@ -41,18 +42,20 @@ function updateInstances() {
|
||||
await initcloudflareBlackList();
|
||||
const instances = JSON.parse(http.responseText);
|
||||
|
||||
youtubeHelper.setRedirects({ 'invidious': instances.invidious, 'piped': instances.piped, })
|
||||
youtubeHelper.setRedirects({ 'invidious': instances.invidious, 'piped': instances.piped, 'pipedMaterial': instances.pipedMaterial })
|
||||
twitterHelper.setRedirects(instances.nitter);
|
||||
instagramHelper.setRedirects(instances.bibliogram);
|
||||
redditHelper.setRedirects({ 'libreddit': instances.libreddit, 'teddit': instances.teddit });
|
||||
translateHelper.setRedirects({ "simplyTranslate": instances.simplyTranslate, "lingva": instances.lingva });
|
||||
searchHelper.setRedirects({ 'searx': instances.searx, 'searxng': instances.searxng, 'whoogle': instances.whoogle });
|
||||
searchHelper.setRedirects({ 'searx': instances.searx, 'searxng': instances.searxng, 'whoogle': instances.whoogle, 'librex': instances.librex });
|
||||
wikipediaHelper.setRedirects(instances.wikiless);
|
||||
mediumHelper.setRedirects(instances.scribe);
|
||||
quoraHelper.setRedirects(instances.quetre);
|
||||
libremdbHelper.setRedirects(instances.libremdb);
|
||||
sendTargetsHelper.setRedirects(instances.send);
|
||||
tiktokHelper.setRedirects(instances.proxiTok);
|
||||
lbryHelper.setRedirects(instances.librarian);
|
||||
reutersHelper.setRedirects(instances.neuters);
|
||||
|
||||
console.info("Successfully updated Instances");
|
||||
resolve(true); return;
|
||||
@ -89,7 +92,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) {
|
||||
let redirects;
|
||||
|
||||
async function getFromStorage() {
|
||||
return new Promise(async resolve => {
|
||||
return new Promise(async resolve =>
|
||||
browser.storage.local.get(
|
||||
[
|
||||
redirectsChecks,
|
||||
@ -105,27 +108,31 @@ async function processDefaultCustomInstances(target, name, protocol, document) {
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
await getFromStorage();
|
||||
if (nameCustomInstances === undefined) console.log(customRedirects);
|
||||
|
||||
function calcNameCheckBoxes() {
|
||||
let isTrue = true;
|
||||
for (const item of redirects[name][protocol])
|
||||
for (const item of redirects[name][protocol]) {
|
||||
if (!nameDefaultRedirects.includes(item)) {
|
||||
isTrue = false;
|
||||
break;
|
||||
}
|
||||
for (const element of nameCheckListElement.getElementsByTagName('input'))
|
||||
}
|
||||
for (const element of nameCheckListElement.getElementsByTagName('input')) {
|
||||
element.checked = nameDefaultRedirects.includes(element.className)
|
||||
}
|
||||
if (nameDefaultRedirects.length == 0) isTrue = false;
|
||||
nameProtocolElement.getElementsByClassName('toogle-all')[0].checked = isTrue;
|
||||
nameProtocolElement.getElementsByClassName('toggle-all')[0].checked = isTrue;
|
||||
}
|
||||
nameCheckListElement.innerHTML =
|
||||
[
|
||||
`<div>
|
||||
<x data-localise="__MSG_toggleAll__">Toggle All</x>
|
||||
<input type="checkbox" class="toogle-all"/>
|
||||
<input type="checkbox" class="toggle-all"/>
|
||||
</div>`,
|
||||
...redirects[name][protocol].map(
|
||||
x => {
|
||||
@ -153,7 +160,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) {
|
||||
localise.localisePage();
|
||||
|
||||
calcNameCheckBoxes();
|
||||
nameProtocolElement.getElementsByClassName('toogle-all')[0].addEventListener("change", async event => {
|
||||
nameProtocolElement.getElementsByClassName('toggle-all')[0].addEventListener("change", async event => {
|
||||
if (event.target.checked)
|
||||
nameDefaultRedirects = [...redirects[name][protocol]];
|
||||
else
|
||||
@ -164,7 +171,7 @@ async function processDefaultCustomInstances(target, name, protocol, document) {
|
||||
});
|
||||
|
||||
for (let element of nameCheckListElement.getElementsByTagName('input')) {
|
||||
if (element.className != 'toogle-all')
|
||||
if (element.className != 'toggle-all')
|
||||
nameProtocolElement.getElementsByClassName(element.className)[0].addEventListener("change", async event => {
|
||||
if (event.target.checked)
|
||||
nameDefaultRedirects.push(element.className)
|
||||
@ -384,6 +391,7 @@ function unify(test) {
|
||||
|
||||
if (!result) result = await searchHelper.initSearxCookies(test, url);
|
||||
if (!result) result = await searchHelper.initSearxngCookies(test, url);
|
||||
if (!result) result = await searchHelper.initLibrexCookies(test, url);
|
||||
|
||||
if (!result) result = await tiktokHelper.initProxiTokCookies(test, url);
|
||||
|
||||
|
@ -4,13 +4,18 @@ import utils from './utils.js'
|
||||
|
||||
const targets = /^https?:\/{2}(([a-z]{1,}\.){0,})wikipedia\.org/
|
||||
|
||||
let redirects = {
|
||||
"wikiless": {
|
||||
"normal": [],
|
||||
"tor": [],
|
||||
"i2p": []
|
||||
}
|
||||
};
|
||||
const frontends = new Array("wikiless")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {};
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.wikiless = val;
|
||||
@ -29,13 +34,15 @@ function setRedirects(val) {
|
||||
let
|
||||
disableWikipedia,
|
||||
wikipediaRedirects,
|
||||
wikipediaProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
wikilessNormalRedirectsChecks,
|
||||
wikilessTorRedirectsChecks,
|
||||
wikilessI2pRedirectsChecks,
|
||||
wikilessNormalCustomRedirects,
|
||||
wikilessTorCustomRedirects,
|
||||
wikilessI2pCustomRedirects;
|
||||
wikilessI2pCustomRedirects,
|
||||
wikilessLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(async resolve => {
|
||||
@ -43,25 +50,28 @@ function init() {
|
||||
[
|
||||
"disableWikipedia",
|
||||
"wikipediaRedirects",
|
||||
"wikipediaProtocol",
|
||||
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"wikilessNormalRedirectsChecks",
|
||||
"wikilessTorRedirectsChecks",
|
||||
"wikilessI2pRedirectsChecks",
|
||||
"wikilessNormalCustomRedirects",
|
||||
"wikilessTorCustomRedirects",
|
||||
"wikilessI2pCustomRedirects",
|
||||
"wikilessLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableWikipedia = r.disableWikipedia;
|
||||
wikipediaRedirects = r.wikipediaRedirects;
|
||||
wikipediaProtocol = r.wikipediaProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
wikilessNormalRedirectsChecks = r.wikilessNormalRedirectsChecks;
|
||||
wikilessTorRedirectsChecks = r.wikilessTorRedirectsChecks;
|
||||
wikilessI2pRedirectsChecks = r.wikilessI2pRedirectsChecks;
|
||||
wikilessNormalCustomRedirects = r.wikilessNormalCustomRedirects;
|
||||
wikilessTorCustomRedirects = r.wikilessTorCustomRedirects;
|
||||
wikilessI2pCustomRedirects = r.wikilessI2pCustomRedirects;
|
||||
wikilessLokiCustomRedirects = r.wikilessLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -82,14 +92,18 @@ function initWikilessCookies(test, from) {
|
||||
...wikilessTorCustomRedirects,
|
||||
...wikilessI2pRedirectsChecks,
|
||||
...wikilessI2pCustomRedirects,
|
||||
...wikilessLokiCustomRedirects
|
||||
];
|
||||
if (!all.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (wikipediaProtocol == 'normal') checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects]
|
||||
else if (wikipediaProtocol == 'tor') checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects]
|
||||
else if (wikipediaProtocol == 'i2p') checkedInstances = [...wikilessI2pRedirectsChecks, ...wikilessI2pCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...wikilessLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
}
|
||||
await utils.copyCookie('wikiless', from, checkedInstances, 'theme');
|
||||
await utils.copyCookie('wikiless', from, checkedInstances, 'default_lang');
|
||||
}
|
||||
@ -100,10 +114,14 @@ function initWikilessCookies(test, from) {
|
||||
function pasteWikilessCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableWikipedia || wikipediaProtocol === undefined) { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (wikipediaProtocol == 'normal') checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects]
|
||||
else if (wikipediaProtocol == 'tor') checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects]
|
||||
if (disableWikipedia || protocol === undefined) { resolve(); return; }
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...wikilessLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') checkedInstances = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
}
|
||||
utils.getCookiesFromStorage('wikiless', checkedInstances, 'theme');
|
||||
utils.getCookiesFromStorage('wikiless', checkedInstances, 'default_lang');
|
||||
resolve();
|
||||
@ -123,10 +141,13 @@ function redirect(url, disableOverride) {
|
||||
GETArguments.push([args[0], args[1]]);
|
||||
}
|
||||
}
|
||||
let instancesList;
|
||||
if (wikipediaProtocol == 'normal') instancesList = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
else if (wikipediaProtocol == 'tor') instancesList = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects];
|
||||
else if (wikipediaProtocol == 'i2p') instancesList = [...wikilessI2pRedirectsChecks, ...wikilessI2pCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...wikilessLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
const randomInstance = utils.getRandomInstance(instancesList)
|
||||
|
||||
@ -158,14 +179,18 @@ function switchInstance(url, disableOverride) {
|
||||
|
||||
...wikilessNormalCustomRedirects,
|
||||
...wikilessTorCustomRedirects,
|
||||
...wikilessI2pCustomRedirects
|
||||
...wikilessI2pCustomRedirects,
|
||||
...wikilessLokiCustomRedirects
|
||||
];
|
||||
if (!wikipediaList.includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (wikipediaProtocol == 'normal') instancesList = [...wikilessNormalCustomRedirects, ...wikilessNormalRedirectsChecks];
|
||||
else if (wikipediaProtocol == 'tor') instancesList = [...wikilessTorCustomRedirects, ...wikilessTorRedirectsChecks];
|
||||
else if (wikipediaProtocol == 'i2p') instancesList = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...wikilessLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...wikilessI2pCustomRedirects, ...wikilessI2pRedirectsChecks];
|
||||
else if (protocol == 'tor') instancesList = [...wikilessTorRedirectsChecks, ...wikilessTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...wikilessNormalRedirectsChecks, ...wikilessNormalCustomRedirects];
|
||||
}
|
||||
|
||||
let index = instancesList.indexOf(protocolHost);
|
||||
if (index > -1) instancesList.splice(index, 1);
|
||||
@ -180,7 +205,9 @@ function initDefaults() {
|
||||
return new Promise(resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.wikiless = dataJson.wikiless;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
wikilessNormalRedirectsChecks = [...redirects.wikiless.normal];
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
@ -190,13 +217,19 @@ function initDefaults() {
|
||||
browser.storage.local.set({
|
||||
disableWikipedia: true,
|
||||
wikipediaRedirects: redirects,
|
||||
wikipediaProtocol: "normal",
|
||||
|
||||
wikilessNormalRedirectsChecks: wikilessNormalRedirectsChecks,
|
||||
wikilessTorRedirectsChecks: [...redirects.wikiless.tor],
|
||||
wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p],
|
||||
wikilessNormalCustomRedirects: [],
|
||||
|
||||
wikilessTorRedirectsChecks: [...redirects.wikiless.tor],
|
||||
wikilessTorCustomRedirects: [],
|
||||
|
||||
wikilessI2pRedirectsChecks: [...redirects.wikiless.i2p],
|
||||
wikilessI2pCustomRedirects: [],
|
||||
|
||||
wikilessLokiRedirectsChecks: [...redirects.wikiless.loki],
|
||||
wikilessLokiCustomRedirects: []
|
||||
|
||||
}, () => resolve());
|
||||
})
|
||||
})
|
||||
|
@ -16,35 +16,36 @@ const targets = [
|
||||
|
||||
/^https?:\/{2}(www\.|)(youtube|youtube-nocookie)\.com\/embed\/..*/,
|
||||
];
|
||||
let redirects = {
|
||||
"invidious": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
"piped": {
|
||||
"normal": [],
|
||||
"tor": []
|
||||
},
|
||||
"pipedMaterial": {
|
||||
"normal": [
|
||||
"https://piped-material.xn--17b.net",
|
||||
"https://piped-material.ftp.sh",
|
||||
],
|
||||
"tor": []
|
||||
|
||||
const frontends = new Array("invidious", "piped", "pipedMaterial")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let redirects = {};
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = {}
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
redirects[frontends[i]][protocols[x]] = []
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function setRedirects(val) {
|
||||
browser.storage.local.get('cloudflareBlackList', r => {
|
||||
redirects.invidious = val.invidious;
|
||||
redirects.piped = val.piped;
|
||||
redirects.pipedMaterial = val.pipedMaterial
|
||||
invidiousNormalRedirectsChecks = [...redirects.invidious.normal];
|
||||
pipedNormalRedirectsChecks = [...redirects.piped.normal];
|
||||
pipedMaterialNormalRedirectsChecks = [...redirects.pipedMaterial.normal]
|
||||
for (const instance of r.cloudflareBlackList) {
|
||||
const a = invidiousNormalRedirectsChecks.indexOf(instance);
|
||||
if (a > -1) invidiousNormalRedirectsChecks.splice(a, 1);
|
||||
|
||||
const b = pipedNormalRedirectsChecks.indexOf(instance);
|
||||
if (b > -1) pipedNormalRedirectsChecks.splice(b, 1);
|
||||
|
||||
const c = pipedMaterialNormalRedirectsChecks.indexOf(instance);
|
||||
if (c > -1) pipedMaterialNormalRedirectsChecks.splice(c, 1);
|
||||
}
|
||||
browser.storage.local.set({
|
||||
youtubeRedirects: redirects,
|
||||
@ -52,6 +53,8 @@ function setRedirects(val) {
|
||||
invidiousTorRedirectsChecks: redirects.invidious.tor,
|
||||
pipedNormalRedirectsChecks,
|
||||
pipedTorRedirectsChecks: redirects.piped.tor,
|
||||
pipedMaterialNormalRedirectsChecks,
|
||||
// pipedMaterialTorRedirectsChecks: redirects.pipedMaterial.tor
|
||||
})
|
||||
})
|
||||
}
|
||||
@ -60,21 +63,28 @@ let
|
||||
disableYoutube,
|
||||
onlyEmbeddedVideo,
|
||||
youtubeFrontend,
|
||||
youtubeProtocol,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
youtubeEmbedFrontend,
|
||||
youtubeRedirects,
|
||||
invidiousNormalRedirectsChecks,
|
||||
invidiousNormalCustomRedirects,
|
||||
invidiousTorRedirectsChecks,
|
||||
invidiousTorCustomRedirects,
|
||||
invidiousI2pCustomRedirects,
|
||||
invidiousLokiCustomRedirects,
|
||||
pipedNormalRedirectsChecks,
|
||||
pipedNormalCustomRedirects,
|
||||
pipedTorRedirectsChecks,
|
||||
pipedTorCustomRedirects,
|
||||
pipedI2pCustomRedirects,
|
||||
pipedLokiCustomRedirects,
|
||||
pipedMaterialNormalRedirectsChecks,
|
||||
pipedMaterialNormalCustomRedirects,
|
||||
pipedMaterialTorRedirectsChecks,
|
||||
pipedMaterialTorCustomRedirects;
|
||||
pipedMaterialTorCustomRedirects,
|
||||
pipedMaterialI2pCustomRedirects,
|
||||
pipedMaterialLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
return new Promise(resolve => {
|
||||
@ -83,41 +93,55 @@ function init() {
|
||||
"disableYoutube",
|
||||
"onlyEmbeddedVideo",
|
||||
"youtubeFrontend",
|
||||
"youtubeProtocol",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"youtubeEmbedFrontend",
|
||||
"youtubeRedirects",
|
||||
"invidiousNormalRedirectsChecks",
|
||||
"invidiousNormalCustomRedirects",
|
||||
"invidiousTorRedirectsChecks",
|
||||
"invidiousTorCustomRedirects",
|
||||
"invidiousI2pCustomRedirects",
|
||||
"invidiousLokiCustomRedirects",
|
||||
"pipedNormalRedirectsChecks",
|
||||
"pipedNormalCustomRedirects",
|
||||
"pipedTorRedirectsChecks",
|
||||
"pipedTorCustomRedirects",
|
||||
"pipedI2pCustomRedirects",
|
||||
"pipedLokiCustomRedirects",
|
||||
"pipedMaterialNormalRedirectsChecks",
|
||||
"pipedMaterialNormalCustomRedirects",
|
||||
"pipedMaterialTorRedirectsChecks",
|
||||
"pipedMaterialTorCustomRedirects",
|
||||
"pipedMaterialI2pCustomRedirects",
|
||||
"pipedMaterialLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableYoutube = r.disableYoutube;
|
||||
onlyEmbeddedVideo = r.onlyEmbeddedVideo;
|
||||
youtubeFrontend = r.youtubeFrontend;
|
||||
youtubeProtocol = r.youtubeProtocol;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
youtubeEmbedFrontend = r.youtubeEmbedFrontend;
|
||||
youtubeRedirects = r.youtubeRedirects;
|
||||
invidiousNormalRedirectsChecks = r.invidiousNormalRedirectsChecks;
|
||||
invidiousNormalCustomRedirects = r.invidiousNormalCustomRedirects;
|
||||
invidiousTorRedirectsChecks = r.invidiousTorRedirectsChecks;
|
||||
invidiousTorCustomRedirects = r.invidiousTorCustomRedirects;
|
||||
invidiousI2pCustomRedirects = r.invidiousI2pCustomRedirects;
|
||||
invidiousLokiCustomRedirects = r.invidiousLokiCustomRedirects;
|
||||
pipedNormalRedirectsChecks = r.pipedNormalRedirectsChecks;
|
||||
pipedNormalCustomRedirects = r.pipedNormalCustomRedirects;
|
||||
pipedTorRedirectsChecks = r.pipedTorRedirectsChecks;
|
||||
pipedTorCustomRedirects = r.pipedTorCustomRedirects;
|
||||
pipedI2pCustomRedirects = r.pipedI2pCustomRedirects;
|
||||
pipedLokiCustomRedirects = r.pipedLokiCustomRedirects;
|
||||
pipedMaterialNormalRedirectsChecks = r.pipedMaterialNormalRedirectsChecks;
|
||||
pipedMaterialNormalCustomRedirects = r.pipedMaterialNormalCustomRedirects;
|
||||
pipedMaterialTorRedirectsChecks = r.pipedMaterialTorRedirectsChecks;
|
||||
pipedMaterialTorCustomRedirects = r.pipedMaterialTorCustomRedirects;
|
||||
pipedMaterialI2pCustomRedirects - r.pipedMaterialI2pCustomRedirects;
|
||||
pipedMaterialLokiCustomRedirects = r.pipedMaterialLokiCustomRedirects;
|
||||
resolve();
|
||||
}
|
||||
)
|
||||
@ -140,12 +164,18 @@ function all() {
|
||||
|
||||
...invidiousNormalCustomRedirects,
|
||||
...invidiousTorCustomRedirects,
|
||||
...invidiousI2pCustomRedirects,
|
||||
...invidiousLokiCustomRedirects,
|
||||
|
||||
...pipedNormalCustomRedirects,
|
||||
...pipedTorCustomRedirects,
|
||||
...pipedI2pCustomRedirects,
|
||||
...pipedLokiCustomRedirects,
|
||||
|
||||
...pipedMaterialNormalCustomRedirects,
|
||||
...pipedMaterialTorCustomRedirects,
|
||||
...pipedMaterialI2pCustomRedirects,
|
||||
...pipedMaterialLokiCustomRedirects
|
||||
];
|
||||
}
|
||||
|
||||
@ -160,7 +190,7 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
const isFreetube = youtubeFrontend == 'freetube';
|
||||
const isYatte = youtubeFrontend == 'yatte';
|
||||
|
||||
const isFrontendYoutube = youtubeEmbedFrontend == "youtube";
|
||||
//const isFrontendYoutube = youtubeEmbedFrontend == "youtube";
|
||||
const isFrontendInvidious = youtubeEmbedFrontend == 'invidious';
|
||||
const isFrontendPiped = youtubeEmbedFrontend == 'piped';
|
||||
const isFrontendPipedMaterial = youtubeEmbedFrontend == 'pipedMaterial';
|
||||
@ -172,31 +202,43 @@ function redirect(url, type, initiator, disableOverride) {
|
||||
if (onlyEmbeddedVideo == 'onlyEmbedded' && main_frame) return;
|
||||
if (onlyEmbeddedVideo == 'onlyNotEmbedded' && !main_frame) return;
|
||||
|
||||
if ((isFreetube || isYatte) && sub_frame && isFrontendYoutube) return;
|
||||
//if ((isFreetube || isYatte) && sub_frame && isFrontendYoutube) return;
|
||||
|
||||
if (isYatte && main_frame) return url.href.replace(/^https?:\/{2}/, 'yattee://');
|
||||
if (isFreetube && main_frame) return `freetube://https://youtube.com${url.pathname}${url.search}`;
|
||||
|
||||
if (isInvidious || ((isFreetube || isYatte) && sub_frame && isFrontendInvidious)) {
|
||||
let instancesList;
|
||||
if (youtubeProtocol == 'normal') instancesList = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...invidiousLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...invidiousI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
}
|
||||
if (isPiped || ((isFreetube || isYatte) && sub_frame && isFrontendPiped)) {
|
||||
let instancesList;
|
||||
if (youtubeProtocol == 'normal') instancesList = [...pipedNormalRedirectsChecks, ...pipedNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...pipedLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...pipedI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...pipedNormalRedirectsChecks, ...pipedNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
}
|
||||
if (isPipedMaterial || ((isFreetube || isYatte) && sub_frame && isFrontendPipedMaterial)) {
|
||||
let instancesList;
|
||||
if (youtubeProtocol == 'normal') instancesList = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...pipedMaterialTorRedirectsChecks, ...pipedMaterialTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...pipedMaterialLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...pipedMaterialI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...pipedMaterialTorCustomRedirects]; //...pipedMaterialTorRedirectsChecks,
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects];
|
||||
}
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}${url.search}`;
|
||||
}
|
||||
@ -219,17 +261,27 @@ function switchInstance(url, disableOverride) {
|
||||
const protocolHost = utils.protocolHost(url);
|
||||
if (!all().includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
let instancesList;
|
||||
if (youtubeProtocol == 'normal') {
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousLokiCustomRedirects]; //...invidiousLokiRedirectsChecks,
|
||||
else if (youtubeFrontend == 'piped') instancesList = [...pipedLokiCustomRedirects]; //...pipedLokiRedirectsChecks,
|
||||
else if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialLokiCustomRedirects]; //...pipedMaterialLokiRedirectsChecks,
|
||||
}
|
||||
else if (protocol == 'i2p') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousI2pCustomRedirects]; //...invidiousI2pRedirectsChecks,
|
||||
else if (youtubeFrontend == 'piped') instancesList = [...pipedI2pCustomRedirects]; //...pipedI2pRedirectsChecks,
|
||||
else if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialI2pCustomRedirects]; //...pipedMaterialI2pRedirectsChecks,
|
||||
}
|
||||
else if (protocol == 'tor') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
else if (youtubeFrontend == 'piped') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
else if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialTorCustomRedirects]; //...pipedMaterialTorRedirectsChecks,
|
||||
}
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
else if (youtubeFrontend == 'piped') instancesList = [...pipedNormalRedirectsChecks, ...pipedNormalCustomRedirects];
|
||||
else if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects];
|
||||
}
|
||||
else if (youtubeProtocol == 'tor') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
else if (youtubeFrontend == 'piped') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
else if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialTorRedirectsChecks, ...pipedMaterialTorCustomRedirects];
|
||||
}
|
||||
|
||||
const i = instancesList.indexOf(protocolHost);
|
||||
if (i > -1) instancesList.splice(i, 1);
|
||||
@ -244,8 +296,9 @@ function initDefaults() {
|
||||
return new Promise(async resolve => {
|
||||
fetch('/instances/data.json').then(response => response.text()).then(async data => {
|
||||
let dataJson = JSON.parse(data);
|
||||
redirects.invidious = dataJson.invidious;
|
||||
redirects.piped = dataJson.piped;
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
redirects[frontends[i]] = dataJson[frontends[i]]
|
||||
}
|
||||
browser.storage.local.get('cloudflareBlackList', async r => {
|
||||
|
||||
invidiousNormalRedirectsChecks = [...redirects.invidious.normal];
|
||||
@ -267,9 +320,7 @@ function initDefaults() {
|
||||
disableYoutube: false,
|
||||
enableYoutubeCustomSettings: false,
|
||||
onlyEmbeddedVideo: 'both',
|
||||
|
||||
youtubeRedirects: redirects,
|
||||
|
||||
youtubeFrontend: 'invidious',
|
||||
|
||||
invidiousNormalRedirectsChecks: invidiousNormalRedirectsChecks,
|
||||
@ -278,20 +329,37 @@ function initDefaults() {
|
||||
invidiousTorRedirectsChecks: [...redirects.invidious.tor],
|
||||
invidiousTorCustomRedirects: [],
|
||||
|
||||
invidiousI2pRedirectsChecks: [...redirects.invidious.i2p],
|
||||
invidiousI2pCustomRedirects: [],
|
||||
|
||||
invidiousLokiRedirectsChecks: [...redirects.invidious.loki],
|
||||
invidiousLokiCustomRedirects: [],
|
||||
|
||||
pipedNormalRedirectsChecks: pipedNormalRedirectsChecks,
|
||||
pipedNormalCustomRedirects: [],
|
||||
|
||||
pipedTorRedirectsChecks: [...redirects.piped.tor],
|
||||
pipedTorCustomRedirects: [],
|
||||
|
||||
pipedI2pRedirectsChecks: [...redirects.piped.i2p],
|
||||
pipedI2pCustomRedirects: [],
|
||||
|
||||
pipedLokiRedirectsChecks: [...redirects.piped.loki],
|
||||
pipedLokiCustomRedirects: [],
|
||||
|
||||
pipedMaterialNormalRedirectsChecks: pipedMaterialNormalRedirectsChecks,
|
||||
pipedMaterialNormalCustomRedirects: [],
|
||||
|
||||
pipedMaterialTorRedirectsChecks: [...redirects.pipedMaterial.tor],
|
||||
pipedMaterialTorCustomRedirects: [],
|
||||
|
||||
youtubeEmbedFrontend: 'invidious',
|
||||
youtubeProtocol: 'normal',
|
||||
pipedMaterialI2pRedirectsChecks: [...redirects.pipedMaterial.i2p],
|
||||
pipedMaterialI2pCustomRedirects: [],
|
||||
|
||||
pipedMaterialLokiRedirectsChecks: [...redirects.pipedMaterial.loki],
|
||||
pipedMaterialLokiCustomRedirects: [],
|
||||
|
||||
youtubeEmbedFrontend: 'invidious'
|
||||
}, () => resolve())
|
||||
})
|
||||
})
|
||||
@ -308,11 +376,18 @@ function copyPasteInvidiousCookies(test, from) {
|
||||
...invidiousTorRedirectsChecks,
|
||||
...invidiousNormalCustomRedirects,
|
||||
...invidiousTorCustomRedirects,
|
||||
...invidiousI2pCustomRedirects,
|
||||
...invidiousLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
if (!test) {
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
|
||||
if (protocol == 'loki') checkedInstances = [...invidiousLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...invidiousI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
}
|
||||
const i = checkedInstances.indexOf(protocolHost);
|
||||
if (i !== -1) checkedInstances.splice(i, 1);
|
||||
await utils.copyCookie('invidious', from, checkedInstances, 'PREFS');
|
||||
@ -325,9 +400,13 @@ function pasteInvidiousCookies() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableYoutube || youtubeFrontend != 'invidious') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...invidiousLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...invidiousI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects]
|
||||
if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects]
|
||||
}
|
||||
utils.getCookiesFromStorage('invidious', checkedInstances, 'PREFS');
|
||||
resolve();
|
||||
})
|
||||
@ -343,14 +422,20 @@ function copyPastePipedLocalStorage(test, url, tabId) {
|
||||
...pipedNormalRedirectsChecks,
|
||||
...pipedTorRedirectsChecks,
|
||||
...pipedTorCustomRedirects,
|
||||
...pipedI2pCustomRedirects,
|
||||
...pipedLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
browser.tabs.executeScript(tabId, { file: "/assets/javascripts/youtube/get_piped_preferences.js", runAt: "document_start" });
|
||||
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...pipedLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...pipedI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects]
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks]
|
||||
}
|
||||
const i = checkedInstances.indexOf(protocolHost);
|
||||
if (i !== -1) checkedInstances.splice(i, 1);
|
||||
for (const to of checkedInstances) {
|
||||
@ -365,9 +450,13 @@ function pastePipedLocalStorage() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableYoutube || youtubeFrontend != 'piped') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...pipedLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...pipedI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects]
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...pipedNormalCustomRedirects, ...pipedNormalRedirectsChecks]
|
||||
}
|
||||
for (const to of checkedInstances) {
|
||||
browser.tabs.create({ url: to },
|
||||
tab => browser.tabs.executeScript(tab.id, { file: "/assets/javascripts/youtube/set_piped_preferences.js", runAt: "document_start" }))
|
||||
@ -384,16 +473,22 @@ function copyPastePipedMaterialLocalStorage(test, url, tabId,) {
|
||||
if (![
|
||||
...pipedMaterialNormalRedirectsChecks,
|
||||
...pipedMaterialNormalCustomRedirects,
|
||||
...pipedMaterialTorRedirectsChecks,
|
||||
//...pipedMaterialTorRedirectsChecks,
|
||||
...pipedMaterialTorCustomRedirects,
|
||||
...pipedMaterialI2pCustomRedirects,
|
||||
...pipedMaterialLokiCustomRedirects
|
||||
].includes(protocolHost)) { resolve(); return; }
|
||||
|
||||
if (!test) {
|
||||
browser.tabs.executeScript(tabId, { file: "/assets/javascripts/youtube/get_pipedMaterial_preferences.js", runAt: "document_start" });
|
||||
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...pipedMaterialTorRedirectsChecks, ...pipedMaterialTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...pipedMaterialLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...pipedMaterialI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...pipedMaterialTorCustomRedirects]; //...pipedMaterialTorRedirectsChecks,
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects]
|
||||
}
|
||||
const i = checkedInstances.indexOf(protocolHost);
|
||||
if (i !== -1) checkedInstances.splice(i, 1);
|
||||
for (const to of checkedInstances)
|
||||
@ -410,9 +505,13 @@ function pastePipedMaterialLocalStorage() {
|
||||
return new Promise(async resolve => {
|
||||
await init();
|
||||
if (disableYoutube || youtubeFrontend != 'pipedMaterial') { resolve(); return; }
|
||||
let checkedInstances;
|
||||
if (youtubeProtocol == 'normal') checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects]
|
||||
else if (youtubeProtocol == 'tor') checkedInstances = [...pipedMaterialTorRedirectsChecks, ...pipedMaterialTorCustomRedirects]
|
||||
let checkedInstances = [];
|
||||
if (protocol == 'loki') checkedInstances = [...pipedMaterialLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') checkedInstances = [...pipedMaterialI2pCustomRedirects];
|
||||
else if (protocol == 'tor') checkedInstances = [...pipedMaterialTorCustomRedirects]; //...pipedMaterialTorRedirectsChecks,
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
checkedInstances = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects]
|
||||
}
|
||||
for (const to of checkedInstances) {
|
||||
browser.tabs.create({ url: to },
|
||||
tab => browser.tabs.executeScript(tab.id, { file: "/assets/javascripts/youtube/set_pipedMaterial_preferences.js", runAt: "document_start" }))
|
||||
@ -427,18 +526,26 @@ function removeXFrameOptions(e) {
|
||||
if (e.type == 'main_frame') {
|
||||
for (const i in e.responseHeaders) {
|
||||
if (e.responseHeaders[i].name == 'content-security-policy') {
|
||||
let instancesList;
|
||||
if (youtubeFrontend == 'invidious') {
|
||||
if (youtubeProtocol == 'normal') instancesList = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousLokiCustomRedirects]; //...invidiousLokiRedirectsChecks,
|
||||
if (youtubeFrontend == 'piped') instancesList = [...pipedLokiCustomRedirects]; //...pipedLokiRedirectsChecks,
|
||||
if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialLokiCustomRedirects]; //...pipedMaterialLokiRedirectsChecks,
|
||||
}
|
||||
else if (youtubeFrontend == 'piped') {
|
||||
if (youtubeProtocol == 'normal') instancesList = [...pipedNormalRedirectsChecks, ...pipedNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
else if (protocol == 'i2p') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousI2pCustomRedirects]; //...invidiousI2pRedirectsChecks,
|
||||
if (youtubeFrontend == 'piped') instancesList = [...pipedI2pCustomRedirects]; //...pipedI2pRedirectsChecks,
|
||||
if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialI2pCustomRedirects]; //...pipedMaterialI2pRedirectsChecks,
|
||||
}
|
||||
else if (youtubeFrontend == 'pipedMaterial') {
|
||||
if (youtubeProtocol == 'normal') instancesList = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects];
|
||||
else if (youtubeProtocol == 'tor') instancesList = [...pipedMaterialTorRedirectsChecks, ...pipedMaterialTorCustomRedirects];
|
||||
else if (protocol == 'tor') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects];
|
||||
if (youtubeFrontend == 'piped') instancesList = [...pipedTorRedirectsChecks, ...pipedTorCustomRedirects];
|
||||
if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialTorCustomRedirects]; //...pipedMaterialTorRedirectsChecks,
|
||||
}
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
if (youtubeFrontend == 'invidious') instancesList = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects];
|
||||
if (youtubeFrontend == 'piped') instancesList = [...pipedNormalRedirectsChecks, ...pipedNormalCustomRedirects];
|
||||
if (youtubeFrontend == 'pipedMaterial') instancesList = [...pipedMaterialNormalRedirectsChecks, ...pipedMaterialNormalCustomRedirects];
|
||||
}
|
||||
let securityPolicyList = e.responseHeaders[i].value.split(';');
|
||||
for (const i in securityPolicyList) securityPolicyList[i] = securityPolicyList[i].trim();
|
||||
|
@ -12,26 +12,43 @@ let redirects = {
|
||||
"normal": [
|
||||
"https://beatbump.ml"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
};
|
||||
|
||||
let
|
||||
disableYoutubeMusic,
|
||||
protocol,
|
||||
protocolFallback,
|
||||
beatbumpNormalRedirectsChecks,
|
||||
beatbumpNormalCustomRedirects;
|
||||
beatbumpNormalCustomRedirects,
|
||||
beatbumpTorCustomRedirects,
|
||||
beatbumpI2pCustomRedirects,
|
||||
beatbumpLokiCustomRedirects;
|
||||
|
||||
function init() {
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableYoutubeMusic",
|
||||
"protocol",
|
||||
"protocolFallback",
|
||||
"beatbumpNormalRedirectsChecks",
|
||||
"beatbumpNormalCustomRedirects",
|
||||
"beatbumpTorCustomRedirects",
|
||||
"beatbumpI2pCustomRedirects",
|
||||
"beatbumpLokiCustomRedirects"
|
||||
],
|
||||
r => {
|
||||
disableYoutubeMusic = r.disableYoutubeMusic;
|
||||
protocol = r.protocol;
|
||||
protocolFallback = r.protocolFallback;
|
||||
beatbumpNormalRedirectsChecks = r.beatbumpNormalRedirectsChecks;
|
||||
beatbumpNormalCustomRedirects = r.beatbumpNormalCustomRedirects;
|
||||
beatbumpTorCustomRedirects = r.beatbumpTorCustomRedirects;
|
||||
beatbumpI2pCustomRedirects = r.beatbumpI2pCustomRedirects;
|
||||
beatbumpLokiCustomRedirects = r.beatbumpLokiCustomRedirects;
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -75,7 +92,13 @@ function redirect(url, disableOverride) {
|
||||
if (disableYoutubeMusic && !disableOverride) return;
|
||||
if (!targets.some(rx => rx.test(url.href))) return;
|
||||
|
||||
let instancesList = [...beatbumpNormalRedirectsChecks, ...beatbumpNormalCustomRedirects];
|
||||
let instancesList = [];
|
||||
if (protocol == 'loki') instancesList = [...beatbumpLokiCustomRedirects];
|
||||
else if (protocol == 'i2p') instancesList = [...beatbumpI2pCustomRedirects];
|
||||
else if (protocol == 'tor') instancesList = [...beatbumpTorCustomRedirects];
|
||||
if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') {
|
||||
instancesList = [...beatbumpNormalRedirectsChecks, ...beatbumpNormalCustomRedirects];
|
||||
}
|
||||
if (instancesList.length === 0) return;
|
||||
const randomInstance = utils.getRandomInstance(instancesList);
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
@ -93,6 +116,15 @@ async function initDefaults() {
|
||||
|
||||
beatbumpNormalRedirectsChecks: [...redirects.beatbump.normal],
|
||||
beatbumpNormalCustomRedirects: [],
|
||||
|
||||
beatbumpTorRedirectsChecks: [...redirects.beatbump.tor],
|
||||
beatbumpTorCustomRedirects: [],
|
||||
|
||||
beatbumpI2pRedirectsChecks: [...redirects.beatbump.i2p],
|
||||
beatbumpI2pCustomRedirects: [],
|
||||
|
||||
beatbumpLokiRedirectsChecks: [...redirects.beatbump.loki],
|
||||
beatbumpLokiCustomRedirects: []
|
||||
}, () => resolve())
|
||||
)
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
"https://piped.syncpundit.com",
|
||||
"https://piped.mha.fi",
|
||||
"https://piped.shimul.me",
|
||||
"https://pipedus.palash.dev/",
|
||||
"https://pipedus.palash.dev",
|
||||
"https://nitter.domain.glass",
|
||||
"https://birdsite.xanny.family",
|
||||
"https://nitter.moomoo.me",
|
||||
@ -16,8 +16,10 @@
|
||||
"https://nitter.winscloud.net",
|
||||
"https://twtr.bch.bar",
|
||||
"https://twitter.dr460nf1r3.org",
|
||||
"https://nitter.garudalinux.org",
|
||||
"https://nitter.wef.lol",
|
||||
"https://nitter.catalyst.sx",
|
||||
"https://nitter.fprivacy.com",
|
||||
"https://bib.actionsack.com",
|
||||
"https://libreddit.domain.glass",
|
||||
"https://r.nf",
|
||||
@ -36,21 +38,19 @@
|
||||
"https://teddit.domain.glass",
|
||||
"https://teddit.httpjames.space",
|
||||
"https://teddit.encrypted-data.xyz",
|
||||
"https://teddit.garudalinux.org",
|
||||
"https://tedd.it",
|
||||
"https://wiki.604kph.xyz",
|
||||
"https://wikiless.lunar.icu",
|
||||
"https://lingva.lunar.icu",
|
||||
"https://searx.josie.lol",
|
||||
"https://searx.org",
|
||||
"https://searx.run",
|
||||
"https://searx.albony.xyz",
|
||||
"https://searx.kujonello.cf",
|
||||
"https://search.albony.xyz",
|
||||
"https://search.garudalinux.org",
|
||||
"https://search.dr460nf1r3.org",
|
||||
"https://search.wef.lol",
|
||||
"https://i.actionsack.com"
|
||||
"https://i.actionsack.com",
|
||||
"https://rimgo.encrypted-data.xyz"
|
||||
],
|
||||
"authenticate": [
|
||||
"https://nitter.nixnet.services"
|
||||
]
|
||||
}
|
||||
}
|
@ -10,8 +10,8 @@
|
||||
"https://y.com.sb",
|
||||
"https://yt.artemislena.eu",
|
||||
"https://invidious.flokinet.to",
|
||||
"https://invidious.tiekoetter.com",
|
||||
"https://invidious.sethforprivacy.com",
|
||||
"https://invidious.tiekoetter.com",
|
||||
"https://inv.bp.projectsegfau.lt",
|
||||
"https://invidious.projectsegfau.lt",
|
||||
"https://inv.vern.cc",
|
||||
@ -26,12 +26,15 @@
|
||||
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
||||
"http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
|
||||
"http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion",
|
||||
"http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion",
|
||||
"http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion",
|
||||
"http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion",
|
||||
"http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion/",
|
||||
"http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion",
|
||||
"http://invidious.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion",
|
||||
"http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/"
|
||||
]
|
||||
"http://inv.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"piped": {
|
||||
"normal": [
|
||||
@ -42,7 +45,7 @@
|
||||
"https://piped.syncpundit.com",
|
||||
"https://piped.mha.fi",
|
||||
"https://piped.shimul.me",
|
||||
"https://pipedus.palash.dev/",
|
||||
"https://pipedus.palash.dev",
|
||||
"https://yt.jae.fi",
|
||||
"https://piped.mint.lgbt",
|
||||
"https://piped.privacy.com.de",
|
||||
@ -50,15 +53,31 @@
|
||||
],
|
||||
"tor": [
|
||||
"http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion"
|
||||
]
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"pipedMaterial": {
|
||||
"normal": [
|
||||
"https://piped-material.১.net",
|
||||
"https://piped-material.ftp.sh",
|
||||
"https://piped-staging.ftp.sh",
|
||||
"https://ui.piped.১.net"
|
||||
],
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"proxiTok": {
|
||||
"normal": [
|
||||
"https://proxitok.herokuapp.com",
|
||||
"https://proxitok.pussthecat.org",
|
||||
"https://proxitok.privacydev.net"
|
||||
"https://proxitok.privacydev.net",
|
||||
"https://tok.habedieeh.re"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"send": {
|
||||
"normal": [
|
||||
@ -68,7 +87,7 @@
|
||||
"https://send.ephemeral.land",
|
||||
"https://send.mni.li",
|
||||
"https://send.monks.tools",
|
||||
"https://send.boblorange.net/",
|
||||
"https://send.boblorange.net",
|
||||
"https://send.aurorabilisim.com",
|
||||
"https://nhanh.cloud",
|
||||
"https://send.datahoarder.dev",
|
||||
@ -80,7 +99,9 @@
|
||||
"https://bytefile.de",
|
||||
"https://transfer.acted.org"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"nitter": {
|
||||
"normal": [
|
||||
@ -128,6 +149,7 @@
|
||||
"https://nitter.bird.froth.zone",
|
||||
"https://nitter.dcs0.hu",
|
||||
"https://twitter.dr460nf1r3.org",
|
||||
"https://nitter.garudalinux.org",
|
||||
"https://twitter.beparanoid.de",
|
||||
"https://n.ramle.be",
|
||||
"https://nitter.cz",
|
||||
@ -135,15 +157,23 @@
|
||||
"https://tweet.lambda.dance",
|
||||
"https://nitter.ebnar.xyz",
|
||||
"https://nitter.kylrth.com",
|
||||
"https://nitter.oishi-ra.men",
|
||||
"https://nitter.foss.wtf",
|
||||
"https://nitter.priv.pw",
|
||||
"https://t.com.sb",
|
||||
"https://nt.vern.cc",
|
||||
"https://nitter.wef.lol",
|
||||
"https://nitter.tokhmi.xyz",
|
||||
"https://nitter.catalyst.sx",
|
||||
"https://unofficialbird.com"
|
||||
"https://unofficialbird.com",
|
||||
"https://nitter.projectsegfau.lt",
|
||||
"https://singapore.unofficialbird.com",
|
||||
"https://twt.funami.tech",
|
||||
"https://nitter.fprivacy.com",
|
||||
"https://canada.unofficialbird.com",
|
||||
"https://india.unofficialbird.com",
|
||||
"https://nederland.unofficialbird.com",
|
||||
"https://uk.unofficialbird.com",
|
||||
"https://n.l5.ca",
|
||||
"https://nitter.slipfox.xyz"
|
||||
],
|
||||
"tor": [
|
||||
"http://3nzoldnxplag42gqjs23xvghtzf6t6yzssrtytnntc6ppc7xxuoneoad.onion",
|
||||
@ -169,8 +199,11 @@
|
||||
"http://fbdi323aj3t6hdx4jtkuwxrnafzskquciowu2yu3jizfssaq35aow6ad.onion",
|
||||
"http://nitterqdyumlovt7tjqpdjrluitgmtpa53qq3idlpgoe4kxo7gs3xvad.onion",
|
||||
"http://nitter.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion",
|
||||
"http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion"
|
||||
]
|
||||
"http://aaaaaxx74hbzeibageieowryhsqvimbdiitfkfe47tvgawkwkjh3coqd.onion",
|
||||
"http://wiio4sgs4247brk7hj6qck2jxnvldwfdbguigc5ivpxrsegnliyfvuqd.onion"
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"bibliogram": {
|
||||
"normal": [
|
||||
@ -181,12 +214,16 @@
|
||||
"https://bibliogram.froth.zone",
|
||||
"https://insta.trom.tf",
|
||||
"https://insta.tromdienste.de",
|
||||
"https://biblio.alefvanoon.xyz",
|
||||
"https://ig.tokhmi.xyz",
|
||||
"https://ig.beparanoid.de",
|
||||
"https://bibliogram.privacydev.net",
|
||||
"https://bibliogram.priv.pw",
|
||||
"https://ig.funami.tech",
|
||||
"https://bib.actionsack.com"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"libreddit": {
|
||||
"normal": [
|
||||
@ -269,7 +306,9 @@
|
||||
"http://inz6tbezfwzexva6dize4cqraj2tjdhygxabmcgysccesvw2pybzhbyd.onion",
|
||||
"http://libreddit.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion",
|
||||
"http://lr.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"
|
||||
]
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"teddit": {
|
||||
"normal": [
|
||||
@ -290,10 +329,12 @@
|
||||
"https://teddit.adminforge.de",
|
||||
"https://teddit.bus-hit.me",
|
||||
"https://teddit.froth.zone",
|
||||
"https://rdt.trom.tf/",
|
||||
"https://rdt.trom.tf",
|
||||
"https://teddit.encrypted-data.xyz",
|
||||
"https://i.opnxng.com",
|
||||
"https://teddit.tokhmi.xyz"
|
||||
"https://teddit.tokhmi.xyz",
|
||||
"https://teddit.garudalinux.org",
|
||||
"https://tedd.it"
|
||||
],
|
||||
"tor": [
|
||||
"http://snoo.ioensistjs7wd746zluwixvojbbkxhr37lepdvwtdfeav673o64iflqd.onion",
|
||||
@ -301,7 +342,9 @@
|
||||
"http://tedditfyn6idalzso5wam5qd3kdtxoljjhbrbbx34q2xkcisvshuytad.onion",
|
||||
"http://dawtyi5e2cfyfmoht4izmczi42aa2zwh6wi34zwvc6rzf2acpxhrcrad.onion",
|
||||
"http://qtpvyiaqhmwccxwzsqubd23xhmmrt75tdyw35kp43w4hvamsgl3x27ad.onion"
|
||||
]
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"wikiless": {
|
||||
"normal": [
|
||||
@ -313,8 +356,8 @@
|
||||
"https://wikiless.northboot.xyz",
|
||||
"https://wikiless.tiekoetter.com",
|
||||
"https://wikiless.esmailelbob.xyz",
|
||||
"",
|
||||
"https://wiki.slipfox.xyz"
|
||||
"https://wiki.slipfox.xyz",
|
||||
"https://wikiless.funami.tech"
|
||||
],
|
||||
"tor": [
|
||||
"http://dj2tbh2nqfxyfmvq33cjmhuw7nb6am7thzd3zsjvizeqf374fixbrxyd.onion",
|
||||
@ -325,7 +368,8 @@
|
||||
"i2p": [
|
||||
"http://hflqp2ejxygpj6cdwo3ogfieqmxw3b56w7dblt7bor2ltwk6kcfa.b32.i2p",
|
||||
"http://x33lx4h6d7h6xs4eiqwhvaxn3ea5gn2ifmu3jobnvuvn4k4aej7a.b32.i2p"
|
||||
]
|
||||
],
|
||||
"loki": []
|
||||
},
|
||||
"scribe": {
|
||||
"normal": [
|
||||
@ -335,7 +379,9 @@
|
||||
"https://scribe.bus-hit.me",
|
||||
"https://scribe.froth.zone"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"quetre": {
|
||||
"normal": [
|
||||
@ -344,9 +390,12 @@
|
||||
"https://quetre.pussthecat.org",
|
||||
"https://wuetre.herokuapp.com",
|
||||
"https://quetreus.herokuapp.com",
|
||||
"https://quetre.tokhmi.xyz"
|
||||
"https://quetre.tokhmi.xyz",
|
||||
"https://quetre.projectsegfau.lt"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"libremdb": {
|
||||
"normal": [
|
||||
@ -355,7 +404,9 @@
|
||||
"https://libremdbeu.herokuapp.com",
|
||||
"https://lmdb.tokhmi.xyz"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"simplyTranslate": {
|
||||
"normal": [
|
||||
@ -397,30 +448,16 @@
|
||||
"https://lingva.lunar.icu",
|
||||
"https://lingva.opnxng.com"
|
||||
],
|
||||
"tor": []
|
||||
"tor": [],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"searx": {
|
||||
"tor": [
|
||||
"http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion",
|
||||
"http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion",
|
||||
"http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion",
|
||||
"http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion",
|
||||
"http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion",
|
||||
"http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion",
|
||||
"http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion",
|
||||
"http://searx.bsbvtqi5oq2cqzn32zt4cr2f2z2rwots3dq7gmdcnlyqoxko2wx6reqd.onion"
|
||||
],
|
||||
"i2p": [
|
||||
"http://ransack.i2p",
|
||||
"http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p"
|
||||
],
|
||||
"normal": [
|
||||
"https://anon.sx",
|
||||
"https://dynabyte.ca",
|
||||
"https://jsearch.pw",
|
||||
"https://nibblehole.com",
|
||||
"https://search.ethibox.fr",
|
||||
"https://search.jpope.org",
|
||||
"https://search.snopyta.org",
|
||||
"https://search.stinpriza.org",
|
||||
"https://search.trom.tf",
|
||||
@ -429,15 +466,12 @@
|
||||
"https://searx.dresden.network",
|
||||
"https://searx.fossencdi.org",
|
||||
"https://searx.gnu.style",
|
||||
"https://searx.josie.lol",
|
||||
"https://searx.mastodontech.de",
|
||||
"https://searx.mxchange.org",
|
||||
"https://searx.nakhan.net",
|
||||
"https://searx.netzspielplatz.de",
|
||||
"https://searx.nixnet.services",
|
||||
"https://searx.openhoofd.nl",
|
||||
"https://searx.org",
|
||||
"https://searx.ppeb.me",
|
||||
"https://searx.pwoss.org",
|
||||
"https://searx.rasp.fr",
|
||||
"https://searx.ru",
|
||||
@ -451,55 +485,63 @@
|
||||
"https://searx.webheberg.info",
|
||||
"https://searx.xyz",
|
||||
"https://searx.zapashcanon.fr",
|
||||
"https://searxng.ir",
|
||||
"https://spot.ecloud.global",
|
||||
"https://suche.dasnetzundich.de",
|
||||
"https://suche.tromdienste.de",
|
||||
"https://suche.uferwerk.org",
|
||||
"https://sx.catgirl.cloud",
|
||||
"https://timdor.noip.me/searx",
|
||||
"https://www.gruble.de",
|
||||
"https://searx.roflcopter.fr"
|
||||
]
|
||||
],
|
||||
"tor": [
|
||||
"http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion",
|
||||
"http://w5rl6wsd7mzj4bdkbuqvzidet5osdsm5jhg2f7nvfidakfq5exda5wid.onion",
|
||||
"http://yra4tke2pwcnatxjkufpw6kvebu3h3ti2jca2lcdpgx3mpwol326lzid.onion",
|
||||
"http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion",
|
||||
"http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion",
|
||||
"http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion"
|
||||
],
|
||||
"i2p": [
|
||||
"http://ransack.i2p",
|
||||
"http://mqamk4cfykdvhw5kjez2gnvse56gmnqxn7vkvvbuor4k4j2lbbnq.b32.i2p"
|
||||
],
|
||||
"loki": []
|
||||
},
|
||||
"searxng": {
|
||||
"tor": [
|
||||
"http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion",
|
||||
"http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion",
|
||||
"http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion",
|
||||
"http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion",
|
||||
"http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion",
|
||||
"http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion",
|
||||
"http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion",
|
||||
"http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion",
|
||||
"http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion"
|
||||
],
|
||||
"i2p": [],
|
||||
"normal": [
|
||||
"https://darmarit.org/searx",
|
||||
"https://de.xcxc.ml",
|
||||
"https://etsi.me",
|
||||
"https://icanfindit.online",
|
||||
"https://jackgoss.xyz",
|
||||
"https://northboot.xyz",
|
||||
"https://notgoogle.win",
|
||||
"https://opnxng.com",
|
||||
"https://paulgo.io",
|
||||
"https://priv.au",
|
||||
"https://private-searx.ml",
|
||||
"https://privatus.live",
|
||||
"https://s.frlt.one",
|
||||
"https://s.zhaocloud.net",
|
||||
"https://search.affusio.com",
|
||||
"https://search.ashs.club",
|
||||
"https://search.bingowaves.xyz",
|
||||
"https://search.bus-hit.me",
|
||||
"https://search.chemicals-in-the-water.eu",
|
||||
"https://search.disroot.org",
|
||||
"https://search.gcomm.ch",
|
||||
"https://search.kiwitalk.de",
|
||||
"https://search.mdosch.de",
|
||||
"https://search.neet.works",
|
||||
"https://search.ononoki.org",
|
||||
"https://search.privacyguides.net",
|
||||
"https://search.projectsegfau.lt",
|
||||
"https://search.rabbit-company.com",
|
||||
"https://search.sapti.me",
|
||||
"https://search.teamriverbubbles.com",
|
||||
"https://search.unlocked.link",
|
||||
"https://search.vojkovic.xyz",
|
||||
"https://search.vidhukant.xyz",
|
||||
"https://search.zzls.xyz",
|
||||
"https://searx.albony.xyz",
|
||||
"https://searx.be",
|
||||
"https://searx.becomesovran.com",
|
||||
"https://searx.chocoflan.net",
|
||||
@ -509,7 +551,6 @@
|
||||
"https://searx.fi",
|
||||
"https://searx.fmac.xyz",
|
||||
"https://searx.gnous.eu",
|
||||
"https://searx.kujonello.cf",
|
||||
"https://searx.loafland.xyz",
|
||||
"https://searx.mha.fi",
|
||||
"https://searx.mistli.net",
|
||||
@ -517,24 +558,40 @@
|
||||
"https://searx.orion-hub.fr",
|
||||
"https://searx.priv.pw",
|
||||
"https://searx.prvcy.eu",
|
||||
"https://searx.rimkus.it",
|
||||
"https://searx.sethforprivacy.com",
|
||||
"https://searx.sev.monster",
|
||||
"https://searx.slipfox.xyz/searx",
|
||||
"http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx",
|
||||
"https://searx.tiekoetter.com",
|
||||
"https://searx.vimproved.me",
|
||||
"https://searx.youshitsune.me",
|
||||
"https://searx.zcyph.cc",
|
||||
"https://searxng.au/searx",
|
||||
"https://searxng.ir",
|
||||
"https://searxng.tordenskjold.de",
|
||||
"https://searxng.zackptg5.com",
|
||||
"https://serx.ml",
|
||||
"https://srx.cosmohub.io",
|
||||
"https://swag.pw",
|
||||
"https://www.gruble.de",
|
||||
"https://www.webrats.xyz",
|
||||
"https://xcxc.ml"
|
||||
]
|
||||
],
|
||||
"tor": [
|
||||
"http://4n53nafyi77iplnbrpmxnp3x4exbswwxigujaxy3b37fvr7bvlopxeyd.onion",
|
||||
"http://x5gdjh6t7kb4yubpufhtc3l3df2acev3emxdasd5vyuyoon5rzf5zkyd.onion",
|
||||
"http://search3q76rqpektbrchlf2rjq4fnbxzeov6rljdywg3nwbunpgd7bid.onion",
|
||||
"http://searchoorwalty5a2ailrboa2asqyts2u7bdoqwnjefpgjobpvtzn4qd.onion",
|
||||
"http://gbat2pbpg7ys3fi3pbp64667tt5x66mg45xok35bxdw7v55brm7a27yd.onion",
|
||||
"http://searxdr3pqz4nydgnqocsia2xbywptxbkympa2emn7zlgggrir4bkfad.onion",
|
||||
"http://searx.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion",
|
||||
"http://searx.privpw3tndpkw6pnp3g727zfgfdzbu3k6a7chv226s3xymv2p4eiuqyd.onion",
|
||||
"http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion",
|
||||
"http://fub6vgedgeadlu3ctskrpkcqjruh76tckwtj5swfhyblgml2tzgzckqd.onion/searx",
|
||||
"http://searx3aolosaf3urwnhpynlhuokqsgz47si4pzz5hvb7uuzyjncl2tid.onion",
|
||||
"http://4tz2vlnwk2apf2rpinkqv6uxvfgo5xjx6vl5vp7lxgaiooumetjpstqd.onion"
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"whoogle": {
|
||||
"normal": [
|
||||
@ -553,7 +610,24 @@
|
||||
"https://search.wef.lol"
|
||||
],
|
||||
"tor": [],
|
||||
"i2p": []
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"librex": {
|
||||
"normal": [
|
||||
"https://librex.beparanoid.de",
|
||||
"https://search.davidovski.xyz",
|
||||
"https://search.funami.tech",
|
||||
"https://librex.catalyst.sx"
|
||||
],
|
||||
"tor": [
|
||||
"http://librex.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion",
|
||||
"http://librex.so2mpiyfo4cje7bof5v52y3cvjyo2haxpqfvut4sr6gj2ul4mddx2jid.onion"
|
||||
],
|
||||
"i2p": [
|
||||
"http://fboseyskrqpi6yjiifvz4ryuoiswjezkqsfxfkm2vmbuhehbpr7q.b32.i2p"
|
||||
],
|
||||
"loki": []
|
||||
},
|
||||
"rimgo": {
|
||||
"normal": [
|
||||
@ -565,21 +639,138 @@
|
||||
"https://i.actionsack.com",
|
||||
"https://rimgo.privacydev.net",
|
||||
"https://imgur.artemislena.eu",
|
||||
"https://rimgo.vern.cc"
|
||||
"https://rimgo.vern.cc",
|
||||
"https://rimgo.encrypted-data.xyz",
|
||||
"https://rimgo.mha.fi"
|
||||
],
|
||||
"tor": [
|
||||
"http://rimgo.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion",
|
||||
"http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"
|
||||
"http://rimgo.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion",
|
||||
"http://rimgo.micohauwkjbyw5meacrb4ipicwvwg4xtzl7y7viv53kig2mdcsvwkyyd.onion"
|
||||
],
|
||||
"i2p": []
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"librarian": {
|
||||
"normal": [
|
||||
"https://lbry.bcow.xyz",
|
||||
"https://odysee.076.ne.jp",
|
||||
"https://librarian.pussthecat.org",
|
||||
"https://lbry.mutahar.rocks",
|
||||
"https://librarian.esmailelbob.xyz",
|
||||
"https://lbry.vern.cc"
|
||||
],
|
||||
"tor": [
|
||||
"http://librarian.lqs5fjmajyp7rvp4qvyubwofzi6d4imua7vs237rkc4m5qogitqwrgyd.onion",
|
||||
"http://lbry.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion"
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
},
|
||||
"peertube": [
|
||||
"https://pire.artisanlogiciel.net",
|
||||
"https://trutube.xyz",
|
||||
"https://tube-test.apps.education.fr",
|
||||
"https://tube-sciences-technologies.apps.education.fr",
|
||||
"https://stream.conesphere.cloud",
|
||||
"https://tube-institutionnel.apps.education.fr",
|
||||
"https://trutube.online",
|
||||
"https://tube-cycle-3.apps.education.fr",
|
||||
"https://video.manicphase.me",
|
||||
"https://tube.emy.plus",
|
||||
"https://v.bearvideo.win",
|
||||
"https://tubulus.openlatin.org",
|
||||
"https://peertube.securetown.top",
|
||||
"https://tv.datamol.org",
|
||||
"https://video.graine-pdl.org",
|
||||
"https://tube.zee.li",
|
||||
"https://tube-cycle-2.apps.education.fr",
|
||||
"https://mikeclips.net",
|
||||
"https://tube.s1gm4.eu",
|
||||
"https://videos.keyedlimepie.org",
|
||||
"https://video.cpn.so",
|
||||
"https://video.davduf.net",
|
||||
"https://tube.oldkid.digital",
|
||||
"https://tube.fofoca.eu",
|
||||
"https://tube-langues-vivantes.apps.education.fr",
|
||||
"https://tube-arts-lettres-sciences-humaines.apps.education.fr",
|
||||
"https://videos.scanlines.xyz",
|
||||
"https://video.kicik.fr",
|
||||
"https://media.theplattform.net",
|
||||
"https://peertube.offerman.com",
|
||||
"https://v.lastorder.xyz",
|
||||
"https://video.eradicatinglove.xyz",
|
||||
"https://peertube.thele.me",
|
||||
"https://video.schnitzler.one",
|
||||
"https://tube.cybershock.life",
|
||||
"https://tube.reseau-canope.fr",
|
||||
"https://frentube.myyouniverse.observer",
|
||||
"https://tube-maternelle.apps.education.fr",
|
||||
"https://peertube.onionstorm.net",
|
||||
"https://dev.dollarvigilante.tv",
|
||||
"https://video.trankil.info",
|
||||
"https://video.uriopss-pdl.fr",
|
||||
"https://pt.bolapara.mywire.org",
|
||||
"https://ptube.ranranhome.info",
|
||||
"https://vidid.pl",
|
||||
"https://video.3cmr.fr",
|
||||
"https://tube.die-rote-front.de",
|
||||
"https://peertube.miguelcr.me",
|
||||
"https://video.thinkof.name",
|
||||
"https://nekofans.tv",
|
||||
"https://video.comun.al",
|
||||
"https://peertube.nrsk.no",
|
||||
"https://video.occm.cc",
|
||||
"https://peertube.viviers-fibre.net",
|
||||
"https://tube-action-educative.apps.education.fr",
|
||||
"https://themadlads.live",
|
||||
"https://jahve.pl",
|
||||
"https://videos.yesil.club",
|
||||
"https://peertube.adjutor.xyz",
|
||||
"https://peertube.terranout.mine.nu",
|
||||
"https://tube.hunterjozwiak.com",
|
||||
"https://tube-numerique-educatif.apps.education.fr",
|
||||
"https://tube.itsg.host",
|
||||
"https://tube.valinor.fr",
|
||||
"https://lucarne.balsamine.be",
|
||||
"https://peertube.suranyami.com",
|
||||
"https://video.ados.accoord.fr",
|
||||
"https://t.0x0.st",
|
||||
"https://tube-education-physique-et-sportive.apps.education.fr",
|
||||
"https://videos.lemouvementassociatif-pdl.org",
|
||||
"https://videos.casually.cat",
|
||||
"https://playroom.kitsunes.world",
|
||||
"https://tube2.nous.media",
|
||||
"https://peertube.freenet.ru",
|
||||
"https://peertube.0x5e.eu",
|
||||
"https://tube.darknight-coffee.org",
|
||||
"https://play.mittdata.se",
|
||||
"https://peertube.lhc.net.br",
|
||||
"https://see.vtopia.live",
|
||||
"https://peertube.letoine.fr",
|
||||
"https://tube-enseignement-professionnel.apps.education.fr",
|
||||
"https://socpeertube.ru",
|
||||
"https://videos.laliguepaysdelaloire.org",
|
||||
"https://videotube.duckdns.org",
|
||||
"https://quantube.win",
|
||||
"https://twctube.twc-zone.eu",
|
||||
"https://vhs.absturztau.be",
|
||||
"https://video.espr.moe",
|
||||
"https://peertube.social.my-wan.de",
|
||||
"https://phijkchu.com",
|
||||
"https://video.lycee-experimental.org",
|
||||
"https://galileo.news",
|
||||
"https://peertube.otakufarms.com",
|
||||
"https://tube.motuhake.xyz",
|
||||
"https://pt.m0r016.net",
|
||||
"https://hitchtube.fr",
|
||||
"https://video.fox-romka.ru",
|
||||
"https://peertube.ctrl-c.liu.se",
|
||||
"https://peertube.live",
|
||||
"https://video.slipfox.xyz",
|
||||
"https://pt.vern.cc",
|
||||
"https://3.600900.su",
|
||||
"https://vnop.org",
|
||||
"https://videos.cassidypunchmachine.com",
|
||||
"https://video.mullet.social",
|
||||
"https://tv1.gomntu.space",
|
||||
"https://dalek.zone",
|
||||
"https://seka.pona.la",
|
||||
@ -588,7 +779,6 @@
|
||||
"https://tube.miegl.cz",
|
||||
"https://mov.clov.fr",
|
||||
"https://videomensoif.ynh.fr",
|
||||
"https://peertube.hainry.fr",
|
||||
"https://videos.neongarden.life",
|
||||
"https://video.vaku.org.ua",
|
||||
"https://videos.trom.lt",
|
||||
@ -626,7 +816,6 @@
|
||||
"https://turkum.me",
|
||||
"https://video.colibris-outilslibres.org",
|
||||
"https://invoice.peertube.biz",
|
||||
"https://vnhup.com",
|
||||
"https://peertube.chantierlibre.org",
|
||||
"https://video.9wd.eu",
|
||||
"https://video.niboe.info",
|
||||
@ -638,10 +827,8 @@
|
||||
"https://tube.nestor.coop",
|
||||
"https://live.oldskool.fi",
|
||||
"https://dytube.com",
|
||||
"https://video.toby3d.me",
|
||||
"https://tube.thierrytalbert.fr",
|
||||
"https://peertube.informaction.info",
|
||||
"https://peertube.thele.me",
|
||||
"https://tube.ac-amiens.fr",
|
||||
"https://tube.alado.space",
|
||||
"https://tube.network.europa.eu",
|
||||
@ -653,7 +840,6 @@
|
||||
"https://cliptube.org",
|
||||
"https://tube.tr4sk.me",
|
||||
"https://videos.campdarling.com",
|
||||
"https://peertube.live",
|
||||
"https://video.mikka.md",
|
||||
"https://www.aktion-nordost.tv",
|
||||
"https://tube.rooty.fr",
|
||||
@ -683,15 +869,12 @@
|
||||
"https://videopen.net",
|
||||
"https://demo.lioncast.org",
|
||||
"https://peertube.get-racing.de",
|
||||
"https://tube-rennes.beta.education.fr",
|
||||
"https://pierre.tube",
|
||||
"https://mirametube.fr",
|
||||
"https://tube.sanyi.nl",
|
||||
"https://vidz.dou.bet",
|
||||
"https://videos.redeyes.site",
|
||||
"https://video.hostpath.de",
|
||||
"https://free-streams.com",
|
||||
"https://video.chadwaltercummings.me",
|
||||
"https://tube.pawelko.net",
|
||||
"https://video.livecchi.cloud",
|
||||
"https://anarchy.video",
|
||||
@ -716,7 +899,6 @@
|
||||
"https://tube.linc.systems",
|
||||
"https://peertube.ketchup.noho.st",
|
||||
"https://yt.x1337x.fr",
|
||||
"https://video.wsforum.net",
|
||||
"https://videos.rabbit-company.com",
|
||||
"https://video.paradigmthreat.net",
|
||||
"https://video.lincolncyber.com",
|
||||
@ -751,8 +933,6 @@
|
||||
"https://tube.globalfrens.com",
|
||||
"https://peertube.hacknews.pmdcollab.org",
|
||||
"https://freetubes.nohost.me",
|
||||
"https://video.simplex-software.ru",
|
||||
"https://wwtube.net",
|
||||
"https://video.snug.moe",
|
||||
"https://video.avant-le-strike.buzz",
|
||||
"https://videos.ritimo.org",
|
||||
@ -760,7 +940,6 @@
|
||||
"https://video.cerclearistote.com",
|
||||
"https://computerstuff.mooo.com",
|
||||
"https://video.greenmycity.eu",
|
||||
"https://peertubemirror.satoshishop.de",
|
||||
"https://przej.me",
|
||||
"https://pt.mezzo.moe",
|
||||
"https://tube.dsocialize.net",
|
||||
@ -773,19 +952,15 @@
|
||||
"https://tube.nx12.net",
|
||||
"https://redundant2.peertube.support",
|
||||
"https://peertube.ignifi.me",
|
||||
"https://docker.videos.lecygnenoir.info",
|
||||
"https://tv.based.quest",
|
||||
"https://peertube.beardedtek.com",
|
||||
"https://casnocensure.site",
|
||||
"https://creemoseducacioninclusiva.uma.es",
|
||||
"https://videos.yeswiki.net",
|
||||
"https://tube.lrk.sh",
|
||||
"https://peertube.teneriffe.nohost.me",
|
||||
"https://peertube.autogestioncitoyenne.org",
|
||||
"https://stream.dynacloud.ynh.fr",
|
||||
"https://video.r3s.nrw",
|
||||
"https://peertube.semweb.pro",
|
||||
"https://sneedtube.com",
|
||||
"https://poast.tv",
|
||||
"https://testube.distrilab.fr",
|
||||
"https://peertube.rse43.com",
|
||||
@ -793,7 +968,6 @@
|
||||
"https://vid.lelux.fi",
|
||||
"https://v.wolfskaempf.de",
|
||||
"https://peertube.chevro.fr",
|
||||
"https://peertube.minecloud.ro",
|
||||
"https://media.econoalchemist.com",
|
||||
"https://video.qoto.org",
|
||||
"https://peertube.maxweiss.io",
|
||||
@ -818,7 +992,6 @@
|
||||
"https://swebbtube.se",
|
||||
"https://video.dnfi.no",
|
||||
"https://peertube.revelin.fr",
|
||||
"https://video.wsf2021.info",
|
||||
"https://armstube.com",
|
||||
"https://peertube.ti-fr.com",
|
||||
"https://video.turbo.chat",
|
||||
@ -859,9 +1032,7 @@
|
||||
"https://tube.1o1.io",
|
||||
"https://peertube.aventer.biz",
|
||||
"https://videos.rights.ninja",
|
||||
"https://pertur.be",
|
||||
"https://tube.pilgerweg-21.de",
|
||||
"https://freediverse.com",
|
||||
"https://pocketnetpeertube2.nohost.me",
|
||||
"https://peertube.bubbletea.dev",
|
||||
"https://peertube.art3mis.de",
|
||||
@ -900,7 +1071,6 @@
|
||||
"https://dud-video.inf.tu-dresden.de",
|
||||
"https://media-test.interior.edu.uy",
|
||||
"https://media.interior.edu.uy",
|
||||
"https://bitcast.online",
|
||||
"https://peertube.la-scic.fr",
|
||||
"https://phoenixproject.group",
|
||||
"https://peertube.sebu77.com",
|
||||
@ -938,7 +1108,6 @@
|
||||
"https://video.liveitlive.show",
|
||||
"https://vid.plantplotting.co.uk",
|
||||
"https://video.telemillevaches.net",
|
||||
"https://p.nogafa.org",
|
||||
"https://tv.pirati.cz",
|
||||
"https://peertube.therealblue.de",
|
||||
"https://tube.nuxnik.com",
|
||||
@ -948,7 +1117,6 @@
|
||||
"https://tube.communia.org",
|
||||
"https://peertube.dragonborn.app",
|
||||
"https://ai-tube.ch",
|
||||
"https://buddhist.tv",
|
||||
"https://video.citizen4.eu",
|
||||
"https://video.matomocamp.org",
|
||||
"https://media.fsfe.org",
|
||||
@ -984,7 +1152,6 @@
|
||||
"https://video.rubdos.be",
|
||||
"https://tube.tuxfriend.fr",
|
||||
"https://anarchy.tube",
|
||||
"https://nsfw.vger.cloud",
|
||||
"https://tube.elemac.fr",
|
||||
"https://tube.nocturlab.fr",
|
||||
"https://videos.optoutpod.com",
|
||||
@ -1005,7 +1172,6 @@
|
||||
"https://peertube.tangentfox.com",
|
||||
"https://puffy.tube",
|
||||
"https://tube.kher.nl",
|
||||
"https://perceptiontravel.tv",
|
||||
"https://watch.ocaml.org",
|
||||
"https://peertube.kleph.eu",
|
||||
"https://tube.missbanal.net",
|
||||
@ -1021,7 +1187,6 @@
|
||||
"https://video.ustim.ru",
|
||||
"https://merci-la-police.fr",
|
||||
"https://pocketnetpeertube7.nohost.me",
|
||||
"https://tube.noise.rocks",
|
||||
"https://video.rhizome.org",
|
||||
"https://dnk.video",
|
||||
"https://video.medienzentrum-harburg.de",
|
||||
@ -1086,7 +1251,6 @@
|
||||
"https://libra.syntazia.org",
|
||||
"https://peertube.beeldengeluid.nl",
|
||||
"https://tv.lumbung.space",
|
||||
"https://vid.dascoyote.xyz",
|
||||
"https://peertube.cuatrolibertades.org",
|
||||
"https://videos.hush.is",
|
||||
"https://tube.ebin.club",
|
||||
@ -1096,7 +1260,6 @@
|
||||
"https://video.migennes.net",
|
||||
"https://irrsinn.video",
|
||||
"https://pocketnetpeertube4.nohost.me",
|
||||
"https://video.omniatv.com",
|
||||
"https://comf.tube",
|
||||
"https://pocketnetpeertube6.nohost.me",
|
||||
"https://pocketnetpeertube5.nohost.me",
|
||||
@ -1118,7 +1281,6 @@
|
||||
"https://video.shitposter.club",
|
||||
"https://tv.mattchristiansenmedia.com",
|
||||
"https://tube.hackerscop.org",
|
||||
"https://videos.capas.se",
|
||||
"https://peertube.kx.studio",
|
||||
"https://videos.3d-wolf.com",
|
||||
"https://tube.octaplex.net",
|
||||
@ -1155,7 +1317,6 @@
|
||||
"https://videos.benjaminbrady.ie",
|
||||
"https://video.binarydad.com",
|
||||
"https://tube.pmj.rocks",
|
||||
"https://gary.vger.cloud",
|
||||
"https://video.guerredeclasse.fr",
|
||||
"https://ptmir4.inter21.net",
|
||||
"https://ptmir3.inter21.net",
|
||||
@ -1172,7 +1333,6 @@
|
||||
"https://tube.kotur.org",
|
||||
"https://peertube.euskarabildua.eus",
|
||||
"https://video.veloma.org",
|
||||
"https://vidcommons.org",
|
||||
"https://regarder.sans.pub",
|
||||
"https://tube.rhythms-of-resistance.org",
|
||||
"https://tube-bordeaux.beta.education.fr",
|
||||
@ -1218,7 +1378,6 @@
|
||||
"https://evangelisch.video",
|
||||
"https://tube.anufrij.de",
|
||||
"https://videos.mastodont.cat",
|
||||
"https://flim.txmn.tk",
|
||||
"https://video.taboulisme.com",
|
||||
"https://media.undeadnetwork.de",
|
||||
"https://tube.dragonpsi.xyz",
|
||||
@ -1295,7 +1454,6 @@
|
||||
"https://www4.mir.inter21.net",
|
||||
"https://video.csc49.fr",
|
||||
"https://tube.wolfe.casa",
|
||||
"https://tube.linkse.media",
|
||||
"https://video.dresden.network",
|
||||
"https://peertube.zapashcanon.fr",
|
||||
"https://40two.tube",
|
||||
@ -1304,7 +1462,6 @@
|
||||
"https://kino.schuerz.at",
|
||||
"https://peertube.tiennot.net",
|
||||
"https://tututu.tube",
|
||||
"https://peertube.interhop.org",
|
||||
"https://tube.picasoft.net",
|
||||
"https://www.wiki-tube.de",
|
||||
"https://videos.pair2jeux.tube",
|
||||
@ -1334,7 +1491,6 @@
|
||||
"https://xxx.noho.st",
|
||||
"https://peertube.stefofficiel.me",
|
||||
"https://canard.tube",
|
||||
"https://videos.jordanwarne.xyz",
|
||||
"https://tube.jeena.net",
|
||||
"https://tube.cloud-libre.eu",
|
||||
"https://videos.coletivos.org",
|
||||
@ -1354,7 +1510,6 @@
|
||||
"https://tube.others.social",
|
||||
"https://videos.ubuntu-paris.org",
|
||||
"https://tube-poitiers.beta.education.fr",
|
||||
"https://streamsource.video",
|
||||
"https://vid.wildeboer.net",
|
||||
"https://battlepenguin.video",
|
||||
"https://peertube.cloud.sans.pub",
|
||||
@ -1380,7 +1535,6 @@
|
||||
"https://peertube.devloprog.org",
|
||||
"https://peertube.designersethiques.org",
|
||||
"https://testtube.florimond.eu",
|
||||
"https://tube.gnous.eu",
|
||||
"https://tube-lille.beta.education.fr",
|
||||
"https://peertube.monlycee.net",
|
||||
"https://tube.plomlompom.com",
|
||||
@ -1454,7 +1608,6 @@
|
||||
"https://video.oh14.de",
|
||||
"https://mytube.madzel.de",
|
||||
"https://monplaisirtube.ddns.net",
|
||||
"https://video.okaris.de",
|
||||
"https://video.blender.org",
|
||||
"https://peertube.020.pl",
|
||||
"https://tube.azbyka.ru",
|
||||
@ -1510,14 +1663,12 @@
|
||||
"https://video.lemediatv.fr",
|
||||
"https://peertube.artica.center",
|
||||
"https://indymotion.fr",
|
||||
"https://video.farci.org",
|
||||
"https://tube.fede.re",
|
||||
"https://peertube.mygaia.org",
|
||||
"https://peertube.livingutopia.org",
|
||||
"https://tube.anjara.eu",
|
||||
"https://video.latavernedejohnjohn.fr",
|
||||
"https://peertube.pcservice46.fr",
|
||||
"https://alttube.fr",
|
||||
"https://video.coop.tools",
|
||||
"https://video.cabane-libre.org",
|
||||
"https://peertube.openstreetmap.fr",
|
||||
@ -1550,7 +1701,6 @@
|
||||
"https://www.yiny.org",
|
||||
"https://video.typica.us",
|
||||
"https://videos.lescommuns.org",
|
||||
"https://dialup.express",
|
||||
"https://peertube.1312.media",
|
||||
"https://skeptikon.fr",
|
||||
"https://video.blueline.mg",
|
||||
@ -1562,20 +1712,6 @@
|
||||
"https://peertube.qtg.fr",
|
||||
"https://tube.p2p.legal",
|
||||
"https://troll.tv",
|
||||
"https://videos.iut-orsay.fr",
|
||||
"https://peertube.solidev.net",
|
||||
"https://videos.cemea.org",
|
||||
"https://video.passageenseine.fr",
|
||||
"https://peertube.touhoppai.moe",
|
||||
"https://share.tube",
|
||||
"https://peertube.heraut.eu",
|
||||
"https://peertube.gegeweb.eu",
|
||||
"https://framatube.org",
|
||||
"https://tube.conferences-gesticulees.net",
|
||||
"https://peertube.datagueule.tv",
|
||||
"https://video.lqdn.fr",
|
||||
"https://peertube3.cpy.re",
|
||||
"https://peertube2.cpy.re",
|
||||
"https://peertube.cpy.re"
|
||||
"https://videos.iut-orsay.fr"
|
||||
]
|
||||
}
|
||||
}
|
@ -87,6 +87,8 @@ def invidious():
|
||||
invidiousList = {}
|
||||
invidiousList['normal'] = []
|
||||
invidiousList['tor'] = []
|
||||
invidiousList['i2p'] = []
|
||||
invidiousList['loki'] = []
|
||||
for instance in rJson:
|
||||
if instance[1]['type'] == 'https':
|
||||
invidiousList['normal'].append(instance[1]['uri'])
|
||||
@ -103,6 +105,23 @@ def piped():
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Piped')
|
||||
|
||||
|
||||
def pipedMaterial():
|
||||
r = requests.get(
|
||||
'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md')
|
||||
|
||||
tmp = re.findall(
|
||||
r"\| (https?:\/{2}(?:.+\.)+[a-zA-Z0-9]*) +\|", r.text)
|
||||
pipedMaterialList = {}
|
||||
pipedMaterialList['normal'] = []
|
||||
pipedMaterialList['tor'] = []
|
||||
pipedMaterialList['i2p'] = []
|
||||
pipedMaterialList['loki'] = []
|
||||
for item in tmp:
|
||||
pipedMaterialList['normal'].append(item)
|
||||
mightyList['pipedMaterial'] = pipedMaterialList
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'pipedMaterial')
|
||||
|
||||
|
||||
def proxitok():
|
||||
r = requests.get(
|
||||
'https://raw.githubusercontent.com/wiki/pablouser1/ProxiTok/Public-instances.md')
|
||||
@ -112,6 +131,8 @@ def proxitok():
|
||||
proxiTokList = {}
|
||||
proxiTokList['normal'] = []
|
||||
proxiTokList['tor'] = []
|
||||
proxiTokList['i2p'] = []
|
||||
proxiTokList['loki'] = []
|
||||
for item in tmp:
|
||||
proxiTokList['normal'].append(re.sub(r'/$', '', item))
|
||||
mightyList['proxiTok'] = proxiTokList
|
||||
@ -126,6 +147,8 @@ def send():
|
||||
sendList = {}
|
||||
sendList['normal'] = []
|
||||
sendList['tor'] = []
|
||||
sendList['i2p'] = []
|
||||
sendList['loki'] = []
|
||||
for item in tmp:
|
||||
sendList['normal'].append(item)
|
||||
mightyList['send'] = sendList
|
||||
@ -142,6 +165,8 @@ def nitter():
|
||||
nitterList = {}
|
||||
nitterList['normal'] = []
|
||||
nitterList['tor'] = []
|
||||
nitterList['i2p'] = []
|
||||
nitterList['loki'] = []
|
||||
for table in tables:
|
||||
tbody = table.find('tbody')
|
||||
trs = tbody.find_all('tr')
|
||||
@ -160,11 +185,13 @@ def nitter():
|
||||
|
||||
|
||||
def bibliogram():
|
||||
r = requests.get('https://bibliogram.pussthecat.org/api/instances')
|
||||
r = requests.get('https://bibliogram.art/api/instances')
|
||||
rJson = json.loads(r.text)
|
||||
bibliogramList = {}
|
||||
bibliogramList['normal'] = []
|
||||
bibliogramList['tor'] = []
|
||||
bibliogramList['i2p'] = []
|
||||
bibliogramList['loki'] = []
|
||||
for item in rJson['data']:
|
||||
bibliogramList['normal'].append(item['address'])
|
||||
mightyList['bibliogram'] = bibliogramList
|
||||
@ -177,13 +204,14 @@ def libreddit():
|
||||
libredditList = {}
|
||||
libredditList['normal'] = []
|
||||
libredditList['tor'] = []
|
||||
libredditList['i2p'] = []
|
||||
libredditList['loki'] = []
|
||||
|
||||
tmp = re.findall(
|
||||
r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text)
|
||||
|
||||
|
||||
for item in tmp:
|
||||
if item.endswith('.onion'):
|
||||
if re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
libredditList['tor'].append(item)
|
||||
else:
|
||||
libredditList['normal'].append(item)
|
||||
@ -198,6 +226,8 @@ def teddit():
|
||||
tedditList = {}
|
||||
tedditList['normal'] = []
|
||||
tedditList['tor'] = []
|
||||
tedditList['i2p'] = []
|
||||
tedditList['loki'] = []
|
||||
for item in rJson:
|
||||
url = item['url']
|
||||
if url != '':
|
||||
@ -218,13 +248,17 @@ def wikiless():
|
||||
wikilessList['normal'] = []
|
||||
wikilessList['tor'] = []
|
||||
wikilessList['i2p'] = []
|
||||
wikilessList['loki'] = []
|
||||
for item in rJson:
|
||||
if 'url' in item:
|
||||
wikilessList['normal'].append(item['url'])
|
||||
if item['url'].strip() != "":
|
||||
wikilessList['normal'].append(item['url'])
|
||||
if 'onion' in item:
|
||||
wikilessList['tor'].append(item['onion'])
|
||||
if item['onion'].strip() != "":
|
||||
wikilessList['tor'].append(item['onion'])
|
||||
if 'i2p' in item:
|
||||
wikilessList['i2p'].append(item['i2p'])
|
||||
if item['i2p'].strip() != "":
|
||||
wikilessList['i2p'].append(item['i2p'])
|
||||
mightyList['wikiless'] = wikilessList
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Wikiless')
|
||||
|
||||
@ -236,6 +270,8 @@ def scribe():
|
||||
scribeList = {}
|
||||
scribeList['normal'] = []
|
||||
scribeList['tor'] = []
|
||||
scribeList['i2p'] = []
|
||||
scribeList['loki'] = []
|
||||
for item in rJson:
|
||||
scribeList['normal'].append(item)
|
||||
mightyList['scribe'] = scribeList
|
||||
@ -248,13 +284,15 @@ def quetre():
|
||||
_list = {}
|
||||
_list['normal'] = []
|
||||
_list['tor'] = []
|
||||
_list['i2p'] = []
|
||||
_list['loki'] = []
|
||||
|
||||
tmp = re.findall(
|
||||
r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text)
|
||||
|
||||
|
||||
for item in tmp:
|
||||
if item.endswith('.onion'):
|
||||
if re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
_list['tor'].append(item)
|
||||
else:
|
||||
_list['normal'].append(item)
|
||||
@ -268,6 +306,8 @@ def libremdb():
|
||||
_list = {}
|
||||
_list['normal'] = []
|
||||
_list['tor'] = []
|
||||
_list['i2p'] = []
|
||||
_list['loki'] = []
|
||||
|
||||
tmp = re.findall(
|
||||
r"\| ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)*\|*[A-Z]{0,}.*\|.*\|", r.text)
|
||||
@ -276,7 +316,7 @@ def libremdb():
|
||||
for item in tmp:
|
||||
if item.strip() == "":
|
||||
continue
|
||||
if item.endswith('.onion'):
|
||||
if re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
_list['tor'].append(item)
|
||||
else:
|
||||
_list['normal'].append(item)
|
||||
@ -318,6 +358,8 @@ def linvgatranslate():
|
||||
lingvaList = {}
|
||||
lingvaList['normal'] = []
|
||||
lingvaList['tor'] = []
|
||||
lingvaList['i2p'] = []
|
||||
lingvaList['loki'] = []
|
||||
for item in rJson:
|
||||
lingvaList['normal'].append(item)
|
||||
|
||||
@ -329,20 +371,22 @@ def searx_searxng():
|
||||
r = requests.get('https://searx.space/data/instances.json')
|
||||
rJson = json.loads(r.text)
|
||||
searxList = {}
|
||||
searxList['normal'] = []
|
||||
searxList['tor'] = []
|
||||
searxList['i2p'] = []
|
||||
searxList['normal'] = []
|
||||
searxList['loki'] = []
|
||||
searxngList = {}
|
||||
searxngList['normal'] = []
|
||||
searxngList['tor'] = []
|
||||
searxngList['i2p'] = []
|
||||
searxngList['normal'] = []
|
||||
searxngList['loki'] = []
|
||||
for item in rJson['instances']:
|
||||
if item[:-1].endswith('.onion'):
|
||||
if re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item[:-1]):
|
||||
if (rJson['instances'][item].get('generator') == 'searxng'):
|
||||
searxngList['tor'].append(item[:-1])
|
||||
else:
|
||||
searxList['tor'].append(item[:-1])
|
||||
elif item[:-1].endswith('.i2p'):
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+i2p(?:\/[a-zA-Z0-9]+)*\/?", item[:-1]):
|
||||
if (rJson['instances'][item].get('generator') == 'searxng'):
|
||||
searxngList['i2p'].append(item[:-1])
|
||||
else:
|
||||
@ -366,10 +410,11 @@ def whoogle():
|
||||
whoogleList['normal'] = []
|
||||
whoogleList['tor'] = []
|
||||
whoogleList['i2p'] = []
|
||||
whoogleList['loki'] = []
|
||||
for item in tmpList:
|
||||
if item.endswith('.onion'):
|
||||
if re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
whoogleList['tor'].append(item)
|
||||
elif item.endswith('.i2p'):
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+i2p(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
whoogleList['i2p'].append(item)
|
||||
else:
|
||||
whoogleList['normal'].append(item)
|
||||
@ -377,6 +422,31 @@ def whoogle():
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Whoogle')
|
||||
|
||||
|
||||
def librex():
|
||||
r = requests.get(
|
||||
'https://raw.githubusercontent.com/hnhx/librex/main/README.md')
|
||||
_list = {}
|
||||
_list['normal'] = []
|
||||
_list['tor'] = []
|
||||
_list['i2p'] = []
|
||||
_list['loki'] = []
|
||||
|
||||
tmp = re.findall(
|
||||
r"\| {1,2}\[(?:(?:[a-zA-Z0-9]+\.)+[a-zA-Z]{2,}|✅)\]\((https?:\/{2}(?:[a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,})", r.text)
|
||||
|
||||
for item in tmp:
|
||||
if item.strip() == "":
|
||||
continue
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
_list['tor'].append(item)
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+i2p(?:\/[a-zA-Z0-9]+)*\/?", item):
|
||||
_list['i2p'].append(item)
|
||||
else:
|
||||
_list['normal'].append(item)
|
||||
mightyList['librex'] = _list
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librex')
|
||||
|
||||
|
||||
def rimgo():
|
||||
r = requests.get(
|
||||
'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json')
|
||||
@ -385,6 +455,7 @@ def rimgo():
|
||||
rimgoList['normal'] = []
|
||||
rimgoList['tor'] = []
|
||||
rimgoList['i2p'] = []
|
||||
rimgoList['loki'] = []
|
||||
for item in rJson:
|
||||
if 'url' in item:
|
||||
rimgoList['normal'].append(item['url'])
|
||||
@ -396,6 +467,30 @@ def rimgo():
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Rimgo')
|
||||
|
||||
|
||||
def librarian():
|
||||
r = requests.get(
|
||||
'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json')
|
||||
rJson = json.loads(r.text)
|
||||
librarianList = {}
|
||||
librarianList['normal'] = []
|
||||
librarianList['tor'] = []
|
||||
librarianList['i2p'] = []
|
||||
librarianList['loki'] = []
|
||||
instances = rJson['instances']
|
||||
for item in instances:
|
||||
url = item['url']
|
||||
if url.strip() == "":
|
||||
continue
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+onion(?:\/[a-zA-Z0-9]+)*\/?", url):
|
||||
librarianList['tor'].append(url)
|
||||
elif re.search("https?:\/{2}(?:[a-zA-Z0-9]+\.)+i2p(?:\/[a-zA-Z0-9]+)*\/?", url):
|
||||
librarianList['i2p'].append(url)
|
||||
else:
|
||||
librarianList['normal'].append(url)
|
||||
mightyList['librarian'] = librarianList
|
||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librarian')
|
||||
|
||||
|
||||
def peertube():
|
||||
r = requests.get(
|
||||
'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt')
|
||||
@ -419,6 +514,7 @@ def isValid(url): # This code is contributed by avanitrachhadiya2155
|
||||
|
||||
invidious()
|
||||
piped()
|
||||
pipedMaterial()
|
||||
proxitok()
|
||||
send()
|
||||
nitter()
|
||||
@ -433,7 +529,9 @@ simplytranslate()
|
||||
linvgatranslate()
|
||||
searx_searxng()
|
||||
whoogle()
|
||||
librex()
|
||||
rimgo()
|
||||
librarian()
|
||||
mightyList = filterLastSlash(mightyList)
|
||||
|
||||
cloudflare = []
|
||||
|
@ -15,5 +15,7 @@
|
||||
],
|
||||
"tor": [
|
||||
"http://piped2bbch4xslbl2ckr6k62q56kon56ffowxaqzy42ai22a4sash3ad.onion"
|
||||
]
|
||||
}
|
||||
],
|
||||
"i2p": [],
|
||||
"loki": []
|
||||
}
|
@ -81,6 +81,7 @@ twitterHelper.pasteNitterCookies();
|
||||
wikipediaHelper.pasteWikilessCookies();
|
||||
searchHelper.pasteSearxCookies();
|
||||
searchHelper.pasteSearxngCookies();
|
||||
searchHelper.pasteLibrexCookies();
|
||||
redditHelper.pasteLibredditCookies();
|
||||
redditHelper.pasteTedditCookies();
|
||||
tiktokHelper.pasteProxiTokCookies();
|
||||
@ -257,4 +258,6 @@ browser.contextMenus.onClicked.addListener(
|
||||
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.function === 'unify') utils.unify(false).then(r => sendResponse({ response: r }))
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
browser.storage.local.set({"version": browser.runtime.getManifest().version})
|
||||
|
@ -14,8 +14,9 @@ await twitterHelper.pasteNitterCookies();
|
||||
await wikipediaHelper.pasteWikilessCookies();
|
||||
await searchHelper.pasteSearxCookies();
|
||||
await searchHelper.pasteSearxngCookies();
|
||||
await searchHelper.pasteLibrexCookies();
|
||||
await redditHelper.pasteLibredditCookies();
|
||||
await redditHelper.pasteTedditCookies();
|
||||
await tiktokHelper.pasteProxiTokCookies();
|
||||
|
||||
window.close()
|
||||
window.close()
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,7 @@ function exportSettings() {
|
||||
null,
|
||||
result => {
|
||||
let resultString = JSON.stringify(result, null, ' ');
|
||||
exportSettingsElement.href = 'data:application/json;base64,' + btoa(resultString);
|
||||
exportSettingsElement.href = 'data:application/json;base64,' + btoa(encodeURI(resultString));
|
||||
exportSettingsElement.download = 'libredirect-settings.json';
|
||||
}
|
||||
);
|
||||
@ -83,6 +83,7 @@ importSettingsElement.addEventListener("change",
|
||||
|
||||
await searchHelper.pasteSearxCookies();
|
||||
await searchHelper.pasteSearxngCookies();
|
||||
await searchHelper.pasteLibrexCookies();
|
||||
|
||||
await redditHelper.pasteLibredditCookies();
|
||||
await redditHelper.pasteTedditCookies();
|
||||
@ -150,9 +151,9 @@ resetSettings.addEventListener("click",
|
||||
);
|
||||
|
||||
let autoRedirectElement = document.getElementById("auto-redirect")
|
||||
autoRedirectElement.addEventListener("change",
|
||||
event => browser.storage.local.set({ autoRedirect: event.target.checked })
|
||||
);
|
||||
autoRedirectElement.addEventListener("change", event => {
|
||||
browser.storage.local.set({ autoRedirect: event.target.checked })
|
||||
});
|
||||
|
||||
let themeElement = document.getElementById("theme");
|
||||
themeElement.addEventListener("change", event => {
|
||||
@ -161,6 +162,18 @@ themeElement.addEventListener("change", event => {
|
||||
location.reload();
|
||||
})
|
||||
|
||||
let protocolElement = document.getElementById("protocol");
|
||||
protocolElement.addEventListener("change", event => {
|
||||
const value = event.target.options[protocol.selectedIndex].value;
|
||||
browser.storage.local.set({ protocol: value });
|
||||
location.reload();
|
||||
})
|
||||
|
||||
let protocolFallbackCheckbox = document.getElementById("protocol-fallback-checkbox")
|
||||
protocolFallbackCheckbox.addEventListener("change", event => {
|
||||
browser.storage.local.set({ protocolFallback: event.target.checked });
|
||||
})
|
||||
|
||||
let nameCustomInstanceInput = document.getElementById("exceptions-custom-instance");
|
||||
let instanceTypeElement = document.getElementById("exceptions-custom-instance-type");
|
||||
let instanceType = "url"
|
||||
@ -187,13 +200,25 @@ browser.storage.local.get(
|
||||
'theme',
|
||||
'autoRedirect',
|
||||
'exceptions',
|
||||
'protocol',
|
||||
'protocolFallback'
|
||||
// 'firstPartyIsolate'
|
||||
],
|
||||
r => {
|
||||
autoRedirectElement.checked = r.autoRedirect;
|
||||
themeElement.value = r.theme;
|
||||
protocolElement.value = r.protocol;
|
||||
protocolFallbackCheckbox.checked = r.protocolFallback;
|
||||
// firstPartyIsolate.checked = r.firstPartyIsolate;
|
||||
|
||||
let protocolFallbackElement = document.getElementById('protocol-fallback')
|
||||
if (protocolElement.value == "normal") {
|
||||
protocolFallbackElement.style.display = 'none';
|
||||
} else {
|
||||
protocolFallbackElement.style.display = 'block';
|
||||
}
|
||||
|
||||
|
||||
instanceTypeElement.addEventListener("change",
|
||||
event => {
|
||||
instanceType = event.target.options[instanceTypeElement.selectedIndex].value
|
||||
|
@ -14,6 +14,19 @@ section#general_page.option-block
|
||||
h4 Tor Browser
|
||||
input#firstPartyIsolate(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__")
|
||||
select#protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor") Tor
|
||||
option(value="i2p") I2P
|
||||
option(value="loki") Lokinet
|
||||
|
||||
#protocol-fallback
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocolFallback__") Fallback to normal if no instances are available for the current protocol
|
||||
input#protocol-fallback-checkbox(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_autoRedirect__")
|
||||
input#auto-redirect(type="checkbox")
|
||||
@ -188,4 +201,4 @@ section#general_page.option-block
|
||||
input#sendTargets(type="checkbox")
|
||||
|
||||
|
||||
script(type="module" src="./widgets/general.js")
|
||||
script(type="module" src="./widgets/general.js")
|
||||
|
@ -1,42 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("imdb-enable");
|
||||
const protocol = document.getElementById("imdb-protocol")
|
||||
const imdb = document.getElementById('imdb_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalDiv = imdb.getElementsByClassName("normal")[0];
|
||||
const torDiv = imdb.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
const frontends = new Array("libremdb")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("imdb-enable");
|
||||
const imdb = document.getElementById('imdb_page');
|
||||
//const frontend = document.getElementById("imdb-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
imdb.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableImdb: !enable.checked,
|
||||
imdbProtocol: protocol.value,
|
||||
})
|
||||
})
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableImdb",
|
||||
"imdbProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableImdb;
|
||||
protocol.value = r.imdbProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
utils.processDefaultCustomInstances('imdb', 'libremdb', 'normal', document);
|
||||
utils.processDefaultCustomInstances('imdb', 'libremdb', 'tor', document);
|
||||
utils.latency('imdb', 'libremdb', document, location)
|
||||
imdb.addEventListener("change", () => {
|
||||
browser.storage.local.set({ disableImdb: !enable.checked })
|
||||
})
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('imdb', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('imdb', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#imdb_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#imdb-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#imdb-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#libremdb
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#imdb_page.option-block
|
||||
+latency('libremdb')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://libremdb.onion')
|
||||
+instances('http://libremdb.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://libremdb.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://libremdb.loki')
|
||||
|
||||
script(type="module" src="./widgets/imdb.js")
|
||||
script(type="module" src="./widgets/imdb.js")
|
||||
|
@ -1,53 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("imgur-enable");
|
||||
const protocol = document.getElementById("imgur-protocol")
|
||||
const imgur = document.getElementById('imgur_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const normalDiv = imgur.getElementsByClassName("normal")[0];
|
||||
const torDiv = imgur.getElementsByClassName("tor")[0];
|
||||
const i2pDiv = imgur.getElementsByClassName("i2p")[0];
|
||||
const frontends = new Array("rimgo")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("imgur-enable");
|
||||
const imgur = document.getElementById('imgur_page');
|
||||
//const frontend = document.getElementById("imgur-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
i2pDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
i2pDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'i2p') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'none';
|
||||
i2pDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableImgur",
|
||||
"imgurProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableImgur;
|
||||
protocol.value = r.imgurProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
);
|
||||
|
||||
imgur.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableImgur: !enable.checked,
|
||||
imgurProtocol: protocol.value,
|
||||
});
|
||||
browser.storage.local.set({ disableImgur: !enable.checked });
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('imgur', 'rimgo', 'normal', document);
|
||||
utils.processDefaultCustomInstances('imgur', 'rimgo', 'tor', document);
|
||||
utils.processDefaultCustomInstances('imgur', 'rimgo', 'i2p', document);
|
||||
|
||||
utils.latency('imgur', 'rimgo', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('imgur', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('imgur', frontends[i], document, location)
|
||||
}
|
||||
|
@ -7,13 +7,6 @@ section#imgur_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#imgur-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#imgur-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
option(value="i2p" data-localise="__MSG_i2p__") I2P
|
||||
|
||||
#rimgo
|
||||
hr
|
||||
.normal
|
||||
@ -23,10 +16,12 @@ section#imgur_page.option-block
|
||||
+latency('rimgo')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://rimgo.onion')
|
||||
|
||||
+instances('http://rimgo.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://rimgo.onion')
|
||||
+instances('http://rimgo.onion')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://rimgo.loki')
|
||||
|
||||
script(type="module" src="./widgets/imgur.js")
|
||||
script(type="module" src="./widgets/imgur.js")
|
||||
|
@ -1,45 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("instagram-enable");
|
||||
const protocol = document.getElementById("instagram-protocol");
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("bibliogram")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("instagram-enable");
|
||||
const instagram = document.getElementById('instagram_page')
|
||||
const normalDiv = instagram.getElementsByClassName("normal")[0];
|
||||
const torDiv = instagram.getElementsByClassName("tor")[0];
|
||||
//const frontend = document.getElementById("instagram-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableInstagram",
|
||||
"instagramProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableInstagram;
|
||||
protocol.value = r.instagramProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
instagram.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableInstagram: !enable.checked,
|
||||
instagramProtocol: protocol.value,
|
||||
})
|
||||
browser.storage.local.set({ disableInstagram: !enable.checked })
|
||||
})
|
||||
|
||||
|
||||
utils.processDefaultCustomInstances('instagram', 'bibliogram', 'normal', document);
|
||||
utils.processDefaultCustomInstances('instagram', 'bibliogram', 'tor', document);
|
||||
|
||||
utils.latency('instagram', 'bibliogram', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('instagram', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('instagram', frontends[i], document, location)
|
||||
}
|
||||
|
@ -7,12 +7,6 @@ section#instagram_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#instagram-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#instagram-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#bibliogram
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,13 @@ section#instagram_page.option-block
|
||||
include ../../widgets/latency.pug
|
||||
+latency('bibliogram')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://bibliogram.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://bibliogram.onion')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://bibliogram.loki')
|
||||
|
||||
script(type="module" src="./widgets/instagram.js")
|
||||
script(type="module" src="./widgets/instagram.js")
|
||||
|
@ -1,44 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("lbry-enable");
|
||||
const protocol = document.getElementById("lbry-protocol")
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("librarian")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("lbry-enable");
|
||||
const lbry = document.getElementById('lbry_page');
|
||||
const normalDiv = lbry.getElementsByClassName("normal")[0];
|
||||
const torDiv = lbry.getElementsByClassName("tor")[0];
|
||||
//const frontend = document.getElementById("lbry-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableLbryTargets",
|
||||
"lbryTargetsProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableLbryTargets;
|
||||
protocol.value = r.lbryTargetsProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
lbry.addEventListener("change", () => {
|
||||
changeProtocolSettings()
|
||||
browser.storage.local.set({
|
||||
disableLbryTargets: !enable.checked,
|
||||
lbryTargetsProtocol: protocol.value,
|
||||
});
|
||||
browser.storage.local.set({ disableLbryTargets: !enable.checked });
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('lbryTargets', 'librarian', 'normal', document);
|
||||
utils.processDefaultCustomInstances('lbryTargets', 'librarian', 'tor', document);
|
||||
|
||||
utils.latency('lbryTargets', 'librarian', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('lbryTargets', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('lbryTargets', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#lbry_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#lbry-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#lbry-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#librarian
|
||||
hr
|
||||
.normal
|
||||
@ -22,5 +16,11 @@ section#lbry_page.option-block
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://librarian.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://librarian.onion')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://librarian.loki')
|
||||
|
||||
script(type="module" src="./widgets/lbry.js")
|
||||
script(type="module" src="./widgets/lbry.js")
|
||||
|
@ -1,34 +1,64 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("maps-enable");
|
||||
const frontend = document.getElementById("maps-frontend");
|
||||
const frontends = new Array("facil")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("maps-enable");
|
||||
const maps = document.getElementById('maps_page');
|
||||
const facilDiv = document.getElementById("facil")
|
||||
const frontend = document.getElementById("maps-frontend");
|
||||
let protocol
|
||||
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
if (frontend.value == 'facil') facilDiv.style.display = 'block';
|
||||
else if (frontend.value == 'osm') facilDiv.style.display = 'none';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableMaps",
|
||||
"mapsFrontend",
|
||||
"protocol",
|
||||
"mapsFrontend"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableMaps;
|
||||
protocol = r.protocol;
|
||||
frontend.value = r.mapsFrontend;
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
maps.addEventListener("change", () => {
|
||||
changeFrontendsSettings();
|
||||
browser.storage.local.set({
|
||||
disableMaps: !enable.checked,
|
||||
mapsFrontend: frontend.value,
|
||||
})
|
||||
mapsFrontend: frontend.value
|
||||
});
|
||||
changeFrontendsSettings();
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('maps', 'facil', 'normal', document);
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
utils.processDefaultCustomInstances('maps', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('maps', frontends[i], document, location)
|
||||
}
|
||||
|
@ -18,6 +18,15 @@ section#maps_page.option-block
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://facilmap.com')
|
||||
include ../../widgets/latency.pug
|
||||
+latency('facilmap')
|
||||
+latency('facil')
|
||||
.tor
|
||||
+instances('http://facilmap.onion')
|
||||
include ../../widgets/instances.pug
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://facilmap.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://facilmap.loki')
|
||||
|
||||
script(type="module" src="./widgets/maps.js")
|
||||
script(type="module" src="./widgets/maps.js")
|
||||
|
@ -1,42 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("medium-enable");
|
||||
const protocol = document.getElementById("medium-protocol")
|
||||
const medium = document.getElementById('medium_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalDiv = medium.getElementsByClassName("normal")[0];
|
||||
const torDiv = medium.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
const frontends = new Array("scribe")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("medium-enable");
|
||||
const medium = document.getElementById('medium_page');
|
||||
//const frontend = document.getElementById("medium-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
medium.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableMedium: !enable.checked,
|
||||
mediumProtocol: protocol.value,
|
||||
})
|
||||
})
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableMedium",
|
||||
"mediumProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableMedium;
|
||||
protocol.value = r.mediumProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
utils.processDefaultCustomInstances('medium', 'scribe', 'normal', document);
|
||||
utils.processDefaultCustomInstances('medium', 'scribe', 'tor', document);
|
||||
utils.latency('medium', 'scribe', document, location)
|
||||
medium.addEventListener("change", () => {
|
||||
browser.storage.local.set({ disableMedium: !enable.checked })
|
||||
})
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('medium', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('medium', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#medium_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#medium-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#medium-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#scribe
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#medium_page.option-block
|
||||
+latency('scribe')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://scribe.onion')
|
||||
+instances('http://scribe.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://scribe.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://scribe.loki')
|
||||
|
||||
script(type="module" src="./widgets/medium.js")
|
||||
script(type="module" src="./widgets/medium.js")
|
||||
|
@ -1,42 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("simpleertube")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("peertube-enable");
|
||||
const protocol = document.getElementById("peertube-protocol");
|
||||
const peertube = document.getElementById('peertube_page');
|
||||
//const frontend = document.getElementById("peertube-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalDiv = peertube.getElementsByClassName("normal")[0];
|
||||
const torDiv = peertube.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disablePeertubeTargets",
|
||||
"peertubeTargetsProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disablePeertubeTargets;
|
||||
protocol.value = r.peertubeTargetsProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
peertube.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disablePeertubeTargets: !enable.checked,
|
||||
peertubeTargetsProtocol: protocol.value
|
||||
})
|
||||
browser.storage.local.set({ disablePeertubeTargets: !enable.checked })
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('peertube', 'simpleertube', 'normal', document);
|
||||
utils.processDefaultCustomInstances('peertube', 'simpleertube', 'tor', document);
|
||||
utils.latency('peertube', 'simpleertube', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('peertube', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('peertube', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#peertube_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#peertube-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#peertube-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#simpleertube
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#peertube_page.option-block
|
||||
+latency('simpleertube')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://simpleertube.onion')
|
||||
+instances('http://simpleertube.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://simpleertube.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://simpleertube.loki')
|
||||
|
||||
script(type="module" src="./widgets/peertube.js")
|
||||
script(type="module" src="./widgets/peertube.js")
|
||||
|
@ -1,42 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("quora-enable");
|
||||
const protocol = document.getElementById("quora-protocol")
|
||||
const quora = document.getElementById('quora_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalDiv = quora.getElementsByClassName("normal")[0];
|
||||
const torDiv = quora.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
const frontends = new Array("quetre")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("quora-enable");
|
||||
const quora = document.getElementById('quora_page');
|
||||
//const frontend = document.getElementById("quora-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
quora.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableQuora: !enable.checked,
|
||||
quoraProtocol: protocol.value,
|
||||
})
|
||||
})
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableQuora",
|
||||
"quoraProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableQuora;
|
||||
protocol.value = r.quoraProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
utils.processDefaultCustomInstances('quora', 'quetre', 'normal', document);
|
||||
utils.processDefaultCustomInstances('quora', 'quetre', 'tor', document);
|
||||
utils.latency('quora', 'quetre', document, location)
|
||||
quora.addEventListener("change", () => {
|
||||
browser.storage.local.set({ disableQuora: !enable.checked })
|
||||
})
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('quora', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('quora', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#quora_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#quora-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#quora-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#quetre
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#quora_page.option-block
|
||||
+latency('quetre')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://quetre.onion')
|
||||
+instances('http://quetre.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://quetre.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://quetre.loki')
|
||||
|
||||
script(type="module" src="./widgets/quora.js")
|
||||
script(type="module" src="./widgets/quora.js")
|
||||
|
@ -1,52 +1,47 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const libredditDivElement = document.getElementById("libreddit")
|
||||
const tedditDivElement = document.getElementById("teddit")
|
||||
const frontends = new Array("libreddit", "teddit")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("reddit-enable");
|
||||
const frontend = document.getElementById("reddit-frontend");
|
||||
const protocol = document.getElementById("reddit-protocol");
|
||||
const reddit = document.getElementById('reddit_page');
|
||||
const frontend = document.getElementById("reddit-frontend");
|
||||
let protocol
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalLibredditDiv = libredditDivElement.getElementsByClassName("normal")[0];
|
||||
const torLibredditDiv = libredditDivElement.getElementsByClassName("tor")[0];
|
||||
const normalTedditDiv = tedditDivElement.getElementsByClassName("normal")[0];
|
||||
const torTedditDiv = tedditDivElement.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalLibredditDiv.style.display = 'block';
|
||||
normalTedditDiv.style.display = 'block';
|
||||
torTedditDiv.style.display = 'none';
|
||||
torLibredditDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalLibredditDiv.style.display = 'none';
|
||||
normalTedditDiv.style.display = 'none';
|
||||
torTedditDiv.style.display = 'block';
|
||||
torLibredditDiv.style.display = 'block';
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
if (frontend.value == 'libreddit') {
|
||||
libredditDivElement.style.display = 'block';
|
||||
tedditDivElement.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'teddit') {
|
||||
libredditDivElement.style.display = 'none';
|
||||
tedditDivElement.style.display = 'block';
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableReddit",
|
||||
"redditProtocol",
|
||||
"protocol",
|
||||
"redditFrontend",
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableReddit
|
||||
protocol.value = r.redditProtocol
|
||||
protocol = r.protocol
|
||||
frontend.value = r.redditFrontend
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
@ -56,17 +51,14 @@ browser.storage.local.get(
|
||||
reddit.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableReddit: !enable.checked,
|
||||
redditProtocol: protocol.value,
|
||||
redditFrontend: frontend.value,
|
||||
redditFrontend: frontend.value
|
||||
});
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('reddit', 'libreddit', 'normal', document);
|
||||
utils.processDefaultCustomInstances('reddit', 'libreddit', 'tor', document);
|
||||
utils.processDefaultCustomInstances('reddit', 'teddit', 'normal', document);
|
||||
utils.processDefaultCustomInstances('reddit', 'teddit', 'tor', document);
|
||||
|
||||
utils.latency('reddit', 'libreddit', document, location, true)
|
||||
utils.latency('reddit', 'teddit', document, location, true)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('reddit', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('reddit', frontends[i], document, location)
|
||||
}
|
||||
|
@ -12,12 +12,6 @@ section#reddit_page.option-block
|
||||
option(value="libreddit") Libreddit
|
||||
option(value="teddit") Teddit
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#reddit-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#libreddit
|
||||
hr
|
||||
.normal
|
||||
@ -27,7 +21,13 @@ section#reddit_page.option-block
|
||||
+latency('libreddit')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://libreddit.onion')
|
||||
+instances('http://libreddit.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://libreddit.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://libreddit.loki')
|
||||
|
||||
#teddit
|
||||
hr
|
||||
@ -37,6 +37,12 @@ section#reddit_page.option-block
|
||||
+latency('teddit')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://teddit.onion')
|
||||
+instances('http://teddit.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://teddit.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://teddit.loki')
|
||||
|
||||
script(type="module" src="./widgets/reddit.js")
|
||||
script(type="module" src="./widgets/reddit.js")
|
||||
|
@ -1,43 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("reuters-enable");
|
||||
const protocol = document.getElementById("reuters-protocol")
|
||||
const reuters = document.getElementById('reuters_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalDiv = reuters.getElementsByClassName("normal")[0];
|
||||
const torDiv = reuters.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
const frontends = new Array("neuters")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("reuters-enable");
|
||||
const reuters = document.getElementById('reuters_page');
|
||||
//const frontend = document.getElementById("reuters-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
reuters.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableReuters: !enable.checked,
|
||||
reutersProtocol: protocol.value,
|
||||
})
|
||||
})
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableReuters",
|
||||
"reutersProtocol"
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableReuters;
|
||||
protocol.value = r.reutersProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
utils.processDefaultCustomInstances('reuters', 'neuters', 'normal', document);
|
||||
utils.processDefaultCustomInstances('reuters', 'neuters', 'tor', document);
|
||||
utils.latency('reuters', 'neuters', document, location)
|
||||
reuters.addEventListener("change", () => {
|
||||
browser.storage.local.set({ disableReuters: !enable.checked })
|
||||
})
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('reuters', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('reuters', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#reuters_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#reuters-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#reuters-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#neuters
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#reuters_page.option-block
|
||||
+latency('neuters')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://neuters.onion')
|
||||
+instances('http://neuters.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://neuters.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://neuters.loki')
|
||||
|
||||
script(type="module" src="./widgets/reuters.js")
|
||||
script(type="module" src="./widgets/reuters.js")
|
||||
|
@ -1,39 +1,111 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
// GOAL: to never mention frontends/protocls outside these two arrays, so that adding a new frontend/protocol is as easy as adding it here.
|
||||
// This may be expanded across the whole project, where almost everything becomes a template, and the frontend/protocol parts just become a JSON file.
|
||||
|
||||
// ONCE FINISHED: add librex and see if it works
|
||||
const frontends = new Array("searx", "searxng", "whoogle", "librex") // Add librex once /javascripts/search.js is made agnostic
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
//let frontendProtocols = (frontends.length)
|
||||
|
||||
// I will leave comments of my privious attemps so that people can learn from my mistakes. :)
|
||||
|
||||
/*
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
this.frontends[i] = frontends[i].getElementsByClassName(protocol)
|
||||
}
|
||||
*/
|
||||
// There was a class here, but I deleted a bit of it
|
||||
/*
|
||||
this.searxDiv = searxDiv.getElementsByClassName(protocol)[0];
|
||||
this.searxngDiv = searxngDiv.getElementsByClassName(protocol)[0];
|
||||
this.librexDiv = librexDiv.getElementsByClassName(protocol)[0];
|
||||
*/
|
||||
|
||||
/*
|
||||
* Here I was trying to solve the issue by making a 2D array, but I later realised I was overcomplicating things
|
||||
for (var i = 0; i < frontends.length; i++) {
|
||||
frontendProtocols[i] = new Array(protocols.length)
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
const searxDiv = document.getElementById("searx");
|
||||
const searxngDiv = document.getElementById("searxng");
|
||||
const whoogleDiv = document.getElementById("whoogle");
|
||||
*/
|
||||
|
||||
const enable = document.getElementById("search-enable");
|
||||
const frontend = document.getElementById("search-frontend");
|
||||
const protocol = document.getElementById("search-protocol");
|
||||
|
||||
const search = document.getElementById('search_page');
|
||||
|
||||
const frontend = document.getElementById("search-frontend");
|
||||
let protocol
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
let SearxWhoogleElement = document.getElementById("searx-whoogle");
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if (frontend.value == 'searx') {
|
||||
searxDiv.style.display = 'block';
|
||||
searxngDiv.style.display = 'none';
|
||||
whoogleDiv.style.display = 'none';
|
||||
SearxWhoogleElement.style.display = 'block';
|
||||
librexDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'searxng') {
|
||||
searxDiv.style.display = 'none';
|
||||
searxngDiv.style.display = 'block';
|
||||
whoogleDiv.style.display = 'none';
|
||||
SearxWhoogleElement.style.display = 'block';
|
||||
librexDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'whoogle') {
|
||||
searxDiv.style.display = 'none';
|
||||
searxngDiv.style.display = 'none';
|
||||
whoogleDiv.style.display = 'block';
|
||||
SearxWhoogleElement.style.display = 'block';
|
||||
librexDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'librex') {
|
||||
searxDiv.style.display = 'none';
|
||||
searxDiv.style.display = 'none';
|
||||
searxngDiv.style.display = 'none';
|
||||
librexDiv.style.display = 'block';
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
function changeProtocolSettings() {
|
||||
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
//if (frontends[i] == frontend.value) { // Here we are checking if the frontend matches the current one. This skips the protocol checking for that frontend, speeding things up. I no longer do this as protocol setting is only set once in the ui so every frontend needs to get their protocols setup immidiately.
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) { //if the frontend value equals the selected one, it will show. Otherwise, it will be hidden
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
/*
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* "Legacy" code
|
||||
const normalsearxDiv = searxDiv.getElementsByClassName("normal")[0];
|
||||
const torsearxDiv = searxDiv.getElementsByClassName("tor")[0];
|
||||
const i2psearxDiv = searxDiv.getElementsByClassName("i2p")[0];
|
||||
@ -42,10 +114,18 @@ function changeProtocolSettings() {
|
||||
const torsearxngDiv = searxngDiv.getElementsByClassName("tor")[0];
|
||||
const i2psearxngDiv = searxngDiv.getElementsByClassName("i2p")[0];
|
||||
|
||||
const normalwhoogleDiv = whoogleDiv.getElementsByClassName("normal")[0];
|
||||
const torwhoogleDiv = whoogleDiv.getElementsByClassName("tor")[0];
|
||||
const i2pwhoogleDiv = whoogleDiv.getElementsByClassName("i2p")[0];
|
||||
const normalwhoogleDiv = whoogleDiv.getElementsByClassName("normal")[0];
|
||||
|
||||
|
||||
function protocolDisplay(proto) {
|
||||
proto.searxngDiv = 'block'
|
||||
}
|
||||
|
||||
protocolDisplay(protocol.value)
|
||||
|
||||
|
||||
if (protocol.value == 'normal') {
|
||||
normalsearxDiv.style.display = 'block';
|
||||
normalsearxngDiv.style.display = 'block';
|
||||
@ -85,34 +165,42 @@ function changeProtocolSettings() {
|
||||
i2psearxngDiv.style.display = 'block';
|
||||
i2pwhoogleDiv.style.display = 'block';
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableSearch",
|
||||
"searchFrontend",
|
||||
"searchProtocol",
|
||||
"protocol",
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableSearch;
|
||||
frontend.value = r.searchFrontend;
|
||||
protocol.value = r.searchProtocol;
|
||||
protocol = r.protocol;
|
||||
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
}
|
||||
);
|
||||
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('search', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('search', frontends[i], document, location)
|
||||
}
|
||||
|
||||
search.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableSearch: !enable.checked,
|
||||
searchFrontend: frontend.value,
|
||||
searchProtocol: protocol.value,
|
||||
});
|
||||
changeFrontendsSettings(frontend.value);
|
||||
changeProtocolSettings(protocol.value);
|
||||
changeFrontendsSettings();
|
||||
})
|
||||
|
||||
/*
|
||||
* more "legacy" code
|
||||
utils.processDefaultCustomInstances('search', 'searx', 'normal', document);
|
||||
utils.processDefaultCustomInstances('search', 'searx', 'tor', document);
|
||||
utils.processDefaultCustomInstances('search', 'searx', 'i2p', document);
|
||||
@ -126,3 +214,4 @@ utils.processDefaultCustomInstances('search', 'whoogle', 'i2p', document);
|
||||
utils.latency('search', 'searx', document, location, true)
|
||||
utils.latency('search', 'searxng', document, location, true)
|
||||
utils.latency('search', 'whoogle', document, location, true)
|
||||
*/
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
section#search_page.option-block
|
||||
.some-block.option-block
|
||||
h1(data-localise="__MSG_search__") Search
|
||||
@ -13,17 +12,10 @@ section#search_page.option-block
|
||||
option(value="searxng") SearXNG
|
||||
option(value="searx") SearX
|
||||
option(value="whoogle") Whoogle
|
||||
|
||||
#searx-whoogle
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#search-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
option(value="i2p" data-localise="__MSG_i2p__") I2P
|
||||
option(value="librex") LibreX
|
||||
|
||||
.some-block
|
||||
h4(data-localise="__MSG_searchNote__") Note: To use Search to its full potential, make LibRedirect as the Default Search Engine
|
||||
h4(data-localise="__MSG_searchNote__") Note: To use Search, make LibRedirect the Default Search Engine
|
||||
|
||||
#searx
|
||||
hr
|
||||
@ -34,10 +26,13 @@ section#search_page.option-block
|
||||
+latency('searx')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://searx.onion')
|
||||
+instances('http://searx.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://searx.i2p')
|
||||
+instances('http://searx.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://searx.loki')
|
||||
|
||||
#searxng
|
||||
hr
|
||||
@ -47,10 +42,13 @@ section#search_page.option-block
|
||||
+latency('searxng')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://searxng.onion')
|
||||
+instances('http://searxng.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://searxng.i2p')
|
||||
+instances('http://searxng.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://searxng.loki')
|
||||
|
||||
#whoogle
|
||||
hr
|
||||
@ -60,9 +58,28 @@ section#search_page.option-block
|
||||
+latency('whoogle')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://whoogle.onion')
|
||||
+instances('http://whoogle.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://whoogle.i2p')
|
||||
+instances('http://whoogle.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://whoogle.loki')
|
||||
|
||||
script(type="module" src="./widgets/search.js")
|
||||
#librex
|
||||
hr
|
||||
.normal
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://librex.com')
|
||||
+latency('librex')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://librex.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://librex.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://librex.loki')
|
||||
|
||||
script(type="module" src="./widgets/search.js")
|
||||
|
@ -1,43 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("send")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("sendTargets-enable");
|
||||
const protocol = document.getElementById("sendTargets-protocol")
|
||||
const sendTargets = document.getElementById('sendTargets_page');
|
||||
//const frontend = document.getElementById("sendTargets-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
let normalDiv = sendTargets.getElementsByClassName("normal")[0];
|
||||
let torDiv = sendTargets.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableSendTarget",
|
||||
"sendTargetsProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableSendTarget;
|
||||
protocol.value = r.sendTargetsProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
sendTargets.addEventListener("change", () => {
|
||||
changeProtocolSettings();
|
||||
browser.storage.local.set({
|
||||
disableSendTarget: !enable.checked,
|
||||
sendTargetsProtocol: protocol.value,
|
||||
})
|
||||
browser.storage.local.set({ disableSendTarget: !enable.checked })
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('sendTargets', 'send', 'normal', document);
|
||||
utils.processDefaultCustomInstances('sendTargets', 'send', 'tor', document);
|
||||
|
||||
utils.latency('sendTargets', 'send', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('sendTargets', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('sendTargets', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#sendTargets_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#sendTargets-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#sendTargets-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#send
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#sendTargets_page.option-block
|
||||
+latency('send')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://send.onion')
|
||||
+instances('http://send.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://send.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://send.loki')
|
||||
|
||||
script(type="module" src="./widgets/sendTargets.js")
|
||||
script(type="module" src="./widgets/sendTargets.js")
|
||||
|
@ -1,53 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("tiktok-enable");
|
||||
const protocol = document.getElementById("tiktok-protocol")
|
||||
const tiktok = document.getElementById('tiktok_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings() {
|
||||
let normalDiv = tiktok.getElementsByClassName("normal")[0];
|
||||
let torDiv = tiktok.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
const frontends = new Array("proxiTok")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("tiktok-enable");
|
||||
const tiktok = document.getElementById('tiktok_page');
|
||||
//const frontend = document.getElementById("tiktok-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
tiktok.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableTiktok: !enable.checked,
|
||||
tiktokProtocol: protocol.value,
|
||||
});
|
||||
changeProtocolSettings();
|
||||
})
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableTiktok",
|
||||
"tiktokProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableTiktok;
|
||||
protocol.value = r.tiktokProtocol;
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
let normalDiv = document.getElementsByClassName("normal")[0];
|
||||
let torDiv = document.getElementsByClassName("tor")[0];
|
||||
if (r.tiktokProtocol == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (r.tiktokProtocol == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
utils.processDefaultCustomInstances('tiktok', 'proxiTok', 'normal', document);
|
||||
utils.processDefaultCustomInstances('tiktok', 'proxiTok', 'tor', document);
|
||||
tiktok.addEventListener("change", () => {
|
||||
browser.storage.local.set({ disableTiktok: !enable.checked });
|
||||
})
|
||||
|
||||
utils.latency('tiktok', 'proxiTok', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('tiktok', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('tiktok', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#tiktok_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#tiktok-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#tiktok-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
#proxiTok
|
||||
hr
|
||||
.normal
|
||||
@ -21,6 +15,12 @@ section#tiktok_page.option-block
|
||||
+latency('proxiTok')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://proxitok.onion')
|
||||
+instances('http://proxitok.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://proxitok.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://proxitok.loki')
|
||||
|
||||
script(type="module" src="./widgets/tiktok.js")
|
||||
|
@ -1,64 +1,35 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("translate-enable");
|
||||
const frontend = document.getElementById("translate-frontend");
|
||||
const protocol = document.getElementById("translate-protocol");
|
||||
const simplyTranslateDiv = document.getElementById("simplyTranslate");
|
||||
const lingvaDiv = document.getElementById("lingva");
|
||||
const frontends = new Array("simplyTranslate", "lingva")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("translate-enable");
|
||||
const translate = document.getElementById('translate_page');
|
||||
const frontend = document.getElementById("translate-frontend");
|
||||
let protocol
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
if (frontend.value == 'simplyTranslate') {
|
||||
simplyTranslateDiv.style.display = 'block';
|
||||
lingvaDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'lingva') {
|
||||
simplyTranslateDiv.style.display = 'none';
|
||||
lingvaDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("normal")[0];
|
||||
const torSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("tor")[0];
|
||||
const i2pSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("i2p")[0];
|
||||
const lokiSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("loki")[0];
|
||||
|
||||
const normalLingvaDiv = document.getElementById("lingva").getElementsByClassName("normal")[0];
|
||||
const torLingvaDiv = document.getElementById("lingva").getElementsByClassName("tor")[0];
|
||||
|
||||
if (protocol.value == 'normal') {
|
||||
normalSimplyTranslateDiv.style.display = 'block';
|
||||
normalLingvaDiv.style.display = 'block';
|
||||
torSimplyTranslateDiv.style.display = 'none';
|
||||
torLingvaDiv.style.display = 'none';
|
||||
i2pSimplyTranslateDiv.style.display = 'none';
|
||||
lokiSimplyTranslateDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalSimplyTranslateDiv.style.display = 'none';
|
||||
normalLingvaDiv.style.display = 'none';
|
||||
torSimplyTranslateDiv.style.display = 'block';
|
||||
torLingvaDiv.style.display = 'block';
|
||||
i2pSimplyTranslateDiv.style.display = 'none';
|
||||
lokiSimplyTranslateDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'i2p') {
|
||||
normalSimplyTranslateDiv.style.display = 'none';
|
||||
normalLingvaDiv.style.display = 'none';
|
||||
torSimplyTranslateDiv.style.display = 'none';
|
||||
torLingvaDiv.style.display = 'none';
|
||||
i2pSimplyTranslateDiv.style.display = 'block';
|
||||
lokiSimplyTranslateDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'loki') {
|
||||
normalSimplyTranslateDiv.style.display = 'none';
|
||||
normalLingvaDiv.style.display = 'none';
|
||||
torSimplyTranslateDiv.style.display = 'none';
|
||||
torLingvaDiv.style.display = 'none';
|
||||
i2pSimplyTranslateDiv.style.display = 'none';
|
||||
lokiSimplyTranslateDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,12 +37,12 @@ browser.storage.local.get(
|
||||
[
|
||||
"translateDisable",
|
||||
"translateFrontend",
|
||||
"translateProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.translateDisable;
|
||||
frontend.value = r.translateFrontend;
|
||||
protocol.value = r.translateProtocol;
|
||||
protocol = r.protocol;
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
}
|
||||
@ -81,19 +52,13 @@ translate.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
translateDisable: !enable.checked,
|
||||
translateFrontend: frontend.value,
|
||||
translateProtocol: protocol.value,
|
||||
})
|
||||
changeProtocolSettings();
|
||||
changeFrontendsSettings();
|
||||
})
|
||||
|
||||
|
||||
utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'normal', document);
|
||||
utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'tor', document);
|
||||
utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'i2p', document);
|
||||
utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'loki', document);
|
||||
utils.processDefaultCustomInstances('translate', 'lingva', 'normal', document);
|
||||
utils.processDefaultCustomInstances('translate', 'lingva', 'tor', document);
|
||||
|
||||
utils.latency('translate', 'simplyTranslate', document, location, true)
|
||||
utils.latency('translate', 'lingva', document, location, true)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('translate', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('translate', frontends[i], document, location)
|
||||
}
|
||||
|
@ -12,14 +12,6 @@ section#translate_page.option-block
|
||||
option(value="simplyTranslate") SimplyTranslate
|
||||
option(value="lingva") Lingva
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#translate-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
option(value="i2p" data-localise="__MSG_i2p__") I2P
|
||||
option(value="loki" data-localise="__MSG_loki__") Lokinet
|
||||
|
||||
hr
|
||||
#simplyTranslate
|
||||
.normal
|
||||
@ -44,6 +36,13 @@ section#translate_page.option-block
|
||||
+latency('lingva')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://tyzxppdeoojdnaux.onion')
|
||||
+instances('http://lingvatranslate.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://lingvatranslate.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://lingvatranslate.loki')
|
||||
|
||||
|
||||
script(type="module" src="./widgets/translate.js")
|
||||
|
@ -1,32 +1,52 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("nitter")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("twitter-enable");
|
||||
const protocol = document.getElementById("twitter-protocol");
|
||||
const redirectType = document.getElementById("twitter-redirect_type");
|
||||
const twitter = document.getElementById('twitter_page');
|
||||
const redirectType = document.getElementById("twitter-redirect_type");
|
||||
//const frontend = document.getElementById("twitter-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
let normalDiv = twitter.getElementsByClassName("normal")[0];
|
||||
let torDiv = twitter.getElementsByClassName("tor")[0];
|
||||
if (protocol.value == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableTwitter",
|
||||
"twitterProtocol",
|
||||
"twitterRedirectType",
|
||||
"protocol",
|
||||
"twitterRedirectType"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableTwitter;
|
||||
protocol.value = r.twitterProtocol;
|
||||
protocol = r.protocol;
|
||||
redirectType.value = r.twitterRedirectType;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
@ -35,13 +55,13 @@ browser.storage.local.get(
|
||||
twitter.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableTwitter: !enable.checked,
|
||||
twitterProtocol: protocol.value,
|
||||
twitterRedirectType: redirectType.value,
|
||||
});
|
||||
changeProtocolSettings();
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('twitter', 'nitter', 'normal', document);
|
||||
utils.processDefaultCustomInstances('twitter', 'nitter', 'tor', document)
|
||||
|
||||
utils.latency('twitter', 'nitter', document, location, true)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++){
|
||||
utils.processDefaultCustomInstances('twitter', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('twitter', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,12 +6,6 @@ section#twitter_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#twitter-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#twitter-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#twitter-redirect_type
|
||||
@ -27,6 +21,13 @@ section#twitter_page.option-block
|
||||
include ../../widgets/latency.pug
|
||||
+latency('nitter')
|
||||
.tor
|
||||
+instances('https://nitter.onion')
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://nitter.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://nitter.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://nitter.loki')
|
||||
|
||||
script(type="module" src="./widgets/twitter.js")
|
||||
|
@ -1,52 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const enable = document.getElementById("wikipedia-enable");
|
||||
const protocolElement = document.getElementById("wikipedia-protocol");
|
||||
const wikipedia = document.getElementById('wikipedia_page');
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
function changeProtocolSettings(protocol) {
|
||||
const normalDiv = wikipedia.getElementsByClassName("normal")[0];
|
||||
const torDiv = wikipedia.getElementsByClassName("tor")[0];
|
||||
const i2pDiv = wikipedia.getElementsByClassName("i2p")[0];
|
||||
if (protocol == 'normal') {
|
||||
normalDiv.style.display = 'block';
|
||||
torDiv.style.display = 'none';
|
||||
i2pDiv.style.display = 'none';
|
||||
const frontends = new Array("wikiless")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
const enable = document.getElementById("wikipedia-enable");
|
||||
const wikipedia = document.getElementById('wikipedia_page');
|
||||
//const frontend = document.getElementById("wikipedia-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
else if (protocol == 'tor') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'block';
|
||||
i2pDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol == 'i2p') {
|
||||
normalDiv.style.display = 'none';
|
||||
torDiv.style.display = 'none';
|
||||
i2pDiv.style.display = 'block';
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableWikipedia",
|
||||
"wikipediaProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableWikipedia;
|
||||
protocolElement.value = r.wikipediaProtocol;
|
||||
changeProtocolSettings(r.wikipediaProtocol);
|
||||
protocol = r.protocol;
|
||||
changeProtocolSettings();
|
||||
}
|
||||
)
|
||||
|
||||
wikipedia.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableWikipedia: !enable.checked,
|
||||
wikipediaProtocol: protocolElement.value,
|
||||
})
|
||||
changeProtocolSettings(protocolElement.value)
|
||||
browser.storage.local.set({ disableWikipedia: !enable.checked })
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('wikipedia', 'wikiless', 'normal', document);
|
||||
utils.processDefaultCustomInstances('wikipedia', 'wikiless', 'tor', document);
|
||||
utils.processDefaultCustomInstances('wikipedia', 'wikiless', 'i2p', document);
|
||||
|
||||
utils.latency('wikipedia', 'wikiless', document, location)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
utils.processDefaultCustomInstances('wikipedia', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('wikipedia', frontends[i], document, location)
|
||||
}
|
||||
|
@ -6,13 +6,6 @@ section#wikipedia_page.option-block
|
||||
h4(data-localise="__MSG_enable__") Enable
|
||||
input#wikipedia-enable(type="checkbox")
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#wikipedia-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
option(value="i2p" data-localise="__MSG_i2p__") I2P
|
||||
|
||||
#wikiless
|
||||
hr
|
||||
.normal
|
||||
@ -22,10 +15,12 @@ section#wikipedia_page.option-block
|
||||
+latency('wikiless')
|
||||
.tor
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://wikiless.onion')
|
||||
|
||||
+instances('http://wikiless.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://wikiless.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://wikiless.loki')
|
||||
|
||||
script(type="module" src="./widgets/wikipedia.js")
|
||||
|
@ -1,113 +1,65 @@
|
||||
import youtubeHelper from "../../../assets/javascripts/youtube/youtube.js";
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
const frontends = new Array("invidious", "piped", "pipedMaterial")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
const singleInstanceFrontends = new Array("freetube", "yatte")
|
||||
|
||||
const enable = document.getElementById("youtube-enable");
|
||||
const frontend = document.getElementById("youtube-frontend");
|
||||
const youtube = document.getElementById('youtube_page');
|
||||
const youtubeEmbedFrontend = document.getElementById("youtube-embed_frontend");
|
||||
const onlyEmbeddedVideo = document.getElementById("youtube-redirect_type");
|
||||
const protocol = document.getElementById("youtube-protocol");
|
||||
const youtube = document.getElementById('youtube_page');
|
||||
|
||||
const invidiousDiv = document.getElementById("invidious");
|
||||
const pipedDiv = document.getElementById("piped");
|
||||
const pipedMaterialDiv = document.getElementById("pipedMaterial");
|
||||
const freetubeYatteeDiv = document.getElementById("freetube-yatte");
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
if (frontend.value == 'invidious') {
|
||||
invidiousDiv.style.display = 'block';
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
freetubeYatteeDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'piped') {
|
||||
invidiousDiv.style.display = 'none';
|
||||
pipedDiv.style.display = 'block';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
freetubeYatteeDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'pipedMaterial') {
|
||||
invidiousDiv.style.display = 'none';
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'block';
|
||||
freetubeYatteeDiv.style.display = 'none';
|
||||
}
|
||||
else if (frontend.value == 'freetube' || frontend.value == 'yatte') {
|
||||
invidiousDiv.style.display = 'none';
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
freetubeYatteeDiv.style.display = 'block';
|
||||
changeYoutubeEmbedFrontendsSettings();
|
||||
}
|
||||
}
|
||||
|
||||
function changeYoutubeEmbedFrontendsSettings() {
|
||||
if (youtubeEmbedFrontend.value == 'invidious') {
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
invidiousDiv.style.display = 'block';
|
||||
}
|
||||
if (youtubeEmbedFrontend.value == 'piped') {
|
||||
pipedDiv.style.display = 'block';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
invidiousDiv.style.display = 'none';
|
||||
}
|
||||
if (youtubeEmbedFrontend.value == 'pipedMaterial') {
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'block';
|
||||
invidiousDiv.style.display = 'none';
|
||||
}
|
||||
else if (youtubeEmbedFrontend.value == 'youtube') {
|
||||
pipedDiv.style.display = 'none';
|
||||
pipedMaterialDiv.style.display = 'none';
|
||||
invidiousDiv.style.display = 'none';
|
||||
}
|
||||
}
|
||||
const embeddedFrontendDiv = document.getElementById("youtube-embedded_frontend");
|
||||
const frontend = document.getElementById("youtube-frontend");
|
||||
let protocol
|
||||
|
||||
function changeProtocolSettings() {
|
||||
const normalPipedDiv = document.getElementById('piped').getElementsByClassName("normal")[0];
|
||||
const torPipedDiv = document.getElementById('piped').getElementsByClassName("tor")[0];
|
||||
|
||||
const normalPipedMaterialDiv = document.getElementById('pipedMaterial').getElementsByClassName("normal")[0];
|
||||
const torPipedMaterialDiv = document.getElementById('pipedMaterial').getElementsByClassName("tor")[0];
|
||||
|
||||
const normalInvidiousDiv = document.getElementById('invidious').getElementsByClassName("normal")[0];
|
||||
const torInvidiousDiv = document.getElementById('invidious').getElementsByClassName("tor")[0];
|
||||
|
||||
if (protocol.value == 'normal') {
|
||||
normalInvidiousDiv.style.display = 'block';
|
||||
torInvidiousDiv.style.display = 'none';
|
||||
|
||||
normalPipedDiv.style.display = 'block';
|
||||
torPipedDiv.style.display = 'none';
|
||||
|
||||
normalPipedMaterialDiv.style.display = 'block';
|
||||
torPipedMaterialDiv.style.display = 'none';
|
||||
}
|
||||
else if (protocol.value == 'tor') {
|
||||
normalInvidiousDiv.style.display = 'none';
|
||||
torInvidiousDiv.style.display = 'block';
|
||||
|
||||
normalPipedDiv.style.display = 'none';
|
||||
torPipedDiv.style.display = 'block';
|
||||
|
||||
normalPipedMaterialDiv.style.display = 'none';
|
||||
torPipedMaterialDiv.style.display = 'block';
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
youtube.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableYoutube: !enable.checked,
|
||||
youtubeFrontend: frontend.value,
|
||||
youtubeEmbedFrontend: youtubeEmbedFrontend.value,
|
||||
onlyEmbeddedVideo: onlyEmbeddedVideo.value,
|
||||
youtubeProtocol: protocol.value,
|
||||
})
|
||||
changeProtocolSettings();
|
||||
changeYoutubeEmbedFrontendsSettings();
|
||||
changeFrontendsSettings();
|
||||
})
|
||||
function changeEmbedFrontendsSettings() {
|
||||
if (embeddedFrontendDiv.style.display == 'block') {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const embeddedFrontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == youtubeEmbedFrontend.value) {
|
||||
embeddedFrontendDiv.style.display = 'block'
|
||||
} else {
|
||||
embeddedFrontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
let singleInstanceFrontend = false
|
||||
for (let i = 0; i < singleInstanceFrontends.length; i++) {
|
||||
if (singleInstanceFrontends[i] == frontend.value) {
|
||||
singleInstanceFrontend = true
|
||||
}
|
||||
}
|
||||
if (singleInstanceFrontend == true) {
|
||||
embeddedFrontendDiv.style.display = 'block'
|
||||
} else {
|
||||
embeddedFrontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
@ -117,29 +69,33 @@ browser.storage.local.get(
|
||||
"youtubeFrontend",
|
||||
|
||||
"youtubeEmbedFrontend",
|
||||
"youtubeProtocol",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableYoutube;
|
||||
onlyEmbeddedVideo.value = r.onlyEmbeddedVideo;
|
||||
frontend.value = r.youtubeFrontend;
|
||||
protocol.value = r.youtubeProtocol;
|
||||
protocol = r.protocol;
|
||||
|
||||
changeFrontendsSettings();
|
||||
changeProtocolSettings();
|
||||
|
||||
youtubeEmbedFrontend.value = youtubeEmbedFrontend.value
|
||||
if (r.frontend == "freetube" || r.frontend == "yatte") changeYoutubeEmbedFrontendsSettings()
|
||||
changeEmbedFrontendsSettings();
|
||||
}
|
||||
);
|
||||
|
||||
utils.processDefaultCustomInstances('youtube', 'invidious', 'normal', document);
|
||||
utils.processDefaultCustomInstances('youtube', 'invidious', 'tor', document);
|
||||
utils.processDefaultCustomInstances('youtube', 'pipedMaterial', 'normal', document);
|
||||
utils.processDefaultCustomInstances('youtube', 'pipedMaterial', 'tor', document);
|
||||
utils.processDefaultCustomInstances('youtube', 'piped', 'normal', document);
|
||||
utils.processDefaultCustomInstances('youtube', 'piped', 'tor', document);
|
||||
youtube.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableYoutube: !enable.checked,
|
||||
youtubeEmbedFrontend: youtubeEmbedFrontend.value,
|
||||
onlyEmbeddedVideo: onlyEmbeddedVideo.value
|
||||
})
|
||||
changeFrontendsSettings();
|
||||
changeEmbedFrontendsSettings();
|
||||
})
|
||||
|
||||
utils.latency('youtube', 'invidious', document, location, true)
|
||||
utils.latency('youtube', 'piped', document, location, true)
|
||||
utils.latency('youtube', 'pipedMaterial', document, location, true)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
utils.processDefaultCustomInstances('youtube', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('youtube', frontends[i], document, location)
|
||||
}
|
||||
|
@ -15,54 +15,70 @@ section#youtube_page.option-block
|
||||
option(value="freetube") FreeTube
|
||||
option(value="yatte") Yattee
|
||||
|
||||
#freetube-yatte
|
||||
#youtube-embedded_frontend
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_embeddedVids__") Embedded Videos Frontend
|
||||
select#youtube-embed_frontend
|
||||
option(value="invidious") Invidious
|
||||
option(value="piped") Piped
|
||||
option(value="pipedMaterial") Piped-Material
|
||||
option(value="youtube") Youtube
|
||||
|
||||
#invidious-piped-pipedMaterial
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_protocol__") Protocol
|
||||
select#youtube-protocol
|
||||
option(value="normal" data-localise="__MSG_normal__") Normal
|
||||
option(value="tor" data-localise="__MSG_tor__") Tor
|
||||
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#youtube-redirect_type
|
||||
option(value="both" data-localise="__MSG_both__") both
|
||||
option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded
|
||||
option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded
|
||||
.some-block.option-block
|
||||
h4(data-localise="__MSG_redirectType__") Redirect Type
|
||||
select#youtube-redirect_type
|
||||
option(value="both" data-localise="__MSG_both__") both
|
||||
option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded
|
||||
option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded
|
||||
|
||||
#invidious
|
||||
hr
|
||||
.normal
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://invidious.com')
|
||||
+instances('http://invidious.com')
|
||||
include ../../widgets/latency.pug
|
||||
+latency('invidious')
|
||||
.tor
|
||||
+instances('https://invidious.onion')
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://invidious.onion')
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://invidious.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://invidious.loki')
|
||||
|
||||
#piped
|
||||
hr
|
||||
.normal
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://piped.com')
|
||||
include ../../widgets/latency.pug
|
||||
+latency('piped')
|
||||
.tor
|
||||
+instances('https://piped.onion')
|
||||
+instances('http://piped.onion')
|
||||
include ../../widgets/instances.pug
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://piped.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://piped.loki')
|
||||
|
||||
#pipedMaterial
|
||||
hr
|
||||
.normal
|
||||
include ../../widgets/instances.pug
|
||||
+instances('https://piped-material.com')
|
||||
include ../../widgets/latency.pug
|
||||
+latency('pipedMaterial')
|
||||
.tor
|
||||
+instances('https://piped-material.onion')
|
||||
|
||||
+instances('http://piped-material.onion')
|
||||
include ../../widgets/instances.pug
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://piped-material.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://piped-material.loki')
|
||||
|
||||
script(type="module" src="./widgets/youtube.js")
|
||||
|
@ -1,23 +1,61 @@
|
||||
import utils from "../../../assets/javascripts/utils.js";
|
||||
|
||||
// UNCOMMENT ALL COMMENTS ONCE OTHER FRONTENDS EXIST
|
||||
|
||||
const frontends = new Array("beatbump")
|
||||
const protocols = new Array("normal", "tor", "i2p", "loki")
|
||||
|
||||
let enable = document.getElementById("youtubeMusic-enable");
|
||||
const youtubeMusic = document.getElementById('youtubeMusic_page');
|
||||
//const frontend = document.getElementById("youtubeMusic-frontend");
|
||||
let protocol
|
||||
|
||||
/*
|
||||
function changeFrontendsSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
if (frontends[i] == frontend.value) {
|
||||
frontendDiv.style.display = 'block'
|
||||
} else {
|
||||
frontendDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function changeProtocolSettings() {
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
const frontendDiv = document.getElementById(frontends[i])
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
const protocolDiv = frontendDiv.getElementsByClassName(protocols[x])[0]
|
||||
if (protocols[x] == protocol) {
|
||||
protocolDiv.style.display = 'block'
|
||||
} else {
|
||||
protocolDiv.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
browser.storage.local.get(
|
||||
[
|
||||
"disableYoutubeMusic",
|
||||
"protocol"
|
||||
],
|
||||
r => {
|
||||
enable.checked = !r.disableYoutubeMusic;
|
||||
enable.checked = !r.disableYoutubeMusic
|
||||
protocol = r.protocol
|
||||
changeProtocolSettings()
|
||||
}
|
||||
);
|
||||
|
||||
youtubeMusic.addEventListener("change", () => {
|
||||
browser.storage.local.set({
|
||||
disableYoutubeMusic: !enable.checked,
|
||||
})
|
||||
browser.storage.local.set({ disableYoutubeMusic: !enable.checked })
|
||||
})
|
||||
|
||||
utils.processDefaultCustomInstances('youtubeMusic', 'beatbump', 'normal', document);
|
||||
|
||||
utils.latency('youtubeMusic', 'beatbump', document, location, true)
|
||||
for (let i = 0; i < frontends.length; i++) {
|
||||
for (let x = 0; x < protocols.length; x++) {
|
||||
utils.processDefaultCustomInstances('youtubeMusic', frontends[i], protocols[x], document)
|
||||
}
|
||||
utils.latency('youtubeMusic', frontends[i], document, location)
|
||||
}
|
||||
|
@ -13,5 +13,14 @@ section#youtubeMusic_page.option-block
|
||||
+instances('https://beatbump.wewe')
|
||||
include ../../widgets/latency.pug
|
||||
+latency('beatbump')
|
||||
.tor
|
||||
+instances('http://beatbump.onion')
|
||||
include ../../widgets/instances.pug
|
||||
.i2p
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://beatbump.i2p')
|
||||
.loki
|
||||
include ../../widgets/instances.pug
|
||||
+instances('http://beatbump.loki')
|
||||
|
||||
script(type="module" src="./widgets/youtubeMusic.js")
|
||||
|
@ -130,7 +130,7 @@ browser.storage.local.get(
|
||||
"disablePeertubeTargets",
|
||||
"disableLbryTargets",
|
||||
"disableSendTarget",
|
||||
'popupFrontends',
|
||||
"popupFrontends",
|
||||
],
|
||||
r => {
|
||||
disableTwitterCurrentSite.checked = !r.disableTwitter; disableTwitterAllSites.checked = !r.disableTwitter;
|
||||
@ -327,4 +327,4 @@ for (const a of document.getElementsByTagName('a')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user