aboutsummaryrefslogtreecommitdiffstats
path: root/src/assets
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-05-12 08:57:20 +0300
committerManeraKai <manerakai@protonmail.com>2023-05-12 08:57:20 +0300
commit8f8c2a24e423554ddafb67def4648991cb017fe2 (patch)
treeee58f9f095ae21c4c9c55b6dd47b82df0a6c6643 /src/assets
parentignored http from url exclusions https://github.com/libredirect/browser_exten... (diff)
downloadlibredirect-8f8c2a24e423554ddafb67def4648991cb017fe2.zip
Fixed exclusions in a better way https://github.com/libredirect/browser_extension/issues/665
Diffstat (limited to 'src/assets')
-rw-r--r--src/assets/javascripts/services.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 37847a57..aa163451 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -821,7 +821,14 @@ async function copyRaw(url, test) {
function isException(url) {
let exceptions = options.exceptions
if (exceptions && url) {
- if (exceptions.url) for (const item of exceptions.url) if (item == url.href) return true
+ if (exceptions.url) {
+ for (let item of exceptions.url) {
+ item = new URL(item)
+ item = item.href
+ item = item.replace(/^http:\/\//, 'https://')
+ if (item == url.href) return true
+ }
+ }
if (exceptions.regex) for (const item of exceptions.regex) if (new RegExp(item).test(url.href)) return true
}
return false