From e4c2196131d0eafc2e2b7108087235c48693c5a4 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Sun, 16 Sep 2018 12:15:04 +0200 Subject: [PATCH] Send only necessary notifications to main process For #238 --- lib/frame.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/frame.js b/lib/frame.js index 7509cb1..36ae47e 100644 --- a/lib/frame.js +++ b/lib/frame.js @@ -69,13 +69,17 @@ }); var notifications = []; var notificationCounter = {}; + var sentAPIs = {}; function notify(data){ if (!settings.ignoredAPIs[data.api]){ if (settings.storeNotificationData){ notifications.push(data); } notificationCounter[data.messageId] = (notificationCounter[data.messageId] || 0) + 1; - port.postMessage({"canvasBlocker-notify": data}); + if (!sentAPIs[data.api]){ + sentAPIs[data.api] = true; + port.postMessage({"canvasBlocker-notify": data}); + } } }