Closed Bug 15014 Opened 21 years ago Closed 21 years ago

Popup windows affect persistent window size


(SeaMonkey :: General, defect, P3)

Mac System 8.5


(Not tracked)



(Reporter: sfraser_bugs, Assigned: davidm)




Go the URL above, and delight in the wonderful things it brings.
Now close all the windows, leaving a small one until last.
Now open a new browser window. Note that it comes up small, taking its size
from the last window closed (which was a popup window).

This is wrong; we should never store size data for popup windows, because the
user has not specified their size.
Assignee: davidm → waterson
reassign to waterson since there needs to be a way to say don't make this window
persistant. I am not reallyw to tell something is a popup either but I'll worry
about that after we have a way to disable persistance.
Assignee: waterson → davidm
davidm: _nothing_ persists by default. you need to explicitly tell XUL to
persist attributes (see the "persist='...'" in navigator.xul). so i'm pretty
sure that this is a problem with the core persistence implementation. cc'ing
law, who did the original navigator.xul persistence stuff.
Sorry I should have been clearer. A popup window is a browser window. Nothing
more, nothing less. So for some browser windows we need persistance. For others
we don't.
right, but the persistence stuff is added for _every_ navigator.xul window,
because "persist='width height x y'" is set on the 'window' tag in that file.
You don't need to do that. You can decide which windows you should persist the
size information for, and for those windows, call document.persist() with the
ID of the window tag and the name of the attribute you want to persist. Do this
in your "onunload" handler.

Sorry about the lack of documentation. For now, see
Closed: 21 years ago
Resolution: --- → DUPLICATE
I'm closing this as a dup of bug #13208.

There's some discussion there, but my current theory is that we need to
distinguish windows opened by the user from those opened by spam-spewing web
pages (no offense).  My plan was to add a property to browser windows that
indicates whether it should save the window size when it is closed.  This
property would be false by default and set from navigator.js code that opened
new windows.

The only thing that stopped me from implementing this fix immediately was that
the initial browser window is opened from C++ and I didn't know how to set this
property from there (I'm sure it's possible one way or another).  So I don't
think this requires some major architectural/design work, just a little bit of

BTW, if one were to do something like:
  var newWindow = window.openDialog( "chrome://navigator/content/", ... );
  newWindow.document.getAttributeById( "main-window" ).removeAttribute(
"persist" );
would that automatically prevent changes to persistent attributes on that
element from being persistent without affecting other instances of the same xul
document?  If that works, then this simplifies things because we can thus use
the DOM apis to change the "property" of the window (from C++).

*** This bug has been marked as a duplicate of 13208 ***
Yes, removing the 'persist' attribute should work like you'd expect. If it
doesn't open a bug on me.
Looks like a dup.  Marking VERIFIED.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.