1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Added whitelist scope question

This commit is contained in:
kkapsner 2019-04-30 23:42:21 +02:00
parent cd8c7bd71c
commit 51445b36e0
5 changed files with 89 additions and 10 deletions

View file

@ -26,7 +26,7 @@
};
}();
const DomainNotification = function DomainNotification(domain, messageId, count = 0){
const DomainNotification = function DomainNotification(domain, messageId, count = 0, api = ""){
if (domain instanceof URL){
this.urls().add(domain.href);
domain = domain.hostname;
@ -34,6 +34,7 @@
this.domain = domain;
this.messageId = messageId;
this.count = count;
this.api = api;
this.extraNotifications = 0;
addToContainer(this);
this.update();
@ -148,7 +149,7 @@
DomainNotification.prototype.actionsNode = function actionsNode(){
const node = document.createElement("div");
node.className = "actions";
createActionButtons(node, actions, {domain: this.domain, urls: this.urls()});
createActionButtons(node, actions, {domain: this.domain, urls: this.urls(), api: this.api});
this.actionsNode = function(){
return node;
};
@ -165,11 +166,11 @@
};
const domains = new Map();
const domainNotification = function(url, messageId, count = 0){
const domainNotification = function(url, messageId, count = 0, api = ""){
const domain = url.hostname;
var domainNotification = domains.get(domain + messageId);
if (!domainNotification){
domainNotification = new DomainNotification(url, messageId, count);
domainNotification = new DomainNotification(url, messageId, count, api);
domains.set(domain + messageId, domainNotification);
}
else {