BrowserWindowTracker assumes Browser:Init messages only ever come from foreground windows

RESOLVED FIXED in Firefox 64

Status

()

P1
normal
RESOLVED FIXED
5 months ago
5 months ago

People

(Reporter: Gijs, Assigned: Gijs)

Tracking

Trunk
Firefox 64
Points:
---

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 months ago
(Spotted when looking at about:blank creation stuff forced by BrowserWindowTracker getting the outerWindowID on a parent-process browser when creating a new window, which will call contentWindow.windowUtils.outerWindowID, which forces creation of the about:blank window)


Browser:Init messages are sent when browser-child.js loads, for any frame.

The code in BrowserWindowTracker checks that the browser is the selected browser in that window, but if so it'll unconditionally update the 'current toplevel window' outerWindowID. This is stored by netwerk/ code in a single parent process static var, so messing with it in this way seems... wrong.

We should also check that the window is the toplevel window.
(Assignee)

Updated

5 months ago
Priority: -- → P1
(Assignee)

Updated

5 months ago
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
(Assignee)

Comment 2

5 months ago
Created attachment 9012136 [details]
Bug 1493628 - only update the 'current' outerWindowID when the browser window is the foreground window, r?dao
(Assignee)

Comment 3

5 months ago
It seems it also makes this assumption for all the other callers that update the 'current' outerWindowID, e.g. tab selects in background windows or opening minimized windows will also throw off this code...
Blocks: 1366822
Comment on attachment 9012136 [details]
Bug 1493628 - only update the 'current' outerWindowID when the browser window is the foreground window, r?dao

Dão Gottwald [::dao] has approved the revision.
Attachment #9012136 - Flags: review+

Comment 5

5 months ago
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/513ebcc0f395
only update the 'current' outerWindowID when the browser window is the foreground window, r=dao

Comment 6

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/513ebcc0f395
Status: ASSIGNED → RESOLVED
Last Resolved: 5 months ago
status-firefox64: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in before you can comment on or make changes to this bug.