From 03d0b41a7fff3ee339944570d982db62312b9447 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Fri, 12 May 2023 08:48:16 +0300 Subject: ignored http from url exclusions https://github.com/libredirect/browser_extension/issues/665. Cleaned other things --- src/assets/javascripts/services.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/assets/javascripts/services.js') diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 12a08d32..37847a57 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -83,7 +83,6 @@ function redirect(url, type, initiator, forceRedirection) { ) return "BYPASSTAB" randomInstance = utils.getRandomInstance(instanceList) - console.log(options[service].localhost) if (config.services[service].frontends[frontend].localhost && options[service].instance == "localhost") { randomInstance = `http://${frontend}.localhost:8080` } @@ -819,6 +818,15 @@ 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.regex) for (const item of exceptions.regex) if (new RegExp(item).test(url.href)) return true + } + return false +} + export default { redirect, redirectAsync, @@ -828,5 +836,6 @@ export default { upgradeOptions, processUpdate, copyRaw, - switchInstance + switchInstance, + isException } -- cgit 1.4.1