-
Notifications
You must be signed in to change notification settings - Fork 22
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
WIP: Use Messenger with named target for sidebar panel rendering #1695
Conversation
(Having some trouble debugging this. The messages don't seem to arrive into the iframe even if the tabId and frameId are resolved correctly. Once every 10 times it works. 😰 ) |
I can help take a look this afternoon. Is this an issue when opening/closing the sidebar, or while the sidebar is open? Are the messages arriving but then getting discarded for being stale? For the messaging, I was thinking about investing some time at some point in using a tool like https://bestchai.bitbucket.io/shiviz/ to visualize the communication trace between the components. We could probably instrument the messaging library to produce the format it needs |
I only tried the initial messages at first. It could be that the retries stop too early, but the "named target registered" message happens 3-4 seconds before the last retry.
The raw onMessage handler in the sidebar isn't called, so they don't arrive at all. However, if I later message it manually the messages arrive.
That looks good! I can look into it. It might be complicated since there's no "global" communication watcher, so each step would have to probably report back to the background page (via messenger itself) and generate the viz there. |
I might have found the issue, please don't attempt to debug 😅 it's in pixiebrix/webext-messenger#43 |
This last commit seems to have finally resolved the issue I was having. I will have to keep testing and then clean the PR. ✅ 🥳 Repro for future reference
if you close the sidebar, it works correctly: |
Closing for now. I'll focus on making the messenger more debuggable first: |
Not ready for review
Second part to:
Related/included:
Questions:
"sidebar"
target name:To do: