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

remove promise chain in sendNative -- postMessage does not return anything #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brttbndr
Copy link

@brttbndr brttbndr commented Mar 6, 2021

During normal use of the extension, I noticed error-like output in the browser console (Cmd-Shift-J)

After poking around with the debugger and reading up on native messaging, I've concluded that postMessage does not return anything (and in particular, not a promise that can chain then and catch).

Without this change, each call from receiveNative to sendNative posts a message, raises a TypeError, which ends up calling sendNative again via sendError

With this change, the errors are eliminated, and the sent message is logged.

Before

image

After

image

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

Successfully merging this pull request may close these issues.

1 participant