extension-port-stream icon indicating copy to clipboard operation
extension-port-stream copied to clipboard

A module for creating a node style stream over a WebExtension port object.

Results 5 extension-port-stream issues
Sort by recently updated
recently updated
newest added

fixes https://github.com/MetaMask/metamask-extension/issues/14987 fixes #22 runtime.lastError needs to be checked when doing callback-based async things: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/lastError https://developer.chrome.com/docs/extensions/reference/runtime/ By just reading the value, the error message goes away. In the case of...

Fixes #22 `webextension-polyfill-ts` doesn't include the firefox variant with the error appended to it and other typescript woes

![image](https://user-images.githubusercontent.com/58567154/180166834-ac6f92cc-b380-406e-b7f3-d73617b433f8.png)

https://github.com/MetaMask/extension-port-stream/blob/6e32c73a5c7b66ede01fad9d8dc83e9991eed49f/src/index.ts#L14-L15 ``` 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 ```js chrome.runtime.sendMessage('ping', response => { if(chrome.runtime.lastError) {...