Update browser's outerWindowID via the WindowGlobalParent rather than the Browser:Init message
Categories
(Toolkit :: UI Widgets, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox79 | --- | fixed |
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
Attachments
(2 files)
The outerWindowID is already synced with the parent via WindowGlobalParent. Update the field in browser-custom-element.js to use this instead of using a separate message.
| Assignee | ||
Comment 1•5 years ago
|
||
There are also some other listeners of Browser:Init:
- BrowserWindowTracker.jsm
- tabbrowser
- TargetList seems to think browser.browsingContext could be null and waits for Browser:Init. I'm not sure that's actually possible.
One additional note:
In tabbrowser.js, there is a map '_outerWindowIDBrowserMap' that maintains a map of content outer window ids to browser elements. This is updated via a message that is sent on each framescript load in the content process and a bunch of hard-to-follow places throughout tabbrowser.js.
However, it seems that there are only two consumers of this map:
-
The Payments UI at [1] looks up the browser element by outer window id to determine which browser to associate the payments ui with. I suspect this UI isn't actually wanting to be dependent on the outer window id (which can be the same for entirely different pages), but would be page specific. However the payments code seems to pass around the outer window id throughout its code.
-
about:devtools uses the map to determine which tab was last opened so that it can go back to it when closing about:devtools.
Since neither of these cases are particularly common, I just got rid of this map, and replaced it with just iterating over the tabs and comparing browser.outerWindowID to the desired window id on an as-needed basis.
| Assignee | ||
Comment 2•5 years ago
|
||
The map is only used by payments and about:devtools.
| Assignee | ||
Comment 3•5 years ago
|
||
Depends on D79608
Comment 5•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/758831c2e097
https://hg.mozilla.org/mozilla-central/rev/660432a1429d
Description
•