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.
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
andcatch
).Without this change, each call from
receiveNative
tosendNative
posts a message, raises a TypeError, which ends up callingsendNative
again viasendError
With this change, the errors are eliminated, and the sent message is logged.
Before
After