From 09b2a8264386a3506345789ee3abd330baacc188 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Thu, 21 Dec 2023 00:28:52 -0500 Subject: [PATCH] Suppress log --- chrome/background/BackgroundUtils.mjs | 4 ++-- chrome/background/background.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/background/BackgroundUtils.mjs b/chrome/background/BackgroundUtils.mjs index 77956901..07dfb339 100644 --- a/chrome/background/BackgroundUtils.mjs +++ b/chrome/background/BackgroundUtils.mjs @@ -1,7 +1,7 @@ export class BackgroundUtils { - static checkMessageError(message) { + static checkMessageError(message, suppress = false) { if (chrome.runtime.lastError) { - console.warn(`Unable to send message '${message}'`, chrome.runtime.lastError); + if (!suppress) console.warn(`Unable to send message '${message}'`, chrome.runtime.lastError); } } diff --git a/chrome/background/background.mjs b/chrome/background/background.mjs index 2e8a8228..5d492e21 100644 --- a/chrome/background/background.mjs +++ b/chrome/background/background.mjs @@ -163,7 +163,7 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { type: 'options', time: msg.time, }, (response) => { - BackgroundUtils.checkMessageError('options'); + BackgroundUtils.checkMessageError('options', true); }); } });