1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-03 10:31:54 +01:00

Added ignore list.

This commit is contained in:
kkapsner 2015-04-23 10:04:20 +02:00
parent af47ee8d87
commit 475c28483f
4 changed files with 90 additions and 52 deletions

View File

@ -41,6 +41,15 @@
updateBlackList();
});
var ignoreList;
function updateIgnoreList(){
ignoreList = getDomainRegExpList(prefs.ignoreList);
}
updateIgnoreList();
preferences.on("ignoreList", function(){
updateIgnoreList();
});
// preferences for injected file
var preferencesForInjected = ["showCallingFile", "showCompleteCallingStack"];
preferencesForInjected.forEach(function(name){
@ -130,6 +139,7 @@
case "fake":
var contentURL = new URL(worker.contentURL);
if (!ignoreList.match(contentURL)){
var url = contentURL.href;
var domain = contentURL.hostname;
var message = _("fakedReadout").replace(/\{url\}/g, url);
@ -152,6 +162,15 @@
browser.contentWindow.alert(callingStackMsg);
}
},
{
label: _("ignorelistDomain"),
accessKey: "",
callback: function(){
prefs.ignoreList += "," + domain;
prefService.set("extensions.CanvasBlocker@kkapsner.de.ignoreList", prefs.ignoreList);
updateIgnoreList();
}
},
{
label: _("whitelistURL"),
accessKey: "",
@ -183,6 +202,7 @@
buttons
);
}
}
break;
}
});

View File

@ -4,6 +4,9 @@ whiteList_description= Domänen oder URLs, die die <canvas>-API verwenden dürfe
blackList_title= Blacklist
blackList_description= Domänen oder URLs, die die <canvas>-API niemals verwenden dürfen. Mehrere Einträge müssen durch ein Komma getrennt weren.
ignoreList_title= Ignorierliste
ignoreList_description= Domänen oder URLs, bei denen keine Benachrichtgung angezeigt werden. Mehrere Einträge müssen durch ein Komma getrennt weren.
blockMode_title= Blockiermodus
blockMode_description=
@ -43,3 +46,6 @@ settings = Einstellungen
displayCallingStack = Aufrufestack anzeigen
whitelistURL = erlaube URL
whitelistDomain = erlaube Domain
ignorelistURL = ignoriere URL
ignorelistDomain = ignoriere Domain

View File

@ -4,6 +4,9 @@ whiteList_description= Domains or URLs where the <canvas>-API should not be bloc
blackList_title= Black list
blackList_description= Domains or URLs where the <canvas>-API should always be blocked. To add multiple entries seperate them by comma.
ignoreList_title= Ignore list
ignoreList_description= Domains or URLs where no notifications will be shown. To add multiple entries seperate them by comma.
blockMode_title= Block mode
blockMode_description=
@ -44,3 +47,6 @@ displayCallingStack = display calling stack
whitelist = whitelist
whitelistURL = whitelist URL
whitelistDomain = whitelist domain
whitelistURL = ignore URL
whitelistDomain = ignore domain

View File

@ -16,6 +16,12 @@
"type": "string",
"value": ""
},
{
"name": "ignoreList",
"title": "Ignore list",
"type": "string",
"value": ""
},
{
"name": "blockMode",
"title": "block mode",