showModalDialog does not honor center and resize options




9 years ago
5 years ago


(Reporter: angelo.borsotti, Unassigned)


Firefox Tracking Flags

(Not tracked)




9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100316 Firefox/3.6.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100316 Firefox/3.6.2

window.showModalDialog can be told to center the dialog
on the desktop and to make it non-resizable. However,
these options do not produce the intended result.

Reproducible: Always

Steps to Reproduce:
1. take the example page from
2. add resizable: no; center: yes to the last argument of window.showModalDialog
3. open the page in the browser, and click on the button
Actual Results:  
a dialog is displayed at the top left of the deskop. The dialog can be resized.

Expected Results:  
the dialog placed at the center of the desktop, not resizable.
I believe that we don't allow untrusted content to set those features by default; this applies to all window opening, not just modal dialogs.  Or do those features work with

Comment 2

9 years ago
These are the arguments to the window.showModalDialog function call, see:
This page tells what arguments this function supports, and does not
mention that some are allowed only by some kind of content.
As a matter of fact, the width and height can be specified, and they
function properly. There are no reasons then that the centering could
instead be restricted to some content.
Centering is told to be the default too.
See Also: → bug 404668
You need to log in before you can comment on or make changes to this bug.