-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
extension-port-stream/src/index.ts
Lines 14 to 15 in 6e32c73
this._port.onMessage.addListener((msg: unknown) => this._onMessage(msg)); | |
this._port.onDisconnect.addListener(() => this._onDisconnect()); |
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
needs to be handled in this way per https://stackoverflow.com/a/56787332
chrome.runtime.sendMessage('ping', response => {
if(chrome.runtime.lastError) {
// handle error
} else {
// handle response
}
}
looks like firefox also puts the error on the port obj
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port
also looks like the error is handled more normally for some promise based apis, but likely not relevant to our usage of port
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/lastError
Metadata
Metadata
Assignees
Labels
No labels