From 810c607e6b4b050147c49a3affe2d28ac4f8fa0f Mon Sep 17 00:00:00 2001 From: hackademix Date: Wed, 23 Oct 2019 17:20:10 +0200 Subject: Consolidated missing endpoint error detection in Messages. --- src/lib/Messages.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/Messages.js b/src/lib/Messages.js index 0a47c42..f33b621 100644 --- a/src/lib/Messages.js +++ b/src/lib/Messages.js @@ -65,6 +65,10 @@ return await browser.tabs.sendMessage(recipientInfo.tabId, args, opts); } return await browser.runtime.sendMessage(args); + }, + isMissingEndpoint(error) { + return error && error.message === + "Could not esablish connection. Receiving end does not exist."; } } } -- cgit v1.2.3