From ddcbb9725de7fece31664617a1c99784d64af4c4 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Thu, 14 Jul 2022 11:40:19 +0100 Subject: non-breaking optimizations to search and librex support --- src/pages/options/index.html | 106 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 90 insertions(+), 16 deletions(-) (limited to 'src/pages/options/index.html') diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 241a20e7..80c2a039 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -1502,20 +1502,19 @@ + -
-
-

Protocol

- -
+
+

Protocol

+
-

Note: To use Search to its full potential, make LibRedirect as the Default Search Engine

+

Note: To use Search, make LibRedirect the Default Search Engine


@@ -1560,7 +1559,7 @@
- +
- +
- +
- +
- + + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
- +
+
+

+ +
+
+
+

Fallback to normal if no frontends are available for the current protocol

+ +
+

@@ -274,33 +289,23 @@
-
+

Embedded Videos Frontend

-
-
-

Protocol

- -
-
-

Redirect Type

- -
+
+

Redirect Type

+

@@ -315,7 +320,7 @@
- +
- +
-
-
-
-
+

Default Instances

@@ -369,7 +371,7 @@
- +
-
- - -
-
+

Default Instances

@@ -399,7 +392,7 @@
- +
-
+

@@ -423,7 +416,7 @@
- +
@@ -453,42 +446,7 @@
- - -
-
-
-
-
- - -
-
-

YouTube Music

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- +
-
- - -
-
- -
-
-
-

Twitter

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-

Redirect Type

- -
-
-
-
+

Default Instances

@@ -547,7 +467,7 @@
- +
-
- - -
-
+

Default Instances

@@ -577,7 +488,7 @@
- +
- -
-
-
-

Instagram

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
+

@@ -619,7 +512,7 @@
- +
@@ -649,7 +542,7 @@
- +
-
- -
-
-
-

TikTok

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-
-
+

Default Instances

@@ -691,7 +563,7 @@
- +
-
- - -
-
+

Default Instances

@@ -721,7 +584,7 @@
- +
- +
-
+
-

Reddit

+

YouTube Music


Enable

- -
-
-

Frontend

- -
-
-

Protocol

- +
-
+

@@ -770,7 +619,7 @@
- +
@@ -800,7 +649,7 @@
- +
-
-
-
-
+

Default Instances

@@ -824,7 +670,7 @@
- +
-
- - -
-
+

Default Instances

@@ -854,7 +691,7 @@
- +
- +
-
+
-

Imgur

+

Twitter


Enable

- +
-

Protocol

- + + +
-
+

@@ -897,7 +734,7 @@
- +
@@ -927,7 +764,7 @@
- +
- +
-
- -
-
-
-

Wikipedia

-
-
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ + +
+
+

Instagram

+
+
+
+

Enable

+ +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ +
+
+
+

TikTok

+
+
+
+

Enable

+ +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ +
+
+
+

Reddit

+
+
+
+

Enable

+ +
+
+

Frontend

+ +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ +
+
+
+

Imgur

+
+

Enable

- + +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ +
+
+
+

Wikipedia

+
-

Protocol

- +

Enable

+

@@ -991,7 +1372,114 @@
- + + +
+
+
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+ + +
+
+

Medium

+
+
+
+

Enable

+ +
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
@@ -1021,7 +1509,7 @@
- +
- + + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
- +
-
+
-

Medium

+

Quora


Enable

- -
-
-

Protocol

- +
-
+

@@ -1084,7 +1586,7 @@
- +
@@ -1114,7 +1616,7 @@
- +
-
- -
-
-
-

Quora

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-
-
+

Default Instances

@@ -1156,7 +1637,7 @@
- +
-
- - -
-
+

Default Instances

@@ -1186,7 +1658,7 @@
- +
-
-

Protocol

- -

@@ -1258,7 +1723,49 @@
- + + +
+ +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
-
-

Protocol

- -

@@ -1330,7 +1830,49 @@
- + + +
+ +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
-
-

Protocol

- -

@@ -1402,7 +1937,49 @@
- + + +
+ +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
-
-

Protocol

- -

@@ -1444,7 +2014,58 @@
- + + +
+ +
+
+ + +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
-
- - -
-
+

Default Instances

@@ -1474,7 +2086,7 @@
- +
-
-

Protocol

- -

Note: To use Search, make LibRedirect the Default Search Engine

@@ -1590,6 +2194,27 @@
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+

@@ -1665,6 +2290,27 @@
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+

@@ -1740,6 +2386,27 @@
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+

@@ -1815,6 +2482,27 @@
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
@@ -1834,15 +2522,6 @@
-
-

Protocol

- -

@@ -1981,7 +2660,49 @@
- + + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+ +
+ + +
+ +
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
@@ -2054,13 +2838,6 @@

Enable

-
-

Protocol

- -

@@ -2104,7 +2881,49 @@
- + + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+
+
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+
-

Fallback to normal if no frontends are available for the current protocol

- +

Fallback to normal if no instances are available for the current protocol

