Open
Bug 485688
Opened 16 years ago
Updated 4 years ago
Closing a tab dispatches a load event to the browser
Categories
(SeaMonkey :: Tabbed Browser, defect)
SeaMonkey
Tabbed Browser
Tracking
(Not tracked)
NEW
People
(Reporter: mossop, Unassigned)
References
Details
This is not so much a bug as an oddity in how the tabbrowser works that might be tripping up people. It tripped me up in bug 480752. The issue is that when a tab is closed the browser element isn't actually destroyed. Instead it has about:blank loaded into it. This means that anything that has added a load event listener to the browser sees the load. I imagine a lot of the time this will be harmless, maybe only causing some unnecessary work. I guess you need to load about:blank to get rid of plugins etc in the existing page so I'm not sure if there is a way around this anyway.
Comment 1•16 years ago
|
||
(In reply to comment #0) > I guess you need to load about:blank to get rid of plugins > etc in the existing page so I'm not sure if there is a way around this anyway. The first question would be: how does Firefox handle this ?
Reporter | ||
Comment 2•16 years ago
|
||
(In reply to comment #1) > (In reply to comment #0) > > I guess you need to load about:blank to get rid of plugins > > etc in the existing page so I'm not sure if there is a way around this anyway. > > The first question would be: how does Firefox handle this ? Firefox doesn't keep the browser around, it just destroys it when it is removed.
Comment 3•16 years ago
|
||
For reference: See http://hg.mozilla.org/comm-central/annotate/054adad6539d/suite/browser/tabbrowser.xml#l1478 for the why. Firefox uses nsSessionStore to implement this feature. I guess at that time it was not possible to use the same implementation as Firefox as SeaMonkey was using xpfe/ at that time. But I'm not sure about that.
![]() |
||
Comment 4•16 years ago
|
||
Neil, any idea what we can do to at least get those event listeners detached or so when we're closing those tabs?
Comment 5•16 years ago
|
||
Perhaps we could temporarily add a capturing event listener to the window to stop the propagation of the load event? Unfortunately that would only help people not already capturing load events on the window. There is a proposed API that we would in time be able to use to enumerate and remove such event listeners so that nobody would ever know about that load event. On the other hand, maybe we could do something underhand such as pushing the existing document into bfcache using document.open() but never actually closing the document thus forestalling the possibility of a load event...
![]() |
||
Comment 6•16 years ago
|
||
You can't call document.open() from chrome on a content document on trunk, for security reasons.
![]() |
||
Comment 7•15 years ago
|
||
I don't see any reason to give this special priority, but it's also not unwanted, so cancelling the wanted flag.
Flags: wanted-seamonkey2.0?
You need to log in
before you can comment on or make changes to this bug.
Description
•