From 142a7d71c6ae93da25e76757313ebd7a61d4a887 Mon Sep 17 00:00:00 2001 From: Fujimoto Seiji Date: Mon, 8 Nov 2021 15:46:55 +0900 Subject: [PATCH] Don't show errors on older versions of ThinBridge We need this in order to work nicely on with older versions of ThinBridge (in particular < v4.0.2.4). Since the new "R edge" command is only available since v4.0.2.4, we need to suppress "no-such-command" errors when older versions are in use. Signed-off-by: Fujimoto Seiji --- webextension/edge/background.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webextension/edge/background.js b/webextension/edge/background.js index f239c0f..a4b446e 100644 --- a/webextension/edge/background.js +++ b/webextension/edge/background.js @@ -348,6 +348,11 @@ var ResourceCap = { check: function(tabId, ntabs) { var query = new String(`R ${BROWSER} ${ntabs}`); chrome.runtime.sendNativeMessage(SERVER_NAME, query, (resp) => { + // Need this to support ThinBridge v4.0.2.3 (or before) + if (chrome.runtime.lastError) { + return; + } + if (resp.closeTab) { chrome.tabs.remove(tabId, () => { if (chrome.runtime.lastError) {