1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-05-29 09:28:06 +02:00

Added prompts for domain and URL whitelist adding in notification as mentioned in issue #40.

This commit is contained in:
kkapsner 2015-10-08 17:17:02 +02:00
parent 72ebf99297
commit 9255fb5813

View File

@ -62,14 +62,27 @@ exports.notify = function(window, callingStackMsg){
label: _("whitelistURL"),
accessKey: "",
callback: function(){
lists.appendTo("white", "^" + notification.url.replace(/([\\\+\*\?\[\^\]\$\(\)\{\}\=\!\|\.])/g, "\\$1") + "$");
var url = browser.contentWindow.prompt(
"Input URL RegExp to add to white list:",
"^" + notification.url.replace(/([\\\+\*\?\[\^\]\$\(\)\{\}\=\!\|\.])/g, "\\$1") + "$"
);
if (url){
lists.appendTo("white", url);
}
}
},
{
label: _("whitelistDomain"),
accessKey: "",
callback: function(){
lists.appendTo("white", notification.domain);
var domain = browser.contentWindow.prompt(
"Input domain to add to white list:",
notification.domain
);
if (domain){
lists.appendTo("white", domain);
}
}
},
{