Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@types/firefox-webext-browser] wrong type for browser.runtime.Port.postMessage argument #68241

Open
wAuner opened this issue Jan 18, 2024 · 0 comments

Comments

@wAuner
Copy link

wAuner commented Jan 18, 2024

postMessage: (message: object) => void;

According to the (not very detailed) MDN documentation for the postMessage function the parameter message needs to be serializable, but that doesn't mean it has to be an object. I'm currently developing a browser extension for Firefox and Chrome and was wondering why I did get a linter error when I passed in a string for Firefox, while that wasn't a problem for Chrome. At runtime it clearly works for both browsers.
The chrome types use any for this parameter, which probably should be the same for Firefox.

@wAuner wAuner changed the title Firefox-webext-browser: wrong type for browser.runtime.Port.postMessage argument [@types/firefox-webext-browser] wrong type for browser.runtime.Port.postMessage argument Jan 18, 2024
typescript-bot pushed a commit that referenced this issue Mar 10, 2024
… `browser.runtime.Port.postMessage` argument by @Grayson-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant