mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
6c2dbbebf0
commit
5077c86859
11 changed files with 306 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
const domainNotification = require("./domainNotification");
|
||||
const Notification = require("./Notification");
|
||||
const {createActionButtons, modalPrompt} = require("./gui");
|
||||
const lists = require("./lists");
|
||||
|
||||
Promise.all([
|
||||
browser.tabs.query({active: true, currentWindow: true}),
|
||||
|
@ -98,6 +99,25 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "whitelistDomainTemporarily",
|
||||
isIcon: true,
|
||||
callback: function(domain){
|
||||
modalPrompt(
|
||||
browser.i18n.getMessage("inputSessionWhitelistURL"),
|
||||
domain
|
||||
).then(function(domain){
|
||||
if (domain){
|
||||
lists.appendTo("sessionWhite", domain).then(function(){
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
else {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
].forEach(function(domainAction){
|
||||
domainNotification.addAction(domainAction);
|
||||
|
@ -137,6 +157,25 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "whitelistURLTemporarily",
|
||||
isIcon: true,
|
||||
callback: function({url}){
|
||||
modalPrompt(
|
||||
browser.i18n.getMessage("inputSessionWhitelistDomain"),
|
||||
"^" + url.href.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "$"
|
||||
).then(function(url){
|
||||
if (url){
|
||||
lists.appendTo("sessionWhite", url).then(function(){
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
else {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
].forEach(function(action){
|
||||
Notification.addAction(action);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue