Added latency test #134

This commit is contained in:
ManeraKai 2022-04-17 15:27:21 +03:00
parent aa651d6392
commit f17463a9ea
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
62 changed files with 5465 additions and 306 deletions

3
.gitignore vendored
View File

@ -2,5 +2,4 @@ web-ext-artifacts/
.DS_Store
nod
node_modules
package-lock.json
src/pages/options/*/*.html
package-lock.json

View File

@ -49,26 +49,26 @@ body.option(dir="auto")
svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor")
path(d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z")
x(data-localise="__MSG_updateInstances__") Update Instances
|   
label.button.button-inline(for="import-settings")
svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor")
path(d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z")
| 
x(data-localise="__MSG_importSettings__") Import Settings
input#import-settings.button.button-inline(type="file" style="display:none;")
input#import-settings.button.button-inline(type="file" style="display:none;")
|   
a#export-settings.button.button-inline
svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor")
path(d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z")
| 
x(data-localise="__MSG_exportSettings__") Export Settings
|   
a#reset-settings.button.button-inline
svg(xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor")
path(d="M12,5V2L8,6l4,4V7c3.31,0,6,2.69,6,6c0,2.97-2.17,5.43-5,5.91v2.02c3.95-0.49,7-3.85,7-7.93C20,8.58,16.42,5,12,5z")

View File

@ -24,6 +24,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://rimgo.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://rimgo.onion')
@ -32,5 +34,7 @@ body.option(dir="auto")
include ../../widgets/instances.pug
+instances('https://rimgo.onion')
script(type="module" src="../init.js")
script(type="module" src="./imgur.js")

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://bibliogram.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://bibliogram.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://librarian.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://librarian.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://facilmap.com')
include ../../widgets/latency.pug
+latency()
script(type="module" src="../init.js")
script(type="module" src="./maps.js")

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://scribe.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://scribe.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://simpleertube.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://simpleertube.onion')

View File

@ -31,9 +31,11 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://pixivMoe.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://pixivMoe.onion')
script(type="module" src="../init.js")
script(type="module" src="./pixiv.js")

View File

@ -36,6 +36,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://libreddit.com')
include ../../widgets/latency.pug
+latency('libreddit')
.tor
include ../../widgets/instances.pug
+instances('https://libreddit.onion')
@ -44,10 +46,11 @@ body.option(dir="auto")
hr
.normal
include ../../widgets/instances.pug
+instances('https://libreddit.com')
+instances('https://teddit.com')
+latency('teddit')
.tor
include ../../widgets/instances.pug
+instances('https://libreddit.onion')
+instances('https://teddit.onion')
script(type="module" src="../init.js")
script(type="module" src="./reddit.js")

View File

@ -37,6 +37,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://searx.com')
include ../../widgets/latency.pug
+latency('searx')
.tor
include ../../widgets/instances.pug
+instances('https://searx.onion')
@ -49,6 +51,7 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://searxng.com')
+latency('searxng')
.tor
include ../../widgets/instances.pug
+instances('https://searxng.onion')
@ -61,6 +64,7 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://whoogle.com')
+latency('whoogle')
.tor
include ../../widgets/instances.pug
+instances('https://whoogle.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://send.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://send.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://librespeed.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://librespeed.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://soju.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://soju.onion')

View File

@ -23,6 +23,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://proxitok.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://proxitok.onion')

View File

@ -46,19 +46,22 @@ body.option(dir="auto")
option(value="deepl") Deepl
option(value="iciba") ICIBA
option(value="reverso") Reverso
.normal
include ../../widgets/instances.pug
+instances('https://simplytranslate.org')
include ../../widgets/latency.pug
+latency('simplyTranslate')
.tor
include ../../widgets/instances.pug
+instances('http://hxecvvetgrznmprg.onion')
#lingva
.normal
include ../../widgets/instances.pug
+instances('https://lingvatranslate.com')
+latency('lingva')
.tor
include ../../widgets/instances.pug
+instances('http://tyzxppdeoojdnaux.onion')

View File

@ -104,6 +104,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://nitter.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://nitter.onion')

View File

@ -24,6 +24,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://wikiless.com')
include ../../widgets/latency.pug
+latency()
.tor
include ../../widgets/instances.pug
+instances('https://wikiless.onion')

View File

@ -322,6 +322,8 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://invidious.com')
include ../../widgets/latency.pug
+latency('invidious')
.tor
include ../../widgets/instances.pug
+instances('https://invidious.onion')
@ -643,6 +645,7 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://piped.com')
+latency('piped')
.tor
include ../../widgets/instances.pug
+instances('https://piped.onion')
@ -713,6 +716,7 @@ body.option(dir="auto")
.normal
include ../../widgets/instances.pug
+instances('https://piped-material.com')
+latency('pipedMaterial')
.tor
include ../../widgets/instances.pug
+instances('https://piped-material.onion')

View File

@ -15,7 +15,10 @@ body.option(dir="auto")
#beatbump
hr
.normal
include ../../widgets/instances.pug
+instances('https://beatbump.wewe')
script(type="module" src="../init.js")
script(type="module" src="./youtubeMusic.js")
include ../../widgets/instances.pug
+instances('https://beatbump.wewe')
include ../../widgets/latency.pug
+latency()
script(type="module" src="../init.js")
script(type="module" src="./youtubeMusic.js")

13
pug/widgets/latency.pug Normal file
View File

@ -0,0 +1,13 @@
mixin latency(service)
- var latencyVal
if (service)
- latencyVal = `latency-${service}`
else
- latencyVal = `latency`
label.button.button-inline(id=`${latencyVal}-label` for=latencyVal)
svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor")
path(d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z")
| 
x(data-localise="__MSG_testInstancesLatency__") Test Instances Latency
input.button.button-inline(id=latencyVal style="display:none;")

View File

@ -19,7 +19,6 @@ let cloudflareList = [];
async function initCloudflareList() {
return new Promise(resolve => {
fetch('/instances/cloudflare.json').then(response => response.text()).then(data => {
console.log(data);
cloudflareList = data;
resolve();
})
@ -90,8 +89,6 @@ function protocolHost(url) {
return `${url.protocol}//${url.host}`;
}
async function processDefaultCustomInstances(
name,
protocol,
@ -100,8 +97,10 @@ async function processDefaultCustomInstances(
getNameRedirectsChecks,
setNameRedirectsChecks,
getNameCustomRedirects,
setNameCustomRedirects
setNameCustomRedirects,
instancesLatency,
) {
instancesLatency = instancesLatency ?? [];
let nameProtocolElement = document.getElementById(name).getElementsByClassName(protocol)[0];
let nameCustomInstances = [];
@ -123,12 +122,10 @@ async function processDefaultCustomInstances(
}
nameDefaultRedirects = getNameRedirectsChecks();
console.log('cloudflareList', cloudflareList)
nameCheckListElement.innerHTML =
[
`<div><x data-localise="__MSG_toggleAll__">Toggle All</x><input type="checkbox" class="toogle-all" /></div>`,
...nameHelper.getRedirects()[name][protocol].map(x => `<div><x>${x}${cloudflareList.includes(x) ? ' <span style="color:red;">cloudflare</span>' : ''}</x><input type="checkbox" class="${x}" /></div>`),
...nameHelper.getRedirects()[name][protocol].map(x => `<div><x>${x}${cloudflareList.includes(x) ? ' <span style="color:red;">cloudflare</span>' : ''} ${x in instancesLatency ? '<span style="color:' + (instancesLatency[x] <= 1000 ? "green" : instancesLatency[x] <= 2000 ? "orange" : "red") + ';">' + (instancesLatency[x] == 5000 ? '5000ms+' : instancesLatency[x] + 'ms') + '</span>' : ''}</x > <input type="checkbox" class="${x}" /></div > `),
].join('\n<hr>\n');
localise.localisePage();
@ -161,15 +158,15 @@ async function processDefaultCustomInstances(
function calcNameCustomInstances() {
nameProtocolElement.getElementsByClassName('custom-checklist')[0].innerHTML =
nameCustomInstances.map(
x => `<div>${x}<button class="add clear-${x}">
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
fill="currentColor">
<path d="M0 0h24v24H0V0z" fill="none" />
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
</svg>
</button>
</div>
<hr>`
x => `<div> ${x} <button class="add clear-${x}">
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"
fill="currentColor">
<path d="M0 0h24v24H0V0z" fill="none" />
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
</svg>
</button>
</div >
<hr>`
).join('\n');
for (const item of nameCustomInstances) {
@ -201,6 +198,46 @@ function isRtl() {
return ["ar", "iw", "ku", "fa", "ur"].includes(browser.i18n.getUILanguage())
}
async function ping(href) {
return new Promise(resolve => {
let http = new XMLHttpRequest();
http.open("GET", href + '?_=' + new Date().getTime(), /*async*/true);
http.timeout = 5000;
let started = new Date().getTime();
http.onreadystatechange = function () {
if (http.readyState == 2) {
if (http.status == 200) {
let ended = new Date().getTime();
let ms = ended - started;
http.abort();
resolve(ms);
}
else resolve()
}
};
http.ontimeout = () => resolve(5000)
http.onerror = () => resolve()
try {
http.send(null);
} catch (exception) {
resolve()
}
});
}
async function testLatency(element, instances) {
return new Promise(async resolve => {
let myList = {};
for (const href of instances) await ping(href).then(m => {
if (m) {
myList[href] = m;
element.innerHTML = `${href}:&nbsp;${'<span style="color:' + (m <= 1000 ? "green" : m <= 2000 ? "orange" : "red") + ';">' + (m == 5000 ? '5000ms+' : m + 'ms') + '</span>'}`;
console.log(`${href}: ${m}ms`)
}
})
resolve(myList);
})
}
export default {
getRandomInstance,
updateInstances,
@ -208,4 +245,5 @@ export default {
isFirefox,
processDefaultCustomInstances,
isRtl,
};
testLatency,
}

