Lusito/webextension-polyfill-ts

`runtime.Port.onDisconnect` Port argument should have `error` property

Gudahtt opened this issue · 2 comments

The first parameter passed to functions registered with the onDisconnect method is expected to be a Port object, but on Firefox it has an additional error property that describes why the disconnect happens. See the relevant MDN docs: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/Runtime/Port

This error property is missing from the Port type definition.

Thanks for the report. I will fix this, but just so you know: The documentation says:

Note that in Google Chrome port.error is not supported: instead, use runtime.lastError to get the error message.

So maybe it would be best if you used that instead.

solved in next version