1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-05-19 19:02:21 +02: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(); updateBlackList();
}); });
var ignoreList;
function updateIgnoreList(){
ignoreList = getDomainRegExpList(prefs.ignoreList);
}
updateIgnoreList();
preferences.on("ignoreList", function(){
updateIgnoreList();
});
// preferences for injected file // preferences for injected file
var preferencesForInjected = ["showCallingFile", "showCompleteCallingStack"]; var preferencesForInjected = ["showCallingFile", "showCompleteCallingStack"];
preferencesForInjected.forEach(function(name){ preferencesForInjected.forEach(function(name){
@ -130,6 +139,7 @@
case "fake": case "fake":
var contentURL = new URL(worker.contentURL); var contentURL = new URL(worker.contentURL);
if (!ignoreList.match(contentURL)){
var url = contentURL.href; var url = contentURL.href;
var domain = contentURL.hostname; var domain = contentURL.hostname;
var message = _("fakedReadout").replace(/\{url\}/g, url); var message = _("fakedReadout").replace(/\{url\}/g, url);
@ -152,6 +162,15 @@
browser.contentWindow.alert(callingStackMsg); browser.contentWindow.alert(callingStackMsg);
} }
}, },
{
label: _("ignorelistDomain"),
accessKey: "",
callback: function(){
prefs.ignoreList += "," + domain;
prefService.set("extensions.CanvasBlocker@kkapsner.de.ignoreList", prefs.ignoreList);
updateIgnoreList();
}
},
{ {
label: _("whitelistURL"), label: _("whitelistURL"),
accessKey: "", accessKey: "",
@ -183,6 +202,7 @@
buttons buttons
); );
} }
}
break; break;
} }
}); });

View File

@ -4,6 +4,9 @@ whiteList_description= Domänen oder URLs, die die <canvas>-API verwenden dürfe
blackList_title= Blacklist 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. 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_title= Blockiermodus
blockMode_description= blockMode_description=
@ -43,3 +46,6 @@ settings = Einstellungen
displayCallingStack = Aufrufestack anzeigen displayCallingStack = Aufrufestack anzeigen
whitelistURL = erlaube URL whitelistURL = erlaube URL
whitelistDomain = erlaube Domain 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_title= Black list
blackList_description= Domains or URLs where the <canvas>-API should always be blocked. To add multiple entries seperate them by comma. 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_title= Block mode
blockMode_description= blockMode_description=
@ -44,3 +47,6 @@ displayCallingStack = display calling stack
whitelist = whitelist whitelist = whitelist
whitelistURL = whitelist URL whitelistURL = whitelist URL
whitelistDomain = whitelist domain whitelistDomain = whitelist domain
whitelistURL = ignore URL
whitelistDomain = ignore domain

View File

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