Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox 2.0 should re-implement modal window.open to support Web 2.0

24 views
Skip to first unread message

Casper van Dijk

unread,
Oct 13, 2006, 10:54:03 AM10/13/06
to
This is a plea to re-implement the option to show modal windows, using
window.open(), from inside untrusted script.

This feature was disabled in 2002, when annoying pop-ups were a hot topic.
See the discussion in the Mozilla documentation on modal in window.open:

https://bugzilla.mozilla.org/show_bug.cgi?id=180048

Now, it is 2006, and Firefox is not only used to display webpages, but also
to run applications.

Any client application (RIA, AJAX or plain old binary, whatever the
platform) at some point will require modal dialogs, to halt workflow until
the user provides feedback.

Of course there are workarounds - using signed script and other ways to get
increased privileges. These are not mainstream, and the avarage user shuns
sites that require these.

Alternatively, I could live with a solution that allows window.open(.,
'modal') for websites that are inside the 'allowed sites' list for 'popup
windows'.

In my opinion, if Firefox 2.0 does not support this feature, many future web
applications will become 'IE only', again.

Regards,

Casper G.C. van Dijk, PhD

--

Message crossposted to mozilla.dev.apps.firefox and forums.mozillazine.org

Sorry for the 'Web 2.0' buzzword in the subject line - it is there to
attract attention only.

I know Fx RC2 is out and I am pretty late, but I would love to hear to whom
I should send this plea to get it to the right people.


Gervase Markham

unread,
Oct 16, 2006, 11:11:24 AM10/16/06
to
Casper van Dijk wrote:
> Now, it is 2006, and Firefox is not only used to display webpages, but also
> to run applications.
>
> Any client application (RIA, AJAX or plain old binary, whatever the
> platform) at some point will require modal dialogs, to halt workflow until
> the user provides feedback.

Cover your entire UI with a 50% opacity transparent PNG, then put a
<div>-based messagebox with the question on top of that. The user can't
do anything except answer your question.

Gerv

Casper van Dijk

unread,
Oct 16, 2006, 12:29:22 PM10/16/06
to
Your solution works great for user interaction, but unfortunately that is
only
half the problem. The other half is controlflow depending on modal dialogs:

var name = "Joe";
if (IDYES == ShowModalDialog("happy now?", IDYESNO))
alert(name + " is happy");
else
alert(name + " is not happy");

Without the window.open(..., modal) functionality, JavaScript will not halt
processing, and show one of the alerts before the user makes a choice.

Of course I could move the remainder of the code to a dialog onclose event
(somehow retaining the 'name' variable). For an existing complex application
splitting all code into a piece 'before' and a piece 'after' is simply not
feasible.

Support for window.open(..., modal) will determine whether 5% or 50% of
my users run my app inside Firefox. Really. If anyone knows of a better
suited
place (group, blog, forum) to make this point, please let me know..

Casper

"Gervase Markham" <ge...@mozilla.org> wrote in message
news:hMmdna9A_4SCPK7Y...@mozilla.org...

news.mozilla.org

unread,
Nov 6, 2006, 12:29:57 PM11/6/06
to
Gervase Markham ha scritto:

> Casper van Dijk wrote:
>
> Cover your entire UI with a 50% opacity transparent PNG, then put a
> <div>-based messagebox with the question on top of that. The user can't
> do anything except answer your question.
>
> Gerv

If the need for a modal dialog box was simple enough to request a custom
Yes/No/Confirm window (or similar) the problem will not exist at all.

There are web applications having complex dialog boxes (modal windows),
performing posts and reloading their contents; using a <div> to frame
such dialogs is not so easy (expecially if you think that lots of this
applications were developed before FF2 was released, and working fine
with FF1.5 and ... other browsers).

If the message from the guys from mozilla is "you must redesign your
application" I think I'll say my customers to change browser...

I did some tests with modal windows, and I see that most important
differences between FF2 and FF1.5 are the follows:


1) the feature to bringing in front an opened window: I see that FF2
default javascript settings (options/content/enable javascript ->
advanced) is "off", but in FF1.5 was "on".


2) the only (ugly) solution I found to let FF2 use the "modal" feature
of window.open() is to use the 'UniversalBrowserWrite' privilege;
according to pre-FF2 documentation, there was no need to use such kind
of privilege to use this feature; anyway with FF2 adding the following
line before calling window.open() (with both 'modal=1' and 'dialog=1'
features)

netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');

modal windows works fine; I said before that this is a ugly solution
because when executing this line of script, FF2 prompt the user to allow
or deny the privilege setting (the dialog box message it's not so clear
for a very 'basic' user)

Also this dialog contains a very dangerous checkbox for "remembering the
choice": if the user say "remeber" and then "allow" this dialogbox will
disappear forever and everything will work fine; but if the user checks
"remember" and then "deny" the dialogbox will disappear forever and the
code (enablePrivilege) will never be executed (another good question
could be: is there any way to reset this setting?)

I hope to get a *good* 'workaround' from people at mozilla as soon as
possible.


ball...@yahoo.com

unread,
Nov 9, 2006, 8:47:28 PM11/9/06
to

Seems to me there are too many folks focusing on the past and failing
to consider the future of Internet Applications.

Add me to that list of developers wanting a quick resolution to this [
or a return to the way it was in previous versions ].

Dotan Dimet

unread,
Nov 28, 2006, 8:04:08 AM11/28/06
to
The div-based pop-up window is actually much more usable for obtrusive
advertising or spam than it is for application programming (for
example, opening another URL as a modal dialog).
Yes, you can fake window.open() with AJAX and some ingenuity, but
you're re-implementing stuff that was basic web app infrastructure 8
years ago.
0 new messages