-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
I'm trying to send a message with
import chrome.runtime.Runtime
Runtime.sendMessage(message = "hi")
This is how it looks in js:
$c_Lchrome_runtime_Runtime$.prototype.sendMessage__sjs_js_UndefOr__sjs_js_Any__sjs_js_UndefOr__sjs_js_UndefOr__V = (function(extensionId, message, options, responseCallback) {
$g.chrome.runtime.sendMessage(extensionId, message, options, responseCallback)
});
var x$10 = (void 0);
$m_Lchrome_runtime_Runtime$();
var x$11 = (void 0);
$m_Lchrome_runtime_Runtime$();
var x$12 = (void 0);
$m_Lchrome_runtime_Runtime$().sendMessage__sjs_js_UndefOr__sjs_js_Any__sjs_js_UndefOr__sjs_js_UndefOr__V(x$10, "hi", x$11, x$12)
Which seemingly matches chrome.runtime.sendMessage(undefined, "hi", undefined, undefined") but I am getting this error:
Error in event handler for runtime.onMessage: Error: Invalid arguments to sendMessage.
at $c_Lchrome_runtime_Runtime$.sendMessage__sjs_js_UndefOr__sjs_js_Any__sjs_js_UndefOr__sjs_js_UndefOr__V
Edit: Running in a content script this does not work:
chrome.runtime.Runtime.sendMessage(extensionId = Runtime.id, message = "hi")
But this does:
chrome.runtime.bindings.Runtime.sendMessage(extensionId = Runtime.id, message = "hi")
Metadata
Metadata
Assignees
Labels
No labels