Convenience preset did not work properly

This commit is contained in:
kkapsner 2021-03-06 11:10:18 +01:00
parent ee87773ce2
commit 872e633025
2 changed files with 44 additions and 40 deletions

View File

@ -40,6 +40,7 @@
let newEntry = {url};
newEntry[name] = value;
urlContainerValue.push(newEntry);
initializeUrlSetting(newEntry);
matching = [newEntry];
}
matching[0][name] = value;
@ -164,12 +165,7 @@
}
};
scope.initializeUrlContainer = function(eventHandler){
if (!scope.urlContainer){
return;
}
scope.urlContainer.on(function({newValue, oldValue}){
newValue.forEach(function(urlSetting){
function initializeUrlSetting(urlSetting){
let regExp;
const domain = !!urlSetting.url.match(/^[A-Za-z0-9_.-]+$/);
if (domain){
@ -208,7 +204,14 @@
value: match
}
);
});
}
scope.initializeUrlContainer = function(eventHandler){
if (!scope.urlContainer){
return;
}
scope.urlContainer.on(function({newValue, oldValue}){
newValue.forEach(initializeUrlSetting);
const newUrls = newValue.map(function(entry){return entry.url;});
const oldUrls = oldValue.map(function(entry){return entry.url;});

View File

@ -8,6 +8,7 @@ Version 1.6:
fixes:
- fix message canvasBlocker-unload
- convenience preset did not work properly
known issues:
- if a data URL is blocked the page action button does not appear