+
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 106bd532..0f7a3140 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -169,8 +169,8 @@ protocolElement.addEventListener("change", event => { location.reload(); }) -let protocolFallbackElement = document.getElementById("protocol-fallback") -protocolFallbackElement.addEventListener("change", event => { +let protocolFallbackCheckbox = document.getElementById("protocol-fallback-checkbox") +protocolFallbackCheckbox.addEventListener("change", event => { browser.storage.local.set({ protocolFallback: event.target.checked}); }) @@ -208,9 +208,10 @@ browser.storage.local.get( autoRedirectElement.checked = r.autoRedirect; themeElement.value = r.theme; protocolElement.value = r.protocol; - protocolFallbackElement.checked = r.protocolFallback; + protocolFallbackCheckbox.checked = r.protocolFallback; // firstPartyIsolate.checked = r.firstPartyIsolate; - + + let protocolFallbackElement = document.getElementById('protocol-fallback') if (protocolElement.value == "normal") { protocolFallbackElement.style.display = 'none'; } else { diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug index 11fbd0f9..e04e9e2a 100644 --- a/src/pages/options/widgets/general.pug +++ b/src/pages/options/widgets/general.pug @@ -25,7 +25,7 @@ section#general_page.option-block #protocol-fallback .some-block.option-block h4(data-localise="__MSG_protocolFallback__") Fallback to normal if no instances are available for the current protocol - input#protocol-fallback(type="checkbox") + input#protocol-fallback-checkbox(type="checkbox") .some-block.option-block h4(data-localise="__MSG_autoRedirect__") -- cgit 1.4.1 From 2e448143158a987d9ea21e231748f2bc6849d8b6 Mon Sep 17 00:00:00 2001 From: BobIsMyManager Date: Sat, 23 Jul 2022 18:08:18 +0100 Subject: Fixed one of the errors (1 remaining) --- src/assets/javascripts/utils.js | 6 ++++-- src/assets/javascripts/youtube/youtube.js | 10 +++++----- src/pages/options/index.html | 4 ++-- src/pages/options/widgets/maps.pug | 2 +- src/pages/options/widgets/youtube.pug | 4 ++++ 5 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/pages/options/index.html') diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 7428a79f..b04024e8 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -114,13 +114,15 @@ async function processDefaultCustomInstances(target, name, protocol, document) { function calcNameCheckBoxes() { let isTrue = true; - for (const item of redirects[name][protocol]) + for (const item of redirects[name][protocol]) { if (!nameDefaultRedirects.includes(item)) { isTrue = false; break; } - for (const element of nameCheckListElement.getElementsByTagName('input')) + } + for (const element of nameCheckListElement.getElementsByTagName('input')) { element.checked = nameDefaultRedirects.includes(element.className) + } if (nameDefaultRedirects.length == 0) isTrue = false; nameProtocolElement.getElementsByClassName('toggle-all')[0].checked = isTrue; } diff --git a/src/assets/javascripts/youtube/youtube.js b/src/assets/javascripts/youtube/youtube.js index 439f5605..ffc08ed5 100644 --- a/src/assets/javascripts/youtube/youtube.js +++ b/src/assets/javascripts/youtube/youtube.js @@ -160,7 +160,7 @@ function all() { ...youtubeRedirects.piped.tor, ...youtubeRedirects.pipedMaterial.normal, - ...youtubeRedirects.pipedMaterial.tor, + //...youtubeRedirects.pipedMaterial.tor, ...invidiousNormalCustomRedirects, ...invidiousTorCustomRedirects, @@ -380,9 +380,9 @@ function copyPasteInvidiousCookies(test, from) { if (protocol == 'loki') checkedInstances = [...invidiousLokiCustomRedirects]; else if (protocol == 'i2p') checkedInstances = [...invidiousI2pCustomRedirects]; - else if (protocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') { - checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects] + else if (protocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects]; + if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') { + checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects]; } const i = checkedInstances.indexOf(protocolHost); if (i !== -1) checkedInstances.splice(i, 1); @@ -400,7 +400,7 @@ function pasteInvidiousCookies() { if (protocol == 'loki') checkedInstances = [...invidiousLokiCustomRedirects]; else if (protocol == 'i2p') checkedInstances = [...invidiousI2pCustomRedirects]; else if (protocol == 'tor') checkedInstances = [...invidiousTorRedirectsChecks, ...invidiousTorCustomRedirects] - if ((instancesList.length === 0 && protocolFallback) || protocol == 'normal') { + if ((checkedInstances.length === 0 && protocolFallback) || protocol == 'normal') { checkedInstances = [...invidiousNormalRedirectsChecks, ...invidiousNormalCustomRedirects] } utils.getCookiesFromStorage('invidious', checkedInstances, 'PREFS'); diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 96b8d553..29e454bf 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -2754,13 +2754,13 @@
-
diff --git a/src/pages/options/widgets/maps.pug b/src/pages/options/widgets/maps.pug index f220e35e..166e6494 100644 --- a/src/pages/options/widgets/maps.pug +++ b/src/pages/options/widgets/maps.pug @@ -18,7 +18,7 @@ section#maps_page.option-block include ../../widgets/instances.pug +instances('https://facilmap.com') include ../../widgets/latency.pug - +latency('facilmap') + +latency('facil') .tor +instances('http://facilmap.onion') include ../../widgets/instances.pug diff --git a/src/pages/options/widgets/youtube.pug b/src/pages/options/widgets/youtube.pug index cf175629..a7832d4c 100644 --- a/src/pages/options/widgets/youtube.pug +++ b/src/pages/options/widgets/youtube.pug @@ -50,7 +50,9 @@ section#youtube_page.option-block #piped hr .normal + include ../../widgets/instances.pug +instances('https://piped.com') + include ../../widgets/latency.pug +latency('piped') .tor +instances('http://piped.onion') @@ -65,7 +67,9 @@ section#youtube_page.option-block #pipedMaterial hr .normal + include ../../widgets/instances.pug +instances('https://piped-material.com') + include ../../widgets/latency.pug +latency('pipedMaterial') .tor +instances('http://piped-material.onion') -- cgit 1.4.1