From 7cc326eb659de0346f873d9fc96cd303479e3a58 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Fri, 15 Apr 2022 00:26:03 +0300 Subject: Still makin Pug structure. Finished adding LibreSpeed #170 --- .../javascripts/helpers/translate/translate.js | 6 +- src/pages/background/background.js | 4 + src/pages/options/general/general.html | 96 +-- src/pages/options/speedtest/speedtest.html | 298 +++------ src/pages/options/speedtest/speedtest.js | 40 +- src/pages/options/spotify/spotify.html | 279 +++------ src/pages/options/tiktok/tiktok.html | 275 +++------ src/pages/options/translate/translate.html | 363 ++++------- src/pages/options/twitter/twitter.html | 360 +++++------ src/pages/options/wikipedia/wikipedia.html | 319 ++++------ src/pages/options/youtube/youtube.html | 663 ++++++++------------- src/pages/options/youtubeMusic/youtubeMusic.html | 243 +++----- 12 files changed, 1059 insertions(+), 1887 deletions(-) (limited to 'src') diff --git a/src/assets/javascripts/helpers/translate/translate.js b/src/assets/javascripts/helpers/translate/translate.js index 525480eb..b143c5bf 100644 --- a/src/assets/javascripts/helpers/translate/translate.js +++ b/src/assets/javascripts/helpers/translate/translate.js @@ -339,9 +339,9 @@ async function init() { frontend = result.translateFrontend ?? "simplyTranslate"; protocol = result.translateProtocol ?? 'normal'; - from = result.translateFrom ?? "DEFAULT"; - to = result.translateTo ?? 'DEFAULT'; - simplyTranslateEngine = result.simplyTranslateEngine ?? 'DEFAULT'; + from = result.translateFrom ?? "auto"; + to = result.translateTo ?? 'en'; + simplyTranslateEngine = result.simplyTranslateEngine ?? 'google'; redirects.simplyTranslate = dataJson.simplyTranslate; redirects.lingva = dataJson.lingva; diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 74a41866..2aa361fc 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -12,6 +12,7 @@ import mediumHelper from "../../assets/javascripts/helpers/medium.js"; import imgurHelper from "../../assets/javascripts/helpers/imgur.js"; import tiktokHelper from "../../assets/javascripts/helpers/tiktok.js"; import pixivHelper from "../../assets/javascripts/helpers/pixiv.js"; +import speedtestHelper from "../../assets/javascripts/helpers/speedtest.js"; import sendTargetsHelper from "../../assets/javascripts/helpers/sendTargets.js"; import peertubeHelper from "../../assets/javascripts/helpers/peertube.js"; import lbryHelper from "../../assets/javascripts/helpers/lbry.js"; @@ -35,6 +36,7 @@ async function wholeInit() { await imgurHelper.init(); await tiktokHelper.init(); await pixivHelper.init(); + await speedtestHelper.init(); await sendTargetsHelper.init(); await peertubeHelper.init(); await lbryHelper.init(); @@ -78,6 +80,8 @@ browser.webRequest.onBeforeRequest.addListener( if (!newUrl) newUrl = pixivHelper.redirect(url, details.type, initiator); + if (!newUrl) newUrl = speedtestHelper.redirect(url, details.type, initiator); + if (!newUrl) newUrl = sendTargetsHelper.redirect(url, details.type, initiator); if (!newUrl) newUrl = peertubeHelper.redirect(url, details.type, initiator); diff --git a/src/pages/options/general/general.html b/src/pages/options/general/general.html index 415d6480..567f52ef 100644 --- a/src/pages/options/general/general.html +++ b/src/pages/options/general/general.html @@ -5,57 +5,57 @@ - Document + General - +

Theme

diff --git a/src/pages/options/speedtest/speedtest.html b/src/pages/options/speedtest/speedtest.html index 41d69989..06659dea 100644 --- a/src/pages/options/speedtest/speedtest.html +++ b/src/pages/options/speedtest/speedtest.html @@ -1,156 +1,66 @@ - - - - - - - - LibRedirect: Speedtest - - - - - + + + + + + General + + + +

Enable

- +
- -
-

- Frontend: This isn't a fully private frontend -

- -
- -
-

Protocol

- -
-
+
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
+ + +
- - - - - - - - + \ No newline at end of file diff --git a/src/pages/options/speedtest/speedtest.js b/src/pages/options/speedtest/speedtest.js index a9a11e18..bcef4de3 100644 --- a/src/pages/options/speedtest/speedtest.js +++ b/src/pages/options/speedtest/speedtest.js @@ -1,16 +1,16 @@ -import pixivHelper from "../../../assets/javascripts/helpers/pixiv.js"; +import speedtestHelper from "../../../assets/javascripts/helpers/speedtest.js"; import commonHelper from "../../../assets/javascripts/helpers/common.js"; -let disablePixivElement = document.getElementById("disable-pixiv"); -disablePixivElement.addEventListener("change", - (event) => pixivHelper.setDisable(!event.target.checked) +let disableSpeedtestElement = document.getElementById("disable-speedtest"); +disableSpeedtestElement.addEventListener("change", + (event) => speedtestHelper.setDisable(!event.target.checked) ); let protocolElement = document.getElementById("protocol") protocolElement.addEventListener("change", (event) => { let protocol = event.target.options[protocolElement.selectedIndex].value - pixivHelper.setProtocol(protocol); + speedtestHelper.setProtocol(protocol); changeProtocolSettings(protocol); } ); @@ -28,32 +28,32 @@ function changeProtocolSettings(protocol) { } } -pixivHelper.init().then(() => { - disablePixivElement.checked = !pixivHelper.getDisable(); +speedtestHelper.init().then(() => { + disableSpeedtestElement.checked = !speedtestHelper.getDisable(); - let protocol = pixivHelper.getProtocol(); + let protocol = speedtestHelper.getProtocol(); protocolElement.value = protocol; changeProtocolSettings(protocol); commonHelper.processDefaultCustomInstances( - 'pixivMoe', + 'librespeed', 'normal', - pixivHelper, + speedtestHelper, document, - pixivHelper.getPixivMoeNormalRedirectsChecks, - pixivHelper.setPixivMoeNormalRedirectsChecks, - pixivHelper.getPixivMoeNormalCustomRedirects, - pixivHelper.setPixivMoeNormalCustomRedirects + speedtestHelper.getLibrespeedNormalRedirectsChecks, + speedtestHelper.setLibrespeedNormalRedirectsChecks, + speedtestHelper.getLibrespeedNormalCustomRedirects, + speedtestHelper.setLibrespeedNormalCustomRedirects ); commonHelper.processDefaultCustomInstances( - 'pixivMoe', + 'librespeed', 'tor', - pixivHelper, + speedtestHelper, document, - pixivHelper.getPixivMoeTorRedirectsChecks, - pixivHelper.setPixivMoeTorRedirectsChecks, - pixivHelper.getPixivMoeTorCustomRedirects, - pixivHelper.setPixivMoeTorCustomRedirects + speedtestHelper.getLibrespeedTorRedirectsChecks, + speedtestHelper.setLibrespeedTorRedirectsChecks, + speedtestHelper.getLibrespeedTorCustomRedirects, + speedtestHelper.setLibrespeedTorCustomRedirects ) }) \ No newline at end of file diff --git a/src/pages/options/spotify/spotify.html b/src/pages/options/spotify/spotify.html index 353d777d..e450483c 100644 --- a/src/pages/options/spotify/spotify.html +++ b/src/pages/options/spotify/spotify.html @@ -1,139 +1,66 @@ - - - - - - - - LibRedirect: Spotify - - - - - + + + + + + General + + + +

Enable

- +
-

Protocol

- -
+
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
+ + +
- - - - - - - + \ No newline at end of file diff --git a/src/pages/options/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html index 11a7f607..e233bf7c 100644 --- a/src/pages/options/tiktok/tiktok.html +++ b/src/pages/options/tiktok/tiktok.html @@ -1,139 +1,66 @@ - - - - - - - - LibRedirect: TikTok - - - - - + + + + + + General + + + +

Enable

- +
-

Protocol

- -
-
+
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
- - - - - + \ No newline at end of file diff --git a/src/pages/options/translate/translate.html b/src/pages/options/translate/translate.html index d71060b4..95b015ee 100644 --- a/src/pages/options/translate/translate.html +++ b/src/pages/options/translate/translate.html @@ -1,139 +1,66 @@ - - - - - - - - LibRedirect: Translate - - - - - + + + + + + General + + + +

Enable

- +
-

Frontend

-

Protocol

-
-

From

- @@ -382,11 +304,9 @@
-

Engine

-
-

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

+
+
+
+ + + + + +
+
+
-
- - - - + \ No newline at end of file diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html index 4add30ae..10365153 100644 --- a/src/pages/options/twitter/twitter.html +++ b/src/pages/options/twitter/twitter.html @@ -1,168 +1,87 @@ - - - - - - - - LibRedirect: Twitter - - - - - - + + + + + + General + + + +
-

Enable

- +
-

Protocol

-

Bypass "Open in Twitter"

- +
-

Enable Custom Settings (will use cookies)

- +
- -
- +
- -
-

Display

+

Display

-

Theme

-

Infinite scrolling (experimental, requires JavaScript)

- +
-

Make profile sidebar stick to top

- +
-

Support bidirectional text (makes clicking on tweets harder)

- +
-

Hide tweet stats (replies, retweets, likes)

- +
-

Hide profile banner

- +
-

Hide pinned tweets

- +
-

Hide tweet replies

- +
-

Square profile pictures

- +
-
-

Media

-

Enable mp4 video playback (only for gifs)

- +
-

Enable hls video streaming (requires JavaScript)

- +
-

Proxy video streaming through the server (might be slow)

- +
- -

Mute videos by default

- +
-

Autoplay gifs

- +
-
-
-
- -
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- +
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Tor Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
-
-
- - - - + \ No newline at end of file diff --git a/src/pages/options/wikipedia/wikipedia.html b/src/pages/options/wikipedia/wikipedia.html index b0f2e064..86039e2a 100644 --- a/src/pages/options/wikipedia/wikipedia.html +++ b/src/pages/options/wikipedia/wikipedia.html @@ -1,230 +1,139 @@ - - - - - - - - LibRedirect: Wikipedia - - - - + + + + + + Wikipedia + + + +

Enable

- +
-

Protocol

- -
+
-
-

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
-
- - - - + \ No newline at end of file diff --git a/src/pages/options/youtube/youtube.html b/src/pages/options/youtube/youtube.html index 2bdf5993..f575f145 100644 --- a/src/pages/options/youtube/youtube.html +++ b/src/pages/options/youtube/youtube.html @@ -1,140 +1,66 @@ - - - - - - - - LibRedirect: YouTube - - + + + + + + Document + + - - - +

Enable

- +
-

Frontend

-
-

Embedded Videos Frontend


-
-

Protocol

-

Redirect Type

-
-

Bypass Watch On YouTube

- +

Bypass "Watch On YouTube"

+
-

Enable Custom Settings (will use cookies and localStorage)

- +
-
-
-
-
-

Always loop

- +
-
-

Autoplay

- +

Autoplay Video

+
-

Play next by default

- +
-

Autoplay next video

- +
-

Always proxy videos

- +
-

Listen by default

- +
-

Default speed

-

Preferred video quality

-

Preferred DASH video quality

-

- Volume: --% + Volume:--%

- +
-
-

Default comments

+

Default comments

-   +  
-

Default captions

-   +   -   +  
-

Show related videos

- +
-

Show annotations by default

- +
-

Automatically extend video description

- +
-

Interactive 360 degree videos (requires WebGL)

- +
-

Save playback position

- +
-

Select country

-

Player Style

-

Theme

-

Thin mode

- +
-

Default homepage

-

Feed menu

-   +  
-

-
-
-

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

-

- Volume: --% + Volume:--%

- +
-

Enable Sponsorblock

- +
-

Skip Sponsors

- +
-

Skip Intermission/Intro Animation

- +
-

Skip Endcards/Credits

- +
-

Skip Preview/Recap

- +
-

Skip Interaction Reminder (Subscribe)

- +
-
-

Skip Unpaid/Self Promotion

- +

Skip Unpaid/Self Promotion(Subscribe)

+
-
-

Skip Music: Non-Music Section

- +

Skip Music: Non-Music Section(Subscribe)

+
-
-

Skip Highlight

- +

Skip Highlight(Subscribe)

+
-

Skip Filler Tangent

- +
-

Theme

-

Autoplay Video

- +
-

Audio Only

- +
-

Default Quality

-

Buffering Goal (in seconds)

- +
-

Country Selection

-

Default Homepage

-

Show Comments

- +
-

Minimize Description by default

- +
-

Store Watch History

- +
-

Enabled Codecs (Multiple)

-
-

Disable LBRY for Streaming

- +
-

Enable Proxy for LBRY

- +
-
- -
-
-

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Autoplay Video

- +
-

- Volume: --% + Volume:--%

- +
-

Audio Only

- +
-

Disable LBRY

- +
-

Proxy LBRY videos

- +
-

Enable Sponsorblock

- +
-
-

Skip to the last watched point when encountering a video already seen -

- +

Skip to the last watched point when encountering a video already seen

+
-

Skip Sponsors

- +
-

Skip Intermission/Intro Animation

- +
-

Skip Endcards/Credits

- +
-

Skip Preview/Recap

- +
-

Skip Interaction Reminder (Subscribe)

- +
-

Skip Unpaid/Self Promotion

- +
-

Skip Music: Non-Music Section

- +

-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
- -
- - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/pages/options/youtubeMusic/youtubeMusic.html b/src/pages/options/youtubeMusic/youtubeMusic.html index abe04b09..80626475 100644 --- a/src/pages/options/youtubeMusic/youtubeMusic.html +++ b/src/pages/options/youtubeMusic/youtubeMusic.html @@ -1,174 +1,91 @@ - - - - - - - - LibRedirect: YT Music - - - - - - + + + + + + Document + + + +
-

Enable

- +
- -
- -
+
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- +
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + + + + +
+
+
- + + +
- - - - - - - \ No newline at end of file + \ No newline at end of file -- cgit 1.4.1