Closed Bug 1453969 Opened 7 years ago Closed 7 years ago

Closing windows containing only about:home triggers permitUnload code

Categories

(Firefox :: Tabbed Browser, enhancement, P2)

enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: florian, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [fxperf:p2])

To try to reproduce bug 854464, I opened 30+ windows, without loading anything specific in them so they all had about:home. When I was done, closing them all was pretty janky. I noticed in the profile that we were spending more than 700ms in permitUnload, which doesn't seem needed when closing about:home tabs (and activity stream doesn't seem to register any beforeunload listener). https://perfht.ml/2ISGiRH
Interestingly, if I open a new tab at about:newtab, and (with that new tab selected) put this into the Browser Console: gBrowser.selectedBrowser.frameLoader.tabParent.hasBeforeUnload I get true. So _something_ is setting a beforeunload event handler in that tab.
Priority: -- → P2
Whiteboard: [fxperf] → [fxperf:p2]
This is a result of Onboarding.jsm (ftr, easiest way to check is to just open about:newtab/about:home, open the devtools inspector, click the [event] blob next to the <html> node). I don't really know why this uses beforeunload - I suspect we can port this to an `unload` event without too much trouble, as the Onboarding.jsm doesn't go away even if the page (and maybe the instance?) does go away, as long as we make sure the XHR/Fetch/Telemetry is rooted in something that doesn't go away.
This works now - hasBeforeUnload is false, the listener isn't there in the document - I assume as a result of bug 1462415. \o/
Status: NEW → RESOLVED
Closed: 7 years ago
Depends on: 1462415
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.