Open Bug 1493643 Opened 6 years ago Updated 2 years ago

window.open creates an initial about:blank window twice

Categories

(Core :: General, enhancement, P3)

enhancement

Tracking

()

Performance Impact low
Tracking Status
firefox64 --- affected

People

(Reporter: Gijs, Unassigned)

References

(Blocks 1 open bug)

Details

This affects tpaint. Effectively, what happens is: - nsWindowWatcher::OpenWindowInternal creates the window - (cached, because the new window is same-process with its opener) frame scripts run, touching content (bug 1471327 and friends), forcing an about:blank window to be created - nsWindowWatcher::OpenWindowInternal continues running, and this code: https://searchfox.org/mozilla-central/rev/0640ea80fbc8d48f8b197cd363e2535c95a15eb3/toolkit/components/windowwatcher/nsWindowWatcher.cpp#1086 sets the principal of the about:blank window, and to do that, re-creates the about:blank content viewer. The comment says that "this is safe to call multiple times". That might well be true, but doing the work twice is wasteful... Longer-term, we could also look at whether we can avoid creating about:blank if the originating document doesn't pass a (non-special, ie not "_blank") window name and passes a non-principal-inheriting URI and doesn't use the return value - but that's a harder problem.
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p3:f67]
Priority: -- → P3
Whiteboard: [qf:p3:f67] → [qf:p3]
Performance Impact: --- → P3
Whiteboard: [qf:p3]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.