aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/options
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-05-12 08:48:16 +0300
committerManeraKai <manerakai@protonmail.com>2023-05-12 08:48:16 +0300
commit03d0b41a7fff3ee339944570d982db62312b9447 (patch)
treec5d1170d883068078d1de547ad0d235f2cd7cfa7 /src/pages/options
parentUpdated README (diff)
downloadlibredirect-03d0b41a7fff3ee339944570d982db62312b9447.zip
ignored http from url exclusions https://github.com/libredirect/browser_extension/issues/665. Cleaned other things
Diffstat (limited to 'src/pages/options')
-rw-r--r--src/pages/options/widgets/general.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js
index 484edc05..3dd52af5 100644
--- a/src/pages/options/widgets/general.js
+++ b/src/pages/options/widgets/general.js
@@ -152,14 +152,15 @@ function calcExceptionsCustomInstances() {
}
calcExceptionsCustomInstances()
document.getElementById("custom-exceptions-instance-form").addEventListener("submit", async event => {
+ console.log('something plz.... :\')')
event.preventDefault()
-
let val
- if (instanceType == "url") {
- if (nameCustomInstanceInput.validity.valid) {
- val = nameCustomInstanceInput.value
- if (!exceptionsCustomInstances.url.includes(val)) exceptionsCustomInstances.url.push(val)
- }
+ if (instanceType == "url" && nameCustomInstanceInput.validity.valid) {
+ val = nameCustomInstanceInput.value
+ const url = new URL(val)
+ val = url.href
+ val = val.replace(/^http:\/\//, 'https://')
+ if (!exceptionsCustomInstances.url.includes(val)) exceptionsCustomInstances.url.push(val)
} else if (instanceType == "regex") {
val = nameCustomInstanceInput.value
if (val.trim() != "" && !exceptionsCustomInstances.regex.includes(val)) exceptionsCustomInstances.regex.push(val)