Closed Bug 307003 Opened 19 years ago Closed 19 years ago

window.open("about:blank",'foo','modal') does not produce a modal dialog

Categories

(SeaMonkey :: Preferences, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 197351

People

(Reporter: danswer, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050620 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050620 Firefox/1.0+

The code below does not produce a modal dialog.  It only produces a dependent
window as stated here:
http://developer.mozilla.org/en/docs/DOM:window.open#Window_functionality_features
which refers to Bug 180048

However, I believe this is misguided.  There is no specific reason given as to
why it's bad (for user initiated script) to allow modal dialogs.  The only
reason that I've seen (or experienced in prior browsing) is that it's possible
for a less than pleasant site to prevent you from getting back to the main
browser and close that window, navigate on, whatever.  However, this has been
obviated by browsers which only allow popups based on user initiated action.

On the other hand, as mentioned in comment 17 in Bug 180048, there is a high
utility in being able to do modal dialogs for web apps (specifically, settings.
 For example, I'm writing a web app for family trees.  When you add a new
person, you should fill in details.  This is a perfectly normal, natural, and
reasonable thing to do with a modal dialog).

Asking users to authorize a change (as in comment 18) is not encouraging,
because most users, have no idea what they are actually agreeing to (for
example, when you agree to a lot of the stuff that Microsoft wants to do with
your machine on an automated basis (e.g. updates, installs), you are actually
agreeing to give them license to disable functionality if they suspect that you
are not using your machine per their norms.  And all the time, I am getting
popups saying this or that Certificate has expired - do I want to go ahead and
trust it anyway?  How do I know what I'm really saying yes to???) - in this kind
of world, who wants to agree to things when they have no idea what they are
really agreeing to?

A modal dialog is a popup where you can't get to the underlying window unless
you close the popup.  That simple (for the user).  Marginally more complicated
because you can't close the underlying window first, but what's the big deal? 
It's not like you can get another modal dialog (or any popup for that matter)
without taking additional user action.  I'd like to suggest that modal dialogs
be allowed again per window.open(..., ..., 'modal'), or at least a convincing
case be made for why it can't be allowed when popups are.  I suspect the old
'fix' in bug 180048 was made before this notion of disallowing popups unless by
user initiated action, and hence is an historical artifact.

Also, I would support being able to click on the upper right close button and
even the upper left button to close the underlying main window and the modal
dialog with it.  In fact, I would say that is a good thing even when alerts and
other modal dialogs are up.

Csaba Gabor from Vienna

Reproducible: Always

Steps to Reproduce:
<button onclick="window.open('about:blank','foo','height=400,width=600,modal')"
        accesskey=n><u>N</u>ew modal window</button><br>
<a href="http://yahoo.com">test while modal</a><br>
<button onclick="alert('hi mom')" accesskey=c><u>C</u>lick while modal</button>

Actual Results:  
1.  Once I clicked on the upper button, while the dialog was up, I was able to
click on the link and also the lower button.

2.  In a separate experiment, first I clicked on the New modal window button,
then I closed the popup window (with ctrl+w), and then I clicked on the New
modal window button again.  This second click did not yield a popup.  That seems
like a bug, too.

Expected Results:  
1.  I should have gotten a modal window

2.  I should have gotten the second popup

*** This bug has been marked as a duplicate of 197351 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.