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

Added setting to controll to save notification details

Fixes #236
This commit is contained in:
kkapsner 2018-09-11 23:54:59 +02:00
parent 1a066de2fd
commit 5e5011f208
16 changed files with 556 additions and 90 deletions

View file

@ -68,9 +68,13 @@
}
});
var notifications = [];
var notificationCounter = {};
function notify(data){
if (!settings.ignoredAPIs[data.api]){
notifications.push(data);
if (settings.storeNotificationData){
notifications.push(data);
}
notificationCounter[data.messageId] = (notificationCounter[data.messageId] || 0) + 1;
port.postMessage({"canvasBlocker-notify": data});
}
}
@ -154,6 +158,8 @@
notice("sending notifications:", notifications);
browser.runtime.sendMessage({
sender: tabId,
url: window.location.href,
"canvasBlocker-notificationCounter": notificationCounter,
"canvasBlocker-notifications": notifications
});
notice("notifications sent");