mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 14:15:36 +07:00
handle url better; fix saving when edited
... via settings
This commit is contained in:
@@ -168,7 +168,8 @@ function addToWhitelist() {
|
||||
function: "getData",
|
||||
params: ['whitelist']
|
||||
}).then((data) => {
|
||||
let domain = site.replace(/.*?:(?:\/\/)?(.*?\/).*/, '$1')
|
||||
let siteUrl = new URL(site)
|
||||
let domain = siteUrl.hostname
|
||||
data.response.push(domain)
|
||||
browser.runtime.sendMessage({
|
||||
function: "setData",
|
||||
|
||||
@@ -82,7 +82,7 @@ function save() {
|
||||
saveData("badged_color", pickr.getColor().toHEXA().toString())
|
||||
.then(() => saveData("ruleURL", document.querySelector('input[name=ruleURL]').value))
|
||||
.then(() => saveData("hashURL", document.querySelector('input[name=hashURL]').value))
|
||||
.then(() => saveData("whitelist", document.querySelector('input[name=whitelist]').value))
|
||||
.then(() => saveData("whitelist", document.querySelector('input[name=whitelist]').value.split(',')))
|
||||
.then(() => saveData("types", document.querySelector('input[name=types]').value))
|
||||
.then(() => saveData("logLimit", Math.max(0, Math.min(5000, document.querySelector('input[name=logLimit]').value))))
|
||||
.then(() => browser.runtime.sendMessage({
|
||||
|
||||
Reference in New Issue
Block a user