KeithHenry / chromeExtensionAsync

Promise wrapper for the Chrome extension API so that it can be used with async/await rather than callbacks
MIT License
228 stars 32 forks source link

chrome-extension-async clashes with other events sent at the same time #11

Closed KeithHenry closed 6 years ago

KeithHenry commented 6 years ago

Depending on timing, if chrome-extension-async's subscription (using chrome.runtime.onMessage.addListener) picks up an event not meant for it we sometimes get an error:

Error: The message port closed before a response was received.

KeithHenry commented 6 years ago

This only seems to happen when the other onMessage listener returns false and tries to sendResponse, as such it's a side effect of another exception, and probably isn't worth working around.