Decouple Page and Runtime domains
Categories
(Remote Protocol :: CDP, task, P3)
Tracking
(Not tracked)
People
(Reporter: impossibus, Unassigned)
References
Details
(Whiteboard: [puppeteer-beta2-mvp])
Methods in the Page domain make use of Runtime._onContextCreated, for example.
See https://phabricator.services.mozilla.com/D55334#inline-341952:
I wonder instead if we could somehow make this emit an event per-world-to-evaluate for the ContextObserver to use, so that context-created events are created in just one central location and avoids the tight coupling between Page and Runtime?
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Both domains would have to listen for the internal context-created
events instead. With the work on bug 1593226 we will get a ContextObserver singleton per session, both domains can listen for.
Comment 2•5 years ago
|
||
Also right now we have a couple of observers registered for the ContextObserver inside the framescript, which means for each and every tab:
https://hg.mozilla.org/integration/autoland/file/tip/remote/observers/ContextObserver.jsm#l59
I think this is complete overhead and should really be done only once in the parent process. Especially seeing Fission coming up. But at the same time when checking the Fission documentation I can see that JSWindowActor also allows you to register for observer notifications:
Olli, do you know which kind of observers those are? Do we have content specific ones that would have to be registered per JSWindowActorChild? What about the webnavigation-create
one? Thanks!
Comment 3•5 years ago
|
||
I don't know what JSWindowActor observe() is for.
Alphan might know.
Comment 4•5 years ago
|
||
Olli, do you know which kind of observers those are? Do we have content specific ones that would have to be registered per JSWindowActorChild? What about the webnavigation-create one? Thanks!
Hello John,
could you help to answer this?
Comment 5•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #2)
Also right now we have a couple of observers registered for the ContextObserver inside the framescript, which means for each and every tab:
https://hg.mozilla.org/integration/autoland/file/tip/remote/observers/ContextObserver.jsm#l59
I think this is complete overhead and should really be done only once in the parent process. Especially seeing Fission coming up. But at the same time when checking the Fission documentation I can see that JSWindowActor also allows you to register for observer notifications:
Olli, do you know which kind of observers those are? Do we have content specific ones that would have to be registered per JSWindowActorChild? What about the
webnavigation-create
one? Thanks!
We don't have content specific ones to allow register per JSWindowActor, but I think you can have your own JSWindowActor which can observe webnavigation-create
.
Comment 6•5 years ago
|
||
(In reply to John Dai[:jdai] from comment #5)
We don't have content specific ones to allow register per JSWindowActor, but I think you can have your own JSWindowActor which can observe
webnavigation-create
.
Right, but I'm not particularly interested to register for the same observer notification in each and every client actor. So I basically wonder why we have that feature, and if it maybe has to be used with caution for global observer notifications. Maybe a warning should be put on https://firefox-source-docs.mozilla.org/dom/Fission.html?
Comment 7•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #6)
(In reply to John Dai[:jdai] from comment #5)
We don't have content specific ones to allow register per JSWindowActor, but I think you can have your own JSWindowActor which can observe
webnavigation-create
.Right, but I'm not particularly interested to register for the same observer notification in each and every client actor. So I basically wonder why we have that feature, and if it maybe has to be used with caution for global observer notifications. Maybe a warning should be put on https://firefox-source-docs.mozilla.org/dom/Fission.html?
It's because JSWindowActor is lazily instantiated, some JSWindowActor needs to be instantiated when it received observer notification, ex: AudioPlayback[1]. I think it's worth putting a warning to notice user use with caution. :)
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•2 years ago
|
Description
•