From d7dfe5989a8592d6ec174b562c45cffebbb36354 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 16 May 2023 15:38:20 +0300 Subject: [PATCH] Re-added LibreSpeed https://github.com/libredirect/browser_extension/issues/170 --- src/assets/images/speedTest-icon-light.svg | 39 ++++++++++++++++++++++ src/assets/images/speedTest-icon.svg | 1 + src/assets/javascripts/services.js | 3 +- src/config.json | 23 +++++++++++++ src/pages/options/index.js | 18 ++++------ src/pages/stylesheets/styles.css | 2 +- 6 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 src/assets/images/speedTest-icon-light.svg create mode 100644 src/assets/images/speedTest-icon.svg diff --git a/src/assets/images/speedTest-icon-light.svg b/src/assets/images/speedTest-icon-light.svg new file mode 100644 index 0000000..bcee17f --- /dev/null +++ b/src/assets/images/speedTest-icon-light.svg @@ -0,0 +1,39 @@ + + + + + + diff --git a/src/assets/images/speedTest-icon.svg b/src/assets/images/speedTest-icon.svg new file mode 100644 index 0000000..d2c8d4d --- /dev/null +++ b/src/assets/images/speedTest-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 61d033c..eedbc2b 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -719,7 +719,8 @@ const defaultInstances = { 'gothub': ['https://gh.odyssey346.dev'], 'mikuInvidious': ['https://mikuinv.resrv.org'], "tent": ['https://tent.sny.sh'], - "wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'] + "wolfreeAlpha": ['https://gqq.gitlab.io', 'https://uqq.gitlab.io'], + "libreSpeed": ['https://librespeed.org'] } function initDefaults() { diff --git a/src/config.json b/src/config.json index 32dec36..15c5301 100644 --- a/src/config.json +++ b/src/config.json @@ -774,6 +774,29 @@ "imageType": "svg", "embeddable": false, "url": "https://www.wolframalpha.com" + }, + "speedTest": { + "frontends": { + "libreSpeed": { + "name": "LibreSpeed", + "instanceList": true, + "url": "https://github.com/librespeed/speedtest" + } + }, + "targets": [ + "^https?:\\/{2}speedtest\\.libredirect\\.invalid", + "^https?:\\/{2}(www\\.)?fast\\.com\\/", + "^https?:\\/{2}(www\\.)?speedtest\\.net\\/" + ], + "name": "Speed Test", + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "libreSpeed" + }, + "imageType": "svgMono", + "embeddable": false, + "url": "https://speedtest.libredirect.invalid" } } } \ No newline at end of file diff --git a/src/pages/options/index.js b/src/pages/options/index.js index c8eb500..9480f9a 100644 --- a/src/pages/options/index.js +++ b/src/pages/options/index.js @@ -53,7 +53,6 @@ async function changeFrontendsSettings(service) { } if (document.getElementById(`${service}-redirectType`)) { const frontend = options[service].frontend - console.log(frontend) if (config.services[service].frontends[frontend].embeddable) { document.getElementById(`${service}-redirectType`).innerHTML = `