about summary refs log tree commit diff stats
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/background/background.js6
-rw-r--r--src/pages/options/widgets/general.js13
2 files changed, 10 insertions, 9 deletions
diff --git a/src/pages/background/background.js b/src/pages/background/background.js
index 02b705c4..80713059 100644
--- a/src/pages/background/background.js
+++ b/src/pages/background/background.js
@@ -1,6 +1,5 @@
 "use strict"
 
-import generalHelper from "../../assets/javascripts/general.js"
 import utils from "../../assets/javascripts/utils.js"
 import servicesHelper from "../../assets/javascripts/services.js"
 
@@ -44,9 +43,10 @@ browser.webRequest.onBeforeRequest.addListener(
 		if (tabIdRedirects[details.tabId] == false) return null
 		let newUrl = servicesHelper.redirect(url, details.type, initiator, tabIdRedirects[details.tabId], details.tabId)
 
-		if (details.frameAncestors && details.frameAncestors.length > 0 && generalHelper.isException(new URL(details.frameAncestors[0].url))) newUrl = null
+		if (details.frameAncestors && details.frameAncestors.length > 0 && servicesHelper.isException(new URL(details.frameAncestors[0].url))) newUrl = null
 
-		if (generalHelper.isException(url)) {
+		console.log(servicesHelper.isException(url))
+		if (servicesHelper.isException(url)) {
 			if (details.type == "main_frame")
 				newUrl = "BYPASSTAB"
 			else
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)