Skip to content

Commit

Permalink
Don't show errors on older versions of ThinBridge
Browse files Browse the repository at this point in the history
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 <fujimoto@ceptord.net>
  • Loading branch information
fujimotos committed Nov 8, 2021
1 parent b1ed659 commit 142a7d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webextension/edge/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 142a7d7

Please sign in to comment.