mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
Added ignore list.
This commit is contained in:
parent
af47ee8d87
commit
475c28483f
120
lib/main.js
120
lib/main.js
@ -40,6 +40,15 @@
|
|||||||
preferences.on("blackList", function(){
|
preferences.on("blackList", function(){
|
||||||
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"];
|
||||||
@ -130,58 +139,69 @@
|
|||||||
case "fake":
|
case "fake":
|
||||||
|
|
||||||
var contentURL = new URL(worker.contentURL);
|
var contentURL = new URL(worker.contentURL);
|
||||||
var url = contentURL.href;
|
if (!ignoreList.match(contentURL)){
|
||||||
var domain = contentURL.hostname;
|
var url = contentURL.href;
|
||||||
var message = _("fakedReadout").replace(/\{url\}/g, url);
|
var domain = contentURL.hostname;
|
||||||
|
var message = _("fakedReadout").replace(/\{url\}/g, url);
|
||||||
var tab = tabUtils.getTabForId(worker.tab.id);
|
|
||||||
var tabBrowser = tabUtils.getTabBrowserForTab(tab);
|
var tab = tabUtils.getTabForId(worker.tab.id);
|
||||||
var browser = tabUtils.getBrowserForTab(tab);
|
var tabBrowser = tabUtils.getTabBrowserForTab(tab);
|
||||||
|
var browser = tabUtils.getBrowserForTab(tab);
|
||||||
var notifyBox = tabBrowser.getNotificationBox(browser);
|
|
||||||
var notification = notifyBox.getNotificationWithValue("fake-readout");
|
var notifyBox = tabBrowser.getNotificationBox(browser);
|
||||||
if (notification){
|
var notification = notifyBox.getNotificationWithValue("fake-readout");
|
||||||
notification.label = message;
|
if (notification){
|
||||||
}
|
notification.label = message;
|
||||||
else {
|
}
|
||||||
var buttons = [
|
else {
|
||||||
{
|
var buttons = [
|
||||||
label: _("displayCallingStack"),
|
{
|
||||||
accessKey: "",
|
label: _("displayCallingStack"),
|
||||||
callback: function(){
|
accessKey: "",
|
||||||
browser.contentWindow.alert(callingStackMsg);
|
callback: function(){
|
||||||
|
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: "",
|
||||||
|
callback: function(){
|
||||||
|
prefs.whiteList += "," + url;
|
||||||
|
prefService.set("extensions.CanvasBlocker@kkapsner.de.whiteList", prefs.whiteList);
|
||||||
|
updateWhiteList();
|
||||||
|
workers.forEach(checkWorker);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: _("whitelistDomain"),
|
||||||
|
accessKey: "",
|
||||||
|
callback: function(){
|
||||||
|
prefs.whiteList += "," + domain;
|
||||||
|
prefService.set("extensions.CanvasBlocker@kkapsner.de.whiteList", prefs.whiteList);
|
||||||
|
updateWhiteList();
|
||||||
|
workers.forEach(checkWorker);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
];
|
||||||
{
|
|
||||||
label: _("whitelistURL"),
|
|
||||||
accessKey: "",
|
|
||||||
callback: function(){
|
|
||||||
prefs.whiteList += "," + url;
|
|
||||||
prefService.set("extensions.CanvasBlocker@kkapsner.de.whiteList", prefs.whiteList);
|
|
||||||
updateWhiteList();
|
|
||||||
workers.forEach(checkWorker);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: _("whitelistDomain"),
|
|
||||||
accessKey: "",
|
|
||||||
callback: function(){
|
|
||||||
prefs.whiteList += "," + domain;
|
|
||||||
prefService.set("extensions.CanvasBlocker@kkapsner.de.whiteList", prefs.whiteList);
|
|
||||||
updateWhiteList();
|
|
||||||
workers.forEach(checkWorker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
var priority = notifyBox.PRIORITY_WARNING_MEDIUM;
|
var priority = notifyBox.PRIORITY_WARNING_MEDIUM;
|
||||||
notifyBox.appendNotification(
|
notifyBox.appendNotification(
|
||||||
message,
|
message,
|
||||||
"fake-readout",
|
"fake-readout",
|
||||||
"chrome://browser/skin/Info.png",
|
"chrome://browser/skin/Info.png",
|
||||||
priority,
|
priority,
|
||||||
buttons
|
buttons
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -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=
|
||||||
|
|
||||||
@ -42,4 +45,7 @@ fakedReadout = Auslese vorgetäuscht auf {url}
|
|||||||
settings = Einstellungen
|
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
|
@ -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=
|
||||||
|
|
||||||
@ -43,4 +46,7 @@ settings = settings
|
|||||||
displayCallingStack = display calling stack
|
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
|
@ -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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user