View File

@ -0,0 +1,223 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a class="selected" href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_theme__">Theme</h4>
<select id="theme">
<option value="DEFAULT" data-localise="__MSG_system__">System</option>
<option value="light" data-localise="__MSG_light__">Light</option>
<option value="dark" data-localise="__MSG_dark__">Dark</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_applyTheme__">Apply Theme to sites</h4>
<input id="apply-theme-to-sites" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_alwaysPref__">Always use Preferred Instances</h4>
<input id="always-use-preferred" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_autoRedirect__">Auto Redirect of offline instances</h4>
<input id="auto-redirect" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_exceptions__">Exceptions</h4>
</div>
<form id="custom-exceptions-instance-form">
<div class="some-block option-block">
<div class="some-block" style="padding:0;">
<input id="exceptions-custom-instance" placeholder="https://www.google.com" type="url">&nbsp;
<select id="exceptions-custom-instance-type">
<option value="url">URL</option>
<option value="regex">Regex</option>
</select>&nbsp;
</div>
<button class="add" id="exceptions-add-instance" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</button>
</div>
</form>
<div class="checklist" id="exceptions-custom-checklist"></div>
<div class="buttons buttons-inline"><a class="button button-inline" id="update-instances">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"></path>
</svg>
<x data-localise="__MSG_updateInstances__">Update Instances</x></a>&nbsp; &nbsp;
<label class="button button-inline" for="import-settings">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_importSettings__">Import Settings</x>
</label>
<input class="button button-inline" id="import-settings" type="file" style="display:none;">&nbsp; &nbsp;<a class="button button-inline" id="export-settings">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"></path>
</svg>&nbsp;
<x data-localise="__MSG_exportSettings__">Export Settings</x></a>&nbsp; &nbsp;<a class="button button-inline" id="reset-settings">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12,5V2L8,6l4,4V7c3.31,0,6,2.69,6,6c0,2.97-2.17,5.43-5,5.91v2.02c3.95-0.49,7-3.85,7-7.93C20,8.58,16.42,5,12,5z"></path>
<path d="M6,13c0-1.65,0.67-3.15,1.76-4.24L6.34,7.34C4.9,8.79,4,10.79,4,13c0,4.08,3.05,7.44,7,7.93v-2.02 C8.17,18.43,6,15.97,6,13z"></path>
</svg>
<x data-localise="__MSG_resetSettings__">Reset Settings</x></a>
</div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customPopup__">Customize Popup</h4>
</div>
<div class="checklist-popup" id="popup-frontends-checklist">
<div>
<div><img src="../../../assets/images/youtube-icon.png">YouTube</div>
<input id="youtube" type="checkbox">
</div>
<div>
<div><img src="../../../assets/images/youtube-music-icon.png">YoutubeMusic</div>
<input id="youtubeMusic" type="checkbox">
</div>
<div>
<div><img src="../../../assets/images/twitter-icon.png">Twitter</div>
<input id="twitter" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/instagram-icon.png">Instagram</div>
<input id="instagram" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/tiktok-icon.png">TikTok</div>
<input id="tikTok" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/imgur-icon.png">Imgur</div>
<input id="imgur" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/reddit-icon.png">Reddit</div>
<input id="reddit" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/pixiv-icon.svg">Pixiv</div>
<input id="pixiv" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/spotify-icon.png">Spotify</div>
<input id="spotify" type="checkbox">
</div>
<div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg>Search
</div>
<input id="search" type="checkbox">
</div>
<div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg>Translate
</div>
<input id="translate" type="checkbox">
</div>
<div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z"></path>
</svg>Maps
</div>
<input id="maps" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/wikipedia-icon.svg">Wikipedia</div>
<input id="wikipedia" type="checkbox">
</div>
<div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg>Medium
</div>
<input id="medium" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/peertube-icon.svg">Peertube</div>
<input id="peertube" type="checkbox">
</div>
<div>
<div> <img src="../../../assets/images/lbry-icon.png">LBRY/Odysee</div>
<input id="lbry" type="checkbox">
</div>
<div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg>Send Files
</div>
<input id="sendTargets" type="checkbox">
</div>
<hr>
</div>
<script type="module" src="../init.js"></script>
<script type="module" src="./general.js"></script>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
</section>
</body>

View File

@ -170,6 +170,6 @@ generalHelper.init().then(() => {
})
popupFrontends = generalHelper.getPopupFrontends();
for (const frontend of generalHelper.allPopupFrontends)
for (const frontend of generalHelper.allPopupFrontends)
document.getElementById(frontend).checked = popupFrontends.includes(frontend);
})

View File

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a class="selected" href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-imgur" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
<option value="i2p" data-localise="__MSG_i2p__">I2P</option>
</select>
</div>
<div id="rimgo">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://rimgo.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://rimgo.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://rimgo.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./imgur.js"></script>
</body>

View File

@ -8,7 +8,7 @@ disableImgurElement.addEventListener("change",
let protocolElement = document.getElementById("protocol")
protocolElement.addEventListener("change",
(event) => {
event => {
let protocol = event.target.options[protocolElement.selectedIndex].value
imgurHelper.setProtocol(protocol);
changeProtocolSettings(protocol);
@ -20,19 +20,19 @@ function changeProtocolSettings(protocol) {
let torDiv = document.getElementsByClassName("tor")[0];
let i2pDiv = document.getElementsByClassName("i2p")[0];
if (protocol == 'normal') {
normalDiv.style.display = 'block';
torDiv.style.display = 'none';
i2pDiv.style.display = 'none';
normalDiv.style.display = 'block';
torDiv.style.display = 'none';
i2pDiv.style.display = 'none';
}
else if (protocol == 'tor') {
normalDiv.style.display = 'none';
torDiv.style.display = 'block';
i2pDiv.style.display = 'none';
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';
normalDiv.style.display = 'none';
torDiv.style.display = 'none';
i2pDiv.style.display = 'block';
}
}
@ -44,16 +44,19 @@ imgurHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'rimgo',
'normal',
imgurHelper,
document,
imgurHelper.getRimgoNormalRedirectsChecks,
imgurHelper.setRimgoNormalRedirectsChecks,
imgurHelper.getRimgoNormalCustomRedirects,
imgurHelper.setRimgoNormalCustomRedirects
);
browser.storage.local.get("rimgoLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'rimgo',
'normal',
imgurHelper,
document,
imgurHelper.getRimgoNormalRedirectsChecks,
imgurHelper.setRimgoNormalRedirectsChecks,
imgurHelper.getRimgoNormalCustomRedirects,
imgurHelper.setRimgoNormalCustomRedirects,
r.rimgoLatency
);
});
commonHelper.processDefaultCustomInstances(
'rimgo',
@ -67,13 +70,42 @@ imgurHelper.init().then(() => {
);
commonHelper.processDefaultCustomInstances(
'rimgo',
'i2p',
imgurHelper,
document,
imgurHelper.getRimgoI2pRedirectsChecks,
imgurHelper.setRimgoI2pRedirectsChecks,
imgurHelper.getRimgoI2pCustomRedirects,
imgurHelper.setRimgoI2pCustomRedirects
'rimgo',
'i2p',
imgurHelper,
document,
imgurHelper.getRimgoI2pRedirectsChecks,
imgurHelper.setRimgoI2pRedirectsChecks,
imgurHelper.getRimgoI2pCustomRedirects,
imgurHelper.setRimgoI2pCustomRedirects
);
});
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await imgurHelper.init();
let redirects = imgurHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.rimgo.normal).then(r => {
browser.storage.local.set({ rimgoLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'rimgo',
'normal',
imgurHelper,
document,
imgurHelper.getRimgoNormalRedirectsChecks,
imgurHelper.setRimgoNormalRedirectsChecks,
imgurHelper.getRimgoNormalCustomRedirects,
imgurHelper.setRimgoNormalCustomRedirects,
r
);
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a class="selected" href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-bibliogram" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="bibliogram">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://bibliogram.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://bibliogram.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./instagram.js"></script>
</body>

View File

@ -36,16 +36,19 @@ instagramHelper.init().then(() => {
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'bibliogram',
'normal',
instagramHelper,
document,
instagramHelper.getBibliogramNormalRedirectsChecks,
instagramHelper.setBibliogramNormalRedirectsChecks,
instagramHelper.getBibliogramNormalCustomRedirects,
instagramHelper.setBibliogramNormalCustomRedirects
)
browser.storage.local.get("bibliogramLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'bibliogram',
'normal',
instagramHelper,
document,
instagramHelper.getBibliogramNormalRedirectsChecks,
instagramHelper.setBibliogramNormalRedirectsChecks,
instagramHelper.getBibliogramNormalCustomRedirects,
instagramHelper.setBibliogramNormalCustomRedirects,
r.bibliogramLatency,
)
})
commonHelper.processDefaultCustomInstances(
'bibliogram',
@ -57,4 +60,34 @@ instagramHelper.init().then(() => {
instagramHelper.getBibliogramTorCustomRedirects,
instagramHelper.setBibliogramTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await instagramHelper.init();
let redirects = instagramHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.bibliogram.normal).then(r => {
browser.storage.local.set({ bibliogramLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'bibliogram',
'normal',
instagramHelper,
document,
instagramHelper.getBibliogramNormalRedirectsChecks,
instagramHelper.setBibliogramNormalRedirectsChecks,
instagramHelper.getBibliogramNormalCustomRedirects,
instagramHelper.setBibliogramNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a class="selected" href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-lbry" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="librarian">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://librarian.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://librarian.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./lbry.js"></script>
</body>

View File

@ -35,16 +35,19 @@ lbryHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'librarian',
'normal',
lbryHelper,
document,
lbryHelper.getLibrarianNormalRedirectsChecks,
lbryHelper.setLibrarianNormalRedirectsChecks,
lbryHelper.getLibrarianNormalCustomRedirects,
lbryHelper.setLibrarianNormalCustomRedirects
);
browser.storage.local.get("librarianLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'librarian',
'normal',
lbryHelper,
document,
lbryHelper.getLibrarianNormalRedirectsChecks,
lbryHelper.setLibrarianNormalRedirectsChecks,
lbryHelper.getLibrarianNormalCustomRedirects,
lbryHelper.setLibrarianNormalCustomRedirects,
r.librarianLatency,
);
})
commonHelper.processDefaultCustomInstances(
'librarian',
@ -56,4 +59,34 @@ lbryHelper.init().then(() => {
lbryHelper.getLibrarianTorCustomRedirects,
lbryHelper.setLibrarianTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await lbryHelper.init();
let redirects = lbryHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.librarian.normal).then(r => {
browser.storage.local.set({ librarianLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'librarian',
'normal',
lbryHelper,
document,
lbryHelper.getLibrarianNormalRedirectsChecks,
lbryHelper.setLibrarianNormalRedirectsChecks,
lbryHelper.getLibrarianNormalCustomRedirects,
lbryHelper.setLibrarianNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a class="selected" href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-osm" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_frontend__">Frontend</h4>
<select id="maps-frontend">
<option value="osm">OpenStreetMap</option>
<option value="facil">Facil Map</option>
</select>
</div>
<div id="facil">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://facilmap.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./maps.js"></script>
</body>

View File

@ -32,14 +32,46 @@ mapsHelper.init().then(() => {
mapsFrontendElement.value = frontend;
changeFrontendsSettings(frontend);
commonHelper.processDefaultCustomInstances(
'facil',
'normal',
mapsHelper,
document,
mapsHelper.getFacilNormalRedirectsChecks,
mapsHelper.setFacilNormalRedirectsChecks,
mapsHelper.getFacilNormalCustomRedirects,
mapsHelper.setFacilNormalCustomRedirects
)
})
browser.storage.local.get("facilLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'facil',
'normal',
mapsHelper,
document,
mapsHelper.getFacilNormalRedirectsChecks,
mapsHelper.setFacilNormalRedirectsChecks,
mapsHelper.getFacilNormalCustomRedirects,
mapsHelper.setFacilNormalCustomRedirects,
r.facilLatency,
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await mapsHelper.init();
let redirects = mapsHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.facil.normal).then(r => {
browser.storage.local.set({ facilLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'facil',
'normal',
mapsHelper,
document,
mapsHelper.getFacilNormalRedirectsChecks,
mapsHelper.setFacilNormalRedirectsChecks,
mapsHelper.getFacilNormalCustomRedirects,
mapsHelper.setFacilNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a class="selected" href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-medium" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="scribe">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://scribe.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://scribe.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./medium.js"></script>
</body>

View File

@ -36,16 +36,20 @@ mediumHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'scribe',
'normal',
mediumHelper,
document,
mediumHelper.getScribeNormalRedirectsChecks,
mediumHelper.setScribeNormalRedirectsChecks,
mediumHelper.getScribeNormalCustomRedirects,
mediumHelper.setScribeNormalCustomRedirects
)
browser.storage.local.get("scribeLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'scribe',
'normal',
mediumHelper,
document,
mediumHelper.getScribeNormalRedirectsChecks,
mediumHelper.setScribeNormalRedirectsChecks,
mediumHelper.getScribeNormalCustomRedirects,
mediumHelper.setScribeNormalCustomRedirects,
r.scribeLatency,
)
})
commonHelper.processDefaultCustomInstances(
'scribe',
@ -57,4 +61,33 @@ mediumHelper.init().then(() => {
mediumHelper.getScribeTorCustomRedirects,
mediumHelper.setScribeTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await mediumHelper.init();
let redirects = mediumHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.scribe.normal).then(r => {
browser.storage.local.set({ scribeLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'scribe',
'normal',
mediumHelper,
document,
mediumHelper.getScribeNormalRedirectsChecks,
mediumHelper.setScribeNormalRedirectsChecks,
mediumHelper.getScribeNormalCustomRedirects,
mediumHelper.setScribeNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a class="selected" href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-peertube" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="simpleertube">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://simpleertube.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://simpleertube.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./peertube.js"></script>
</body>

View File

@ -35,16 +35,18 @@ peertubeHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'simpleertube',
'normal',
peertubeHelper,
document,
peertubeHelper.getSimpleertubeNormalRedirectsChecks,
peertubeHelper.setSimpleertubeNormalRedirectsChecks,
peertubeHelper.getSimpleertubeNormalCustomRedirects,
peertubeHelper.setSimpleertubeNormalCustomRedirects
);
browser.storage.local.get("simpleertubeLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'simpleertube',
'normal',
peertubeHelper,
document,
peertubeHelper.getSimpleertubeNormalRedirectsChecks,
peertubeHelper.setSimpleertubeNormalRedirectsChecks,
peertubeHelper.getSimpleertubeNormalCustomRedirects,
peertubeHelper.setSimpleertubeNormalCustomRedirects
);
})
commonHelper.processDefaultCustomInstances(
'simpleertube',
@ -56,4 +58,34 @@ peertubeHelper.init().then(() => {
peertubeHelper.getSimpleertubeTorCustomRedirects,
peertubeHelper.setSimpleertubeTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await peertubeHelper.init();
let redirects = peertubeHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.simpleertube.normal).then(r => {
browser.storage.local.set({ simpleertubeLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'simpleertube',
'normal',
peertubeHelper,
document,
peertubeHelper.getSimpleertubeNormalRedirectsChecks,
peertubeHelper.setSimpleertubeNormalRedirectsChecks,
peertubeHelper.getSimpleertubeNormalCustomRedirects,
peertubeHelper.setSimpleertubeNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a class="selected" href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-pixiv" type="checkbox">
</div>
<div class="some-block option-block">
<h4>
<x data-localise="__MSG_frontend__">Frontend</x>:<span style="color:red;" data-localise="__MSG_notFullyPrivate__">This isn't a fully private frontend</span>
</h4>
<select id="maps-frontend">
<option value="pixivMoe" data-localise="__MSG_pixivMoe__">pixiv萌え</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor </option>
</select>
</div>
<div id="pixivMoe">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://pixivMoe.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://pixivMoe.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./pixiv.js"></script>
</body>

View File

@ -35,16 +35,19 @@ pixivHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'pixivMoe',
'normal',
pixivHelper,
document,
pixivHelper.getPixivMoeNormalRedirectsChecks,
pixivHelper.setPixivMoeNormalRedirectsChecks,
pixivHelper.getPixivMoeNormalCustomRedirects,
pixivHelper.setPixivMoeNormalCustomRedirects
);
browser.storage.local.get("pixivMoeLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'pixivMoe',
'normal',
pixivHelper,
document,
pixivHelper.getPixivMoeNormalRedirectsChecks,
pixivHelper.setPixivMoeNormalRedirectsChecks,
pixivHelper.getPixivMoeNormalCustomRedirects,
pixivHelper.setPixivMoeNormalCustomRedirects
);
})
commonHelper.processDefaultCustomInstances(
'pixivMoe',
@ -56,4 +59,35 @@ pixivHelper.init().then(() => {
pixivHelper.getPixivMoeTorCustomRedirects,
pixivHelper.setPixivMoeTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await pixivHelper.init();
let redirects = pixivHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.pixivMoe.normal).then(r => {
browser.storage.local.set({ pixivMoeLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'pixivMoe',
'normal',
pixivHelper,
document,
pixivHelper.getPixivMoeNormalRedirectsChecks,
pixivHelper.setPixivMoeNormalRedirectsChecks,
pixivHelper.getPixivMoeNormalCustomRedirects,
pixivHelper.setPixivMoeNormalCustomRedirects,
r,
);
latencyElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a class="selected" href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-reddit" type="checkbox">
</div>
<div class="some-block option-block">
<h4 id="frontend" data-localise="__MSG_frontend__">Frontend</h4>
<select id="reddit-frontend">
<option value="libreddit">Libreddit</option>
<option value="teddit">Teddit</option>
<option value="old">old.reddit.com</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_bypassReddit__">Bypass "Open in Reddit"</h4>
<input id="bypass-watch-on-reddit" type="checkbox">
</div>
<hr>
<div id="libreddit">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://libreddit.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-libreddit-label" for="latency-libreddit">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-libreddit" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://libreddit.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
<div id="teddit">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://teddit.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-teddit-label" for="latency-teddit">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-teddit" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://teddit.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./reddit.js"></script>
</body>

View File

@ -81,16 +81,19 @@ redditHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'libreddit',
'normal',
redditHelper,
document,
redditHelper.getLibredditNormalRedirectsChecks,
redditHelper.setLibredditNormalRedirectsChecks,
redditHelper.getLibredditNormalCustomRedirects,
redditHelper.setLibredditNormalCustomRedirects
)
browser.storage.local.get("libredditLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'libreddit',
'normal',
redditHelper,
document,
redditHelper.getLibredditNormalRedirectsChecks,
redditHelper.setLibredditNormalRedirectsChecks,
redditHelper.getLibredditNormalCustomRedirects,
redditHelper.setLibredditNormalCustomRedirects,
r.libredditLatency,
)
})
commonHelper.processDefaultCustomInstances(
'libreddit',
@ -103,16 +106,19 @@ redditHelper.init().then(() => {
redditHelper.setLibredditTorCustomRedirects
)
commonHelper.processDefaultCustomInstances(
'teddit',
'normal',
redditHelper,
document,
redditHelper.getTedditNormalRedirectsChecks,
redditHelper.setTedditNormalRedirectsChecks,
redditHelper.getTedditNormalCustomRedirects,
redditHelper.setTedditNormalCustomRedirects
);
browser.storage.local.get("tedditLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'teddit',
'normal',
redditHelper,
document,
redditHelper.getTedditNormalRedirectsChecks,
redditHelper.setTedditNormalRedirectsChecks,
redditHelper.getTedditNormalCustomRedirects,
redditHelper.setTedditNormalCustomRedirects,
r.tedditLatency,
);
})
commonHelper.processDefaultCustomInstances(
'teddit',
@ -126,3 +132,62 @@ redditHelper.init().then(() => {
);
})
let latencyLibredditElement = document.getElementById("latency-libreddit");
let latencyLibredditLabel = document.getElementById("latency-libreddit-label");
latencyLibredditElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyLibredditElement.addEventListener("click", reloadWindow);
await redditHelper.init();
let redirects = redditHelper.getRedirects();
const oldHtml = latencyLibredditLabel.innerHTML;
latencyLibredditLabel.innerHTML = '...';
commonHelper.testLatency(latencyLibredditLabel, redirects.libreddit.normal).then(r => {
browser.storage.local.set({ libredditLatency: r });
latencyLibredditLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'libreddit',
'normal',
redditHelper,
document,
redditHelper.getLibredditNormalRedirectsChecks,
redditHelper.setLibredditNormalRedirectsChecks,
redditHelper.getLibredditNormalCustomRedirects,
redditHelper.setLibredditNormalCustomRedirects,
r,
);
latencyLibredditElement.removeEventListener("click", reloadWindow);
});
}
);
let latencyTedditElement = document.getElementById("latency-teddit");
let latencyTedditLabel = document.getElementById("latency-teddit-label");
latencyTedditElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyTedditElement.addEventListener("click", reloadWindow);
await redditHelper.init();
let redirects = redditHelper.getRedirects();
const oldHtml = latencyTedditLabel.innerHTML;
latencyTedditLabel.innerHTML = '...';
commonHelper.testLatency(latencyTedditLabel, redirects.teddit.normal).then(r => {
browser.storage.local.set({ tedditLatency: r });
latencyTedditLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'teddit',
'normal',
redditHelper,
document,
redditHelper.getTedditNormalRedirectsChecks,
redditHelper.setTedditNormalRedirectsChecks,
redditHelper.getTedditNormalCustomRedirects,
redditHelper.setTedditNormalCustomRedirects,
r,
);
latencyTedditElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,300 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a class="selected" href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-search" type="checkbox">
</div>
<div class="some-block option-block">
<h4 id="frontend" data-localise="__MSG_frontend__">Frontend</h4>
<select id="search-frontend">
<option value="searx">SearX</option>
<option value="searxng">SearXNG</option>
<option value="whoogle">Whoogle</option>
<option value="startpage">Startpage</option>
</select>
</div>
<div id="searx-whoogle">
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
<option value="i2p" data-localise="__MSG_i2p__">I2P</option>
</select>
</div>
</div>
<div class="some-block">
<h4 data-localise="__MSG_searchNote__">Note: To use Search to its full potential, make LibRedirect as the Default Search Engine</h4>
</div>
<div id="searx">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searx.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-searx-label" for="latency-searx">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-searx" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searx.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searx.i2p" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
<div id="searxng">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searxng.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-searxng-label" for="latency-searxng">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-searxng" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searxng.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://searxng.i2p" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
<div id="whoogle">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://whoogle.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-whoogle-label" for="latency-whoogle">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-whoogle" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://whoogle.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://whoogle.i2p" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./search.js"></script>
</body>

View File

@ -118,16 +118,19 @@ searchHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'searx',
'normal',
searchHelper,
document,
searchHelper.getSearxNormalRedirectsChecks,
searchHelper.setSearxNormalRedirectsChecks,
searchHelper.getSearxNormalCustomRedirects,
searchHelper.setSearxNormalCustomRedirects
);
browser.storage.local.get("searxLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'searx',
'normal',
searchHelper,
document,
searchHelper.getSearxNormalRedirectsChecks,
searchHelper.setSearxNormalRedirectsChecks,
searchHelper.getSearxNormalCustomRedirects,
searchHelper.setSearxNormalCustomRedirects,
r.searxLatency
);
})
commonHelper.processDefaultCustomInstances(
'searx',
@ -151,16 +154,19 @@ searchHelper.init().then(() => {
searchHelper.setSearxI2pCustomRedirects
);
commonHelper.processDefaultCustomInstances(
'searxng',
'normal',
searchHelper,
document,
searchHelper.getSearxngNormalRedirectsChecks,
searchHelper.setSearxngNormalRedirectsChecks,
searchHelper.getSearxngNormalCustomRedirects,
searchHelper.setSearxngNormalCustomRedirects
);
browser.storage.local.get("searxngLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'searxng',
'normal',
searchHelper,
document,
searchHelper.getSearxngNormalRedirectsChecks,
searchHelper.setSearxngNormalRedirectsChecks,
searchHelper.getSearxngNormalCustomRedirects,
searchHelper.setSearxngNormalCustomRedirects,
r.searxngLatency,
);
})
commonHelper.processDefaultCustomInstances(
'searxng',
@ -184,16 +190,19 @@ searchHelper.init().then(() => {
searchHelper.setSearxngI2pCustomRedirects
);
commonHelper.processDefaultCustomInstances(
'whoogle',
'normal',
searchHelper,
document,
searchHelper.getWhoogleNormalRedirectsChecks,
searchHelper.setWhoogleNormalRedirectsChecks,
searchHelper.getWhoogleNormalCustomRedirects,
searchHelper.setWhoogleNormalCustomRedirects
);
browser.storage.local.get("whoogleLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'whoogle',
'normal',
searchHelper,
document,
searchHelper.getWhoogleNormalRedirectsChecks,
searchHelper.setWhoogleNormalRedirectsChecks,
searchHelper.getWhoogleNormalCustomRedirects,
searchHelper.setWhoogleNormalCustomRedirects,
r.whoogleLatency,
);
})
commonHelper.processDefaultCustomInstances(
'whoogle',
@ -217,3 +226,91 @@ searchHelper.init().then(() => {
searchHelper.setWhoogleI2pCustomRedirects
);
});
let latencySearxElement = document.getElementById("latency-searx");
let latencySearxLabel = document.getElementById("latency-searx-label");
latencySearxElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencySearxElement.addEventListener("click", reloadWindow);
await searchHelper.init();
let redirects = searchHelper.getRedirects();
const oldHtml = latencySearxLabel.innerHTML;
latencySearxLabel.innerHTML = '...';
commonHelper.testLatency(latencySearxLabel, redirects.searx.normal).then(r => {
browser.storage.local.set({ searxLatency: r });
latencySearxLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'searx',
'normal',
searchHelper,
document,
searchHelper.getSearxNormalRedirectsChecks,
searchHelper.setSearxNormalRedirectsChecks,
searchHelper.getSearxNormalCustomRedirects,
searchHelper.setSearxNormalCustomRedirects,
r,
);
latencySearxElement.removeEventListener("click", reloadWindow);
});
}
);
let latencySearxngElement = document.getElementById("latency-searxng");
let latencySearxngLabel = document.getElementById("latency-searxng-label");
latencySearxngElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencySearxngElement.addEventListener("click", reloadWindow);
await searchHelper.init();
let redirects = searchHelper.getRedirects();
const oldHtml = latencySearxngLabel.innerHTML;
latencySearxngLabel.innerHTML = '...';
commonHelper.testLatency(latencySearxngLabel, redirects.searxng.normal).then(r => {
browser.storage.local.set({ searxngLatency: r });
latencySearxngLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'searxng',
'normal',
searchHelper,
document,
searchHelper.getSearxngNormalRedirectsChecks,
searchHelper.setSearxngNormalRedirectsChecks,
searchHelper.getSearxngNormalCustomRedirects,
searchHelper.setSearxngNormalCustomRedirects,
r,
);
latencySearxngElement.removeEventListener("click", reloadWindow);
});
}
);
let latencyWhoogleElement = document.getElementById("latency-whoogle");
let latencyWhoogleLabel = document.getElementById("latency-whoogle-label");
latencyWhoogleElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyWhoogleElement.addEventListener("click", reloadWindow);
await searchHelper.init();
let redirects = searchHelper.getRedirects();
const oldHtml = latencyWhoogleLabel.innerHTML;
latencyWhoogleLabel.innerHTML = '...';
commonHelper.testLatency(latencyWhoogleLabel, redirects.whoogle.normal).then(r => {
browser.storage.local.set({ whoogleLatency: r });
latencyWhoogleLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'whoogle',
'normal',
searchHelper,
document,
searchHelper.getWhoogleNormalRedirectsChecks,
searchHelper.setWhoogleNormalRedirectsChecks,
searchHelper.getWhoogleNormalCustomRedirects,
searchHelper.setWhoogleNormalCustomRedirects,
r,
);
latencyWhoogleElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a class="selected" href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-sendTargets" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="send">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://send.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://send.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./sendTargets.js"></script>
</body>

View File

@ -35,16 +35,19 @@ sendTargetsHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'send',
'normal',
sendTargetsHelper,
document,
sendTargetsHelper.getSendNormalRedirectsChecks,
sendTargetsHelper.setSendNormalRedirectsChecks,
sendTargetsHelper.getSendNormalCustomRedirects,
sendTargetsHelper.setSendNormalCustomRedirects
);
browser.storage.local.get("sendLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'send',
'normal',
sendTargetsHelper,
document,
sendTargetsHelper.getSendNormalRedirectsChecks,
sendTargetsHelper.setSendNormalRedirectsChecks,
sendTargetsHelper.getSendNormalCustomRedirects,
sendTargetsHelper.setSendNormalCustomRedirects,
r.sendLatency,
);
})
commonHelper.processDefaultCustomInstances(
'send',
@ -56,4 +59,33 @@ sendTargetsHelper.init().then(() => {
sendTargetsHelper.getSendTorCustomRedirects,
sendTargetsHelper.setSendTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await sendTargetsHelper.init();
let redirects = sendTargetsHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.send.normal).then(r => {
browser.storage.local.set({ sendLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'send',
'normal',
sendTargetsHelper,
document,
sendTargetsHelper.getSendNormalRedirectsChecks,
sendTargetsHelper.setSendNormalRedirectsChecks,
sendTargetsHelper.getSendNormalCustomRedirects,
sendTargetsHelper.setSendNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a class="selected" href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-speedtest" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="librespeed">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://librespeed.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://librespeed.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./speedtest.js"></script>
</body>

View File

@ -35,6 +35,7 @@ speedtestHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
browser.storage.local.get("librespeedLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'librespeed',
'normal',
@ -43,8 +44,10 @@ speedtestHelper.init().then(() => {
speedtestHelper.getLibrespeedNormalRedirectsChecks,
speedtestHelper.setLibrespeedNormalRedirectsChecks,
speedtestHelper.getLibrespeedNormalCustomRedirects,
speedtestHelper.setLibrespeedNormalCustomRedirects
speedtestHelper.setLibrespeedNormalCustomRedirects,
r.librespeedLatency,
);
})
commonHelper.processDefaultCustomInstances(
'librespeed',
@ -56,4 +59,33 @@ speedtestHelper.init().then(() => {
speedtestHelper.getLibrespeedTorCustomRedirects,
speedtestHelper.setLibrespeedTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await speedtestHelper.init();
let redirects = speedtestHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.librespeed.normal).then(r => {
browser.storage.local.set({ librespeedLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'librespeed',
'normal',
speedtestHelper,
document,
speedtestHelper.getLibrespeedNormalRedirectsChecks,
speedtestHelper.setLibrespeedNormalRedirectsChecks,
speedtestHelper.getLibrespeedNormalCustomRedirects,
speedtestHelper.setLibrespeedNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a class="selected" href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-spotify" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="soju">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://soju.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://soju.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<script type="module" src="../init.js"></script>
<script type="module" src="./spotify.js"></script>
</div>
</section>
</body>

View File

@ -35,16 +35,19 @@ spotifyHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'soju',
'normal',
spotifyHelper,
document,
spotifyHelper.getSojuNormalRedirectsChecks,
spotifyHelper.setSojuNormalRedirectsChecks,
spotifyHelper.getSojuNormalCustomRedirects,
spotifyHelper.setSojuNormalCustomRedirects
);
browser.storage.local.get("sojuLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'soju',
'normal',
spotifyHelper,
document,
spotifyHelper.getSojuNormalRedirectsChecks,
spotifyHelper.setSojuNormalRedirectsChecks,
spotifyHelper.getSojuNormalCustomRedirects,
spotifyHelper.setSojuNormalCustomRedirects,
r.sojuLatency,
);
})
commonHelper.processDefaultCustomInstances(
'soju',
@ -56,4 +59,33 @@ spotifyHelper.init().then(() => {
spotifyHelper.getSojuTorCustomRedirects,
spotifyHelper.setSojuTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await spotifyHelper.init();
let redirects = spotifyHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.soju.normal).then(r => {
browser.storage.local.set({ sojuLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'soju',
'normal',
spotifyHelper,
document,
spotifyHelper.getSojuNormalRedirectsChecks,
spotifyHelper.setSojuNormalRedirectsChecks,
spotifyHelper.getSojuNormalCustomRedirects,
spotifyHelper.setSojuNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a class="selected" href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-tiktok" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<div id="proxiTok">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://proxitok.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://proxitok.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./tiktok.js"></script>
</body>

View File

@ -35,17 +35,19 @@ tiktokHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'proxiTok',
'normal',
tiktokHelper,
document,
tiktokHelper.getProxiTokNormalRedirectsChecks,
tiktokHelper.setProxiTokNormalRedirectsChecks,
tiktokHelper.getProxiTokNormalCustomRedirects,
tiktokHelper.setProxiTokNormalCustomRedirects
);
browser.storage.local.get("proxiTokLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'proxiTok',
'normal',
tiktokHelper,
document,
tiktokHelper.getProxiTokNormalRedirectsChecks,
tiktokHelper.setProxiTokNormalRedirectsChecks,
tiktokHelper.getProxiTokNormalCustomRedirects,
tiktokHelper.setProxiTokNormalCustomRedirects,
r.proxiTokLatency,
);
})
commonHelper.processDefaultCustomInstances(
'proxiTok',
'tor',
@ -56,4 +58,33 @@ tiktokHelper.init().then(() => {
tiktokHelper.getProxiTokTorCustomRedirects,
tiktokHelper.setProxiTokTorCustomRedirects
)
})
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await tiktokHelper.init();
let redirects = tiktokHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.proxiTok.normal).then(r => {
browser.storage.local.set({ proxiTokLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'proxiTok',
'normal',
tiktokHelper,
document,
tiktokHelper.getProxiTokNormalRedirectsChecks,
tiktokHelper.setProxiTokNormalRedirectsChecks,
tiktokHelper.getProxiTokNormalCustomRedirects,
tiktokHelper.setProxiTokNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,418 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a class="selected" href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-simplyTranslate" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_frontend__">Frontend</h4>
<select id="translate-frontend">
<option value="simplyTranslate">SimplyTranslate</option>
<option value="lingva">Lingva</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
</select>
</div>
<hr>
<div id="simplyTranslate">
<div class="some-block option-block">
<h4 data-localise="__MSG_from__">From</h4>
<select class="from">
<option value="auto">Auto</option>
<option value="af">Afrikaans</option>
<option value="sq">Albanian</option>
<option value="am">Amharic</option>
<option value="ar">Arabic</option>
<option value="hy">Armenian</option>
<option value="az">Azerbaijani</option>
<option value="eu">Basque</option>
<option value="be">Belarusian</option>
<option value="bn">Bengali</option>
<option value="bs">Bosnian</option>
<option value="bg">Bulgarian</option>
<option value="ca">Catalan</option>
<option value="ceb">Cebuano</option>
<option value="ny">Chichewa</option>
<option value="zh-CN">Chinese</option>
<option value="co">Corsican</option>
<option value="hr">Croatian</option>
<option value="cs">Czech</option>
<option value="da">Danish</option>
<option value="nl">Dutch</option>
<option value="en">English</option>
<option value="eo">Esperanto</option>
<option value="et">Estonian</option>
<option value="tl">Filipino</option>
<option value="fi">Finnish</option>
<option value="fr">French</option>
<option value="fy">Frisian</option>
<option value="gl">Galician</option>
<option value="ka">Georgian</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="gu">Gujarati</option>
<option value="ht">Haitian Creole</option>
<option value="ha">Hausa</option>
<option value="haw">Hawaiian</option>
<option value="iw">Hebrew</option>
<option value="hi">Hindi</option>
<option value="hmn">Hmong</option>
<option value="hu">Hungarian</option>
<option value="is">Icelandic</option>
<option value="ig">Igbo</option>
<option value="id">Indonesian</option>
<option value="ga">Irish</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="jw">Javanese</option>
<option value="kn">Kannada</option>
<option value="kk">Kazakh</option>
<option value="km">Khmer</option>
<option value="rw">Kinyarwanda</option>
<option value="ko">Korean</option>
<option value="ku">Kurdish (Kurmanji)</option>
<option value="ky">Kyrgyz</option>
<option value="lo">Lao</option>
<option value="la">Latin</option>
<option value="lv">Latvian</option>
<option value="lt">Lithuanian</option>
<option value="lb">Luxembourgish</option>
<option value="mk">Macedonian</option>
<option value="mg">Malagasy</option>
<option value="ms">Malay</option>
<option value="ml">Malayalam</option>
<option value="mt">Maltese</option>
<option value="mi">Maori</option>
<option value="mr">Marathi</option>
<option value="mn">Mongolian</option>
<option value="my">Myanmar (Burmese)</option>
<option value="ne">Nepali</option>
<option value="no">Norwegian</option>
<option value="or">Odia (Oriya)</option>
<option value="ps">Pashto</option>
<option value="fa">Persian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="pa">Punjabi</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="sm">Samoan</option>
<option value="gd">Scots Gaelic</option>
<option value="sr">Serbian</option>
<option value="st">Sesotho</option>
<option value="sn">Shona</option>
<option value="sd">Sindhi</option>
<option value="si">Sinhala</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="so">Somali</option>
<option value="es">Spanish</option>
<option value="su">Sundanese</option>
<option value="sw">Swahili</option>
<option value="sv">Swedish</option>
<option value="tg">Tajik</option>
<option value="ta">Tamil</option>
<option value="tt">Tatar</option>
<option value="te">Telugu</option>
<option value="th">Thai</option>
<option value="tr">Turkish</option>
<option value="tk">Turkmen</option>
<option value="uk">Ukrainian</option>
<option value="ur">Urdu</option>
<option value="ug">Uyghur</option>
<option value="uz">Uzbek</option>
<option value="vi">Vietnamese</option>
<option value="cy">Welsh</option>
<option value="xh">Xhosa</option>
<option value="yi">Yiddish</option>
<option value="yo">Yoruba</option>
<option value="zu">Zulu</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_to__">To</h4>
<select class="to">
<option value="af">Afrikaans</option>
<option value="sq">Albanian</option>
<option value="am">Amharic</option>
<option value="ar">Arabic</option>
<option value="hy">Armenian</option>
<option value="az">Azerbaijani</option>
<option value="eu">Basque</option>
<option value="be">Belarusian</option>
<option value="bn">Bengali</option>
<option value="bs">Bosnian</option>
<option value="bg">Bulgarian</option>
<option value="ca">Catalan</option>
<option value="ceb">Cebuano</option>
<option value="ny">Chichewa</option>
<option value="zh-CN">Chinese</option>
<option value="co">Corsican</option>
<option value="hr">Croatian</option>
<option value="cs">Czech</option>
<option value="da">Danish</option>
<option value="nl">Dutch</option>
<option value="en">English</option>
<option value="eo">Esperanto</option>
<option value="et">Estonian</option>
<option value="tl">Filipino</option>
<option value="fi">Finnish</option>
<option value="fr">French</option>
<option value="fy">Frisian</option>
<option value="gl">Galician</option>
<option value="ka">Georgian</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="gu">Gujarati</option>
<option value="ht">Haitian Creole</option>
<option value="ha">Hausa</option>
<option value="haw">Hawaiian</option>
<option value="iw">Hebrew</option>
<option value="hi">Hindi</option>
<option value="hmn">Hmong</option>
<option value="hu">Hungarian</option>
<option value="is">Icelandic</option>
<option value="ig">Igbo</option>
<option value="id">Indonesian</option>
<option value="ga">Irish</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="jw">Javanese</option>
<option value="kn">Kannada</option>
<option value="kk">Kazakh</option>
<option value="km">Khmer</option>
<option value="rw">Kinyarwanda</option>
<option value="ko">Korean</option>
<option value="ku">Kurdish (Kurmanji)</option>
<option value="ky">Kyrgyz</option>
<option value="lo">Lao</option>
<option value="la">Latin</option>
<option value="lv">Latvian</option>
<option value="lt">Lithuanian</option>
<option value="lb">Luxembourgish</option>
<option value="mk">Macedonian</option>
<option value="mg">Malagasy</option>
<option value="ms">Malay</option>
<option value="ml">Malayalam</option>
<option value="mt">Maltese</option>
<option value="mi">Maori</option>
<option value="mr">Marathi</option>
<option value="mn">Mongolian</option>
<option value="my">Myanmar (Burmese)</option>
<option value="ne">Nepali</option>
<option value="no">Norwegian</option>
<option value="or">Odia (Oriya)</option>
<option value="ps">Pashto</option>
<option value="fa">Persian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="pa">Punjabi</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="sm">Samoan</option>
<option value="gd">Scots Gaelic</option>
<option value="sr">Serbian</option>
<option value="st">Sesotho</option>
<option value="sn">Shona</option>
<option value="sd">Sindhi</option>
<option value="si">Sinhala</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="so">Somali</option>
<option value="es">Spanish</option>
<option value="su">Sundanese</option>
<option value="sw">Swahili</option>
<option value="sv">Swedish</option>
<option value="tg">Tajik</option>
<option value="ta">Tamil</option>
<option value="tt">Tatar</option>
<option value="te">Telugu</option>
<option value="th">Thai</option>
<option value="tr">Turkish</option>
<option value="tk">Turkmen</option>
<option value="uk">Ukrainian</option>
<option value="ur">Urdu</option>
<option value="ug">Uyghur</option>
<option value="uz">Uzbek</option>
<option value="vi">Vietnamese</option>
<option value="cy">Welsh</option>
<option value="xh">Xhosa</option>
<option value="yi">Yiddish</option>
<option value="yo">Yoruba</option>
<option value="zu">Zulu</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_engine__">Engine</h4>
<select class="engine">
<option value="google">Google</option>
<option value="libre">Libre</option>
<option value="deepl">Deepl</option>
<option value="iciba">ICIBA</option>
<option value="reverso">Reverso</option>
</select>
</div>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://simplytranslate.org" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-simplyTranslate-label" for="latency-simplyTranslate">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-simplyTranslate" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="http://hxecvvetgrznmprg.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
<div id="lingva">
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://lingvatranslate.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-lingva-label" for="latency-lingva">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency-lingva" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="http://tyzxppdeoojdnaux.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./translate.js"></script>
</body>

View File

@ -90,16 +90,19 @@ translateHelper.init().then(() => {
toElement.value = translateHelper.getTo();
simplyTranslateEngineElement.value = translateHelper.getSimplyTranslateEngine();
commonHelper.processDefaultCustomInstances(
'simplyTranslate',
'normal',
translateHelper,
document,
translateHelper.getSimplyTranslateNormalRedirectsChecks,
translateHelper.setSimplyTranslateNormalRedirectsChecks,
translateHelper.getSimplyTranslateNormalCustomRedirects,
translateHelper.setSimplyTranslateNormalCustomRedirects
);
browser.storage.local.get("simplyTranslateLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'simplyTranslate',
'normal',
translateHelper,
document,
translateHelper.getSimplyTranslateNormalRedirectsChecks,
translateHelper.setSimplyTranslateNormalRedirectsChecks,
translateHelper.getSimplyTranslateNormalCustomRedirects,
translateHelper.setSimplyTranslateNormalCustomRedirects,
r.simplyTranslateLatency,
)
})
commonHelper.processDefaultCustomInstances(
'simplyTranslate',
@ -112,16 +115,20 @@ translateHelper.init().then(() => {
translateHelper.setSimplyTranslateTorCustomRedirects
);
commonHelper.processDefaultCustomInstances(
'lingva',
'normal',
translateHelper,
document,
translateHelper.getLingvaNormalRedirectsChecks,
translateHelper.setLingvaNormalRedirectsChecks,
translateHelper.getLingvaNormalCustomRedirects,
translateHelper.setLingvaNormalCustomRedirects
);
browser.storage.local.get("lingvaLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'lingva',
'normal',
translateHelper,
document,
translateHelper.getLingvaNormalRedirectsChecks,
translateHelper.setLingvaNormalRedirectsChecks,
translateHelper.getLingvaNormalCustomRedirects,
translateHelper.setLingvaNormalCustomRedirects,
r.lingvaLatency,
);
});
commonHelper.processDefaultCustomInstances(
'lingva',
@ -131,6 +138,65 @@ translateHelper.init().then(() => {
translateHelper.getLingvaTorRedirectsChecks,
translateHelper.setLingvaTorRedirectsChecks,
translateHelper.getLingvaTorCustomRedirects,
translateHelper.setLingvaTorCustomRedirects
translateHelper.setLingvaTorCustomRedirects,
)
});
});
let latencySimplyTranslateElement = document.getElementById("latency-simplyTranslate");
let latencySimplyTranslateLabel = document.getElementById("latency-simplyTranslate-label");
latencySimplyTranslateElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencySimplyTranslateElement.addEventListener("click", reloadWindow);
await translateHelper.init();
let redirects = translateHelper.getRedirects();
const oldHtml = latencySimplyTranslateLabel.innerHTML;
latencySimplyTranslateLabel.innerHTML = '...';
commonHelper.testLatency(latencySimplyTranslateLabel, redirects.simplyTranslate.normal).then(r => {
browser.storage.local.set({ simplyTranslateLatency: r });
latencySimplyTranslateLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'simplyTranslate',
'normal',
translateHelper,
document,
translateHelper.getSimplyTranslateNormalRedirectsChecks,
translateHelper.setSimplyTranslateNormalRedirectsChecks,
translateHelper.getSimplyTranslateNormalCustomRedirects,
translateHelper.setSimplyTranslateNormalCustomRedirects,
r,
);
latencySimplyTranslateElement.removeEventListener("click", reloadWindow);
});
}
);
let latencyLingvaElement = document.getElementById("latency-lingva");
let latencyLingvaLabel = document.getElementById("latency-lingva-label");
latencyLingvaElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyLingvaElement.addEventListener("click", reloadWindow);
await translateHelper.init();
let redirects = translateHelper.getRedirects();
const oldHtml = latencyLingvaLabel.innerHTML;
latencyLingvaLabel.innerHTML = '...';
commonHelper.testLatency(latencyLingvaLabel, redirects.lingva.normal).then(r => {
browser.storage.local.set({ lingvaLatency: r });
latencyLingvaLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'lingva',
'normal',
translateHelper,
document,
translateHelper.getLingvaNormalRedirectsChecks,
translateHelper.setLingvaNormalRedirectsChecks,
translateHelper.getLingvaNormalCustomRedirects,
translateHelper.setLingvaNormalCustomRedirects,
r,
);
latencyLingvaElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -0,0 +1,227 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>General</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a class="selected" href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-nitter" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
<option value="i2p" data-localise="__MSG_i2p__">I2P</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_bypassTwitter__">Bypass "Open in Twitter"</h4>
<input id="bypass-watch-on-twitter" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_enableCustomNitter__">Enable Custom Settings (will use cookies)</h4>
<input id="enable-twitter-custom-settings" type="checkbox">
</div>
<div id="nitter">
<div class="custom-settings">
<div class="some-block option-block">
<h2>Display </h2>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_theme__">Theme</h4>
<select class="theme">
<option value="Auto">Auto</option>
<option value="Auto (Twitter)">Auto (Twitter)</option>
<option value="Black">Black</option>
<option value="Mastodon">Mastodon</option>
<option value="Nitter">Nitter</option>
<option value="Pleroma">Pleroma</option>
<option value="Twitter">Twitter</option>
<option value="Twitter Dark">Twitter Dark</option>
</select>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_infiniteScroll__">Infinite scrolling (experimental, requires JavaScript)</h4>
<input class="infiniteScroll" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_stickyProfile__">Make profile sidebar stick to top</h4>
<input class="stickyProfile" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_bidiSupport__">Support bidirectional text (makes clicking on tweets harder)</h4>
<input class="bidiSupport" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_hideTweetStats__">Hide tweet stats (replies, retweets, likes)</h4>
<input class="hideTweetStats" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_hideBanner__">Hide profile banner</h4>
<input class="hideBanner" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_hidePins__">Hide pinned tweets</h4>
<input class="hidePins" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_hideReplies__">Hide tweet replies</h4>
<input class="hideReplies" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_squareAvatars__">Square profile pictures</h4>
<input class="squareAvatars" type="checkbox">
</div>
<hr>
<div class="some-block option-block">
<h2>Media</h2>
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_mp4Playback__">Enable mp4 video playback (only for gifs)</h4>
<input class="mp4Playback" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_hlsPlayback__">Enable hls video streaming (requires JavaScript)</h4>
<input class="hlsPlayback" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_proxyVideos__">Proxy video streaming through the server (might be slow)</h4>
<input class="proxyVideos" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_muteVideos__">Mute videos by default</h4>
<input class="muteVideos" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_autoplayGifs__">Autoplay gifs</h4>
<input class="autoplayGifs" type="checkbox">
</div>
</div>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://nitter.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://nitter.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://nitter.i2p" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./twitter.js"></script>
</body>

View File

@ -93,16 +93,20 @@ function init() {
muteVideos.checked = twitterHelper.getMuteVideos();
autoplayGifs.checked = twitterHelper.getAutoplayGifs();
commonHelper.processDefaultCustomInstances(
'nitter',
'normal',
twitterHelper,
document,
twitterHelper.getNitterNormalRedirectsChecks,
twitterHelper.setNitterNormalRedirectsChecks,
twitterHelper.getNitterNormalCustomRedirects,
twitterHelper.setNitterNormalCustomRedirects
)
browser.storage.local.get("nitterLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'nitter',
'normal',
twitterHelper,
document,
twitterHelper.getNitterNormalRedirectsChecks,
twitterHelper.setNitterNormalRedirectsChecks,
twitterHelper.getNitterNormalCustomRedirects,
twitterHelper.setNitterNormalCustomRedirects,
r.nitterLatency,
);
});
commonHelper.processDefaultCustomInstances(
'nitter',
'tor',
@ -116,3 +120,32 @@ function init() {
});
}
init();
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await twitterHelper.init();
let redirects = twitterHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.nitter.normal).then(r => {
browser.storage.local.set({ nitterLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'nitter',
'normal',
twitterHelper,
document,
twitterHelper.getNitterNormalRedirectsChecks,
twitterHelper.setNitterNormalRedirectsChecks,
twitterHelper.getNitterNormalCustomRedirects,
twitterHelper.setNitterNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>Wikipedia</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a class="selected" href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-wikipedia" type="checkbox">
</div>
<div class="some-block option-block">
<h4 data-localise="__MSG_protocol__">Protocol</h4>
<select id="protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
<option value="i2p" data-localise="__MSG_i2p__">I2P</option>
</select>
</div>
<div id="wikiless">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://wikiless.com" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
<div class="tor">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://wikiless.onion" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
<div class="i2p">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://wikiless.i2p" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./wikipedia.js"></script>
</body>

View File

@ -22,17 +22,17 @@ function changeProtocolSettings(protocol) {
if (protocol == 'normal') {
normalDiv.style.display = 'block';
torDiv.style.display = 'none';
i2pDiv.style.display = 'none';
i2pDiv.style.display = 'none';
}
else if (protocol == 'tor') {
normalDiv.style.display = 'none';
torDiv.style.display = 'block';
i2pDiv.style.display = 'none';
i2pDiv.style.display = 'none';
}
else if (protocol == 'i2p') {
normalDiv.style.display = 'none';
torDiv.style.display = 'none';
i2pDiv.style.display = 'block';
normalDiv.style.display = 'none';
torDiv.style.display = 'none';
i2pDiv.style.display = 'block';
}
}
@ -44,16 +44,19 @@ wikipediaHelper.init().then(() => {
protocolElement.value = protocol;
changeProtocolSettings(protocol);
commonHelper.processDefaultCustomInstances(
'wikiless',
'normal',
wikipediaHelper,
document,
wikipediaHelper.getWikilessNormalRedirectsChecks,
wikipediaHelper.setWikilessNormalRedirectsChecks,
wikipediaHelper.getWikilessNormalCustomRedirects,
wikipediaHelper.setWikilessNormalCustomRedirects
)
browser.storage.local.get("wikilessLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'wikiless',
'normal',
wikipediaHelper,
document,
wikipediaHelper.getWikilessNormalRedirectsChecks,
wikipediaHelper.setWikilessNormalRedirectsChecks,
wikipediaHelper.getWikilessNormalCustomRedirects,
wikipediaHelper.setWikilessNormalCustomRedirects,
r.wikilessLatency,
);
})
commonHelper.processDefaultCustomInstances(
'wikiless',
@ -67,13 +70,42 @@ wikipediaHelper.init().then(() => {
)
commonHelper.processDefaultCustomInstances(
'wikiless',
'i2p',
wikipediaHelper,
document,
wikipediaHelper.getWikilessI2pRedirectsChecks,
wikipediaHelper.setWikilessI2pRedirectsChecks,
wikipediaHelper.getWikilessI2pCustomRedirects,
wikipediaHelper.setWikilessI2pCustomRedirects
'wikiless',
'i2p',
wikipediaHelper,
document,
wikipediaHelper.getWikilessI2pRedirectsChecks,
wikipediaHelper.setWikilessI2pRedirectsChecks,
wikipediaHelper.getWikilessI2pCustomRedirects,
wikipediaHelper.setWikilessI2pCustomRedirects
)
})
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await wikipediaHelper.init();
let redirects = wikipediaHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.wikiless.normal).then(r => {
browser.storage.local.set({ wikilessLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'wikiless',
'normal',
wikipediaHelper,
document,
wikipediaHelper.getWikilessNormalRedirectsChecks,
wikipediaHelper.setWikilessNormalRedirectsChecks,
wikipediaHelper.getWikilessNormalCustomRedirects,
wikipediaHelper.setWikilessNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);

View File

@ -118,6 +118,7 @@ function init() {
feed_menu0.value = youtubeHelper.getInvidiousFeedMenuList()[0];
feed_menu1.value = youtubeHelper.getInvidiousFeedMenuList()[1];
browser.storage.local.get("invidiousLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'invidious',
'normal',
@ -126,8 +127,10 @@ function init() {
youtubeHelper.getInvidiousNormalRedirectsChecks,
youtubeHelper.setInvidiousNormalRedirectsChecks,
youtubeHelper.getInvidiousNormalCustomRedirects,
youtubeHelper.setInvidiousNormalCustomRedirects
);
youtubeHelper.setInvidiousNormalCustomRedirects,
r.invidiousLatency
);
})
commonHelper.processDefaultCustomInstances(
'invidious',
@ -142,4 +145,33 @@ function init() {
});
}
init()
init()
let latencyInvidiousElement = document.getElementById("latency-invidious");
let latencyInvidiousLabel = document.getElementById("latency-invidious-label");
latencyInvidiousElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyInvidiousElement.addEventListener("click", reloadWindow);
await youtubeHelper.init();
let redirects = youtubeHelper.getRedirects();
const oldHtml = latencyInvidiousLabel.innerHTML;
latencyInvidiousLabel.innerHTML = '...';
commonHelper.testLatency(latencyInvidiousLabel, redirects.invidious.normal).then(r => {
browser.storage.local.set({ invidiousLatency: r });
latencyInvidiousLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'invidious',
'normal',
youtubeHelper,
document,
youtubeHelper.getInvidiousNormalRedirectsChecks,
youtubeHelper.setInvidiousNormalRedirectsChecks,
youtubeHelper.getInvidiousNormalCustomRedirects,
youtubeHelper.setInvidiousNormalCustomRedirects,
r,
);
latencyInvidiousElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -110,16 +110,20 @@ function init() {
volume.value = youtubeHelper.getVolume();
volumeValue.textContent = `${youtubeHelper.getVolume()}%`;
commonHelper.processDefaultCustomInstances(
'piped',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedNormalRedirectsChecks,
youtubeHelper.setPipedNormalRedirectsChecks,
youtubeHelper.getPipedNormalCustomRedirects,
youtubeHelper.setPipedNormalCustomRedirects
);
browser.storage.local.get("pipedLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'piped',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedNormalRedirectsChecks,
youtubeHelper.setPipedNormalRedirectsChecks,
youtubeHelper.getPipedNormalCustomRedirects,
youtubeHelper.setPipedNormalCustomRedirects,
r.pipedLatency,
);
});
commonHelper.processDefaultCustomInstances(
'piped',
'tor',
@ -132,4 +136,33 @@ function init() {
);
});
}
init();
init();
let latencyPipedElement = document.getElementById("latency-piped");
let latencyPipedLabel = document.getElementById("latency-piped-label");
latencyPipedElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyPipedElement.addEventListener("click", reloadWindow);
await youtubeHelper.init();
let redirects = youtubeHelper.getRedirects();
const oldHtml = latencyPipedLabel.innerHTML;
latencyPipedLabel.innerHTML = '...';
commonHelper.testLatency(latencyPipedLabel, redirects.piped.normal).then(r => {
browser.storage.local.set({ pipedLatency: r });
latencyPipedLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'piped',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedNormalRedirectsChecks,
youtubeHelper.setPipedNormalRedirectsChecks,
youtubeHelper.getPipedNormalCustomRedirects,
youtubeHelper.setPipedNormalCustomRedirects,
r,
);
latencyPipedElement.removeEventListener("click", reloadWindow);
});
}
);

View File

@ -86,17 +86,20 @@ function init() {
volumeElement.value = youtubeHelper.getVolume();
volumeValueElement.textContent = `${youtubeHelper.getVolume()}%`;
browser.storage.local.get("pipedMaterialLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'pipedMaterial',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedMaterialNormalRedirectsChecks,
youtubeHelper.setPipedMaterialNormalRedirectsChecks,
youtubeHelper.getPipedMaterialNormalCustomRedirects,
youtubeHelper.setPipedMaterialNormalCustomRedirects,
r.pipedMaterialLatency,
);
});
commonHelper.processDefaultCustomInstances(
'pipedMaterial',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedMaterialNormalRedirectsChecks,
youtubeHelper.setPipedMaterialNormalRedirectsChecks,
youtubeHelper.getPipedMaterialNormalCustomRedirects,
youtubeHelper.setPipedMaterialNormalCustomRedirects
);
commonHelper.processDefaultCustomInstances(
'pipedMaterial',
'tor',
@ -109,4 +112,33 @@ function init() {
);
});
}
init();
init();
let latencyPipedMaterialElement = document.getElementById("latency-pipedMaterial");
let latencyPipedMaterialLabel = document.getElementById("latency-pipedMaterial-label");
latencyPipedMaterialElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyPipedMaterialElement.addEventListener("click", reloadWindow);
await youtubeHelper.init();
let redirects = youtubeHelper.getRedirects();
const oldHtml = latencyPipedMaterialLabel.innerHTML;
latencyPipedMaterialLabel.innerHTML = '...';
commonHelper.testLatency(latencyPipedMaterialLabel, redirects.pipedMaterial.normal).then(r => {
browser.storage.local.set({ pipedMaterialLatency: r });
latencyPipedMaterialLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'pipedMaterial',
'normal',
youtubeHelper,
document,
youtubeHelper.getPipedMaterialNormalRedirectsChecks,
youtubeHelper.setPipedMaterialNormalRedirectsChecks,
youtubeHelper.getPipedMaterialNormalCustomRedirects,
youtubeHelper.setPipedMaterialNormalCustomRedirects,
r,
);
latencyPipedMaterialElement.removeEventListener("click", reloadWindow);
});
}
);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
<link href="../../stylesheets/styles.css" rel="stylesheet">
<title>Document</title>
</head>
</html>
<script type="module" src="../../../assets/javascripts/localise.js"></script>
<body class="option" dir="auto">
<section class="links">
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="26px" viewBox="0 0 24 24" width="26px" fill="currentColor">
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
</svg><a href="../general/general.html" data-localise="__MSG_general__">General</a>
</div>
<div class="title"> <img src="../../../assets/images/youtube-icon.png"><a href="../youtube/youtube.html" data-localise="__MSG_youtube__">YouTube </a></div>
<div class="title"> <img src="../../../assets/images/youtube-music-icon.png"><a class="selected" href="../youtubeMusic/youtubeMusic.html" data-localise="__MSG_ytmusic__">YT Music</a></div>
<div class="title"> <img src="../../../assets/images/twitter-icon.png"><a href="../twitter/twitter.html" data-localise="__MSG_twitter__">Twitter</a></div>
<div class="title"> <img src="../../../assets/images/instagram-icon.png"><a href="../instagram/instagram.html" data-localise="__MSG_instagram__">Instagram</a></div>
<div class="title"> <img src="../../../assets/images/tiktok-icon.png"><a href="../tiktok/tiktok.html" data-localise="__MSG_tiktok__">TikTok</a></div>
<div class="title"> <img src="../../../assets/images/reddit-icon.png"><a href="../reddit/reddit.html" data-localise="__MSG_reddit__">Reddit</a></div>
<div class="title"> <img src="../../../assets/images/imgur-icon.png"><a href="../imgur/imgur.html" data-localise="__MSG_imgur__">Imgur</a></div>
<div class="title"> <img src="../../../assets/images/pixiv-icon.svg"><a href="../pixiv/pixiv.html" data-localise="__MSG_pixiv__">Pixiv</a></div>
<div class="title"> <img src="../../../assets/images/librespeed-icon.svg"><a href="../speedtest/speedtest.html" data-localise="__MSG_speedtest__">Speedtest</a></div>
<div class="title"> <img src="../../../assets/images/spotify-icon.png"><a href="../spotify/spotify.html" data-localise="__MSG_spotify__">Spotify</a></div>
<div class="title"> <img src="../../../assets/images/wikipedia-icon.svg"><a href="../wikipedia/wikipedia.html" data-localise="__MSG_wikipedia__">Wikipedia</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor">
<circle cx="500" cy="500" r="500"></circle>
<ellipse ry="475" rx="250" cy="501" cx="1296"></ellipse>
<ellipse cx="1682" cy="502" rx="88" ry="424"></ellipse>
</svg><a href="../medium/medium.html" data-localise="__MSG_medium__">Medium</a>
</div>
<div class="title"> <img src="../../../assets/images/peertube-icon.svg"><a href="../peertube/peertube.html" data-localise="__MSG_peertube__">Peertube</a></div>
<div class="title"> <img src="../../../assets/images/lbry-icon.png"><a href="../lbry/lbry.html" data-localise="__MSG_lbry__">LBRY/Odysee</a></div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg><a href="../search/search.html" data-localise="__MSG_search__">Search</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path>
</svg><a href="../translate/translate.html" data-localise="__MSG_translate__">Translate</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path>
</svg><a href="../maps/maps.html" data-localise="__MSG_maps__">Maps</a>
</div>
<div class="title">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path>
</svg><a href="../sendTargets/sendTargets.html" data-localise="__MSG_sendFiles__">Send Files</a>
</div>
</section>
<section class="option-block">
<div class="some-block option-block">
<h4 data-localise="__MSG_enable__">Enable</h4>
<input id="disable-beatbump" type="checkbox">
</div>
<div id="beatbump">
<hr>
<div class="normal">
<div class="some-block option-block">
<h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
</div>
<div class="checklist"></div>
<hr>
<div class="some-block option-block">
<h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
</div>
<form class="custom-instance-form">
<div class="some-block option-block">
<input class="custom-instance" placeholder="https://beatbump.wewe" type="url">
<button class="add add-instance" type="submit"></button>
<svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
</svg>
</div>
</form>
<div class="checklist custom-checklist"></div>
<label class="button button-inline" id="latency-label" for="latency">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"></path>
</svg>&nbsp;
<x data-localise="__MSG_testInstancesLatency__">Test Instances Latency</x>
</label>
<input class="button button-inline" id="latency" style="display:none;">
</div>
</div>
</section>
<script type="module" src="../init.js"></script>
<script type="module" src="./youtubeMusic.js"></script>
</body>

View File

@ -9,14 +9,46 @@ disableYoutubeMusicElement.addEventListener("change",
youtubeMusicHelper.init().then(() => {
disableYoutubeMusicElement.checked = !youtubeMusicHelper.getDisable();
commonHelper.processDefaultCustomInstances(
'beatbump',
'normal',
youtubeMusicHelper,
document,
youtubeMusicHelper.getBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.setBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.getBeatbumpNormalCustomRedirects,
youtubeMusicHelper.setBeatbumpNormalCustomRedirects
)
browser.storage.local.get("beatbumpLatency").then(r => {
commonHelper.processDefaultCustomInstances(
'beatbump',
'normal',
youtubeMusicHelper,
document,
youtubeMusicHelper.getBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.setBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.getBeatbumpNormalCustomRedirects,
youtubeMusicHelper.setBeatbumpNormalCustomRedirects,
r.beatbumpLatency,
);
})
});
let latencyElement = document.getElementById("latency");
let latencyLabel = document.getElementById("latency-label");
latencyElement.addEventListener("click",
async () => {
let reloadWindow = () => location.reload();
latencyElement.addEventListener("click", reloadWindow);
await youtubeMusicHelper.init();
let redirects = youtubeMusicHelper.getRedirects();
const oldHtml = latencyLabel.innerHTML;
latencyLabel.innerHTML = '...';
commonHelper.testLatency(latencyLabel, redirects.beatbump.normal).then(r => {
browser.storage.local.set({ beatbumpLatency: r });
latencyLabel.innerHTML = oldHtml;
commonHelper.processDefaultCustomInstances(
'beatbump',
'normal',
youtubeMusicHelper,
document,
youtubeMusicHelper.getBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.setBeatbumpNormalRedirectsChecks,
youtubeMusicHelper.getBeatbumpNormalCustomRedirects,
youtubeMusicHelper.setBeatbumpNormalCustomRedirects,
r,
)
latencyElement.removeEventListener("click", reloadWindow)
});
}
);