-
Notifications
You must be signed in to change notification settings - Fork 2
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
New named targets solution + add some notes/docs #53
Conversation
This solution has advantages over the previous one:
|
I read over the notes, I think the approach makes sense to try. A couple thoughts/questions:
|
If you know the frame ID, then you don't need the page name, As we verify and expand this feature, we could also add UUID-based targets, e.g.
That would only work between extension pages, but this PR’s solution is mainly for direct brick -> frame communication. If we notice a large delay between retries we can consider this implementation, but I think it's easier to just reduce the delay. |
I'll address this in a future PR, after this solution is confirmed to work and merged into PB |
Will merge and release as 0.15 since it was merged in PB 🚢 |
New attempt at implementing:
The logic has been linearized as much as possible here and in the past PR, but it's still a bit hard to follow and reason about because there are so many small things to consider. I added some (partial) notes to
docs/notes.md
in this PR.In short:
frame: 0
or some other sub-frame.This is what happens specifically in the latter part, for example:
Here I just spread the messages a little bit to highlight the "race condition" but in reality things will probably be faster, i.e. the sidebar will already know
whoAmI
at the first message.Missing from this PR
{page: "action.html"}
from the content script should be handled in the same tab{frameId: 0}
message so that the sidebar can message the top frame directly