1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Added status button in browser action to see and set the whitelist status

Fixes #535
This commit is contained in:
kkapsner 2021-05-25 16:44:20 +02:00
parent 16bef43945
commit 42b19a4ba5
7 changed files with 156 additions and 57 deletions

View file

@ -48,18 +48,17 @@
};
scope.resetUrlValue = function(name, url){
let urlContainerValue = scope.urlContainer.get();
const matching = urlContainerValue.filter(function(urlSetting){
urlContainerValue.filter(function(urlSetting){
return urlSetting.match(url);
});
if (matching.length){
delete matching[0][name];
if (Object.keys(matching[0]).every(function(key){return key === "url";})){
}).forEach(function(match){
delete match[name];
if (Object.keys(match).every(function(key){return key === "url";})){
urlContainerValue = urlContainerValue.filter(function(urlSetting){
return urlSetting !== matching[0];
return urlSetting !== match;
});
}
scope.urlContainer.set(urlContainerValue);
}
});
scope.urlContainer.set(urlContainerValue);
};
function processHideContainer(settingDefinition){