-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No handler found for post message, using in chrome extension #84
Comments
This is due to the fact that both the content script and the page script of a Chrome extension share the same window, but not the same global variables (see the content scripts documentation). In your case, when Not sure if there is any (general) work-around for this (after encountering this I ended up directly using |
Also interested! But even with the snippet from above what it weird is that the injected_script does indeed get the callback with the result from the listener in the content_script but then throw 3 times both (so 6 errors):
What I don't understand is that still, if my injected_script has a button which fire a |
@angela-tran discovered that this was due to the |
i am trying to use post-robot in the chrome extension to make communication between page script and content script. If i return Promise inside 'postRobot.on' i will get error 'No handler found for post message...', but if i just return the value directly then everything is ok.
Inside page script i have:
Inside content script i have:
The text was updated successfully, but these errors were encountered: