Shane O'Sullivan's technical blog… really ties the room together

Firefox 3 has proper modal dialogs!

Posted by Shane O'Sullivan on June 25, 2008

The application I work on for my employer makes extensive use of modal dialogs in Internet Explorer.  These are a nice feature where you can load a page in a dialog box, and the user cannot access the parent window until the dialog has closed – this includes forward/back buttons, menus, everything.

An issue we have had with supporting Firefox 2 is that it doesn’t support modal dialogs.

It seems to have completely been missed by the Firefox 3 fanboys, but Firefox 3 supports modal dialogs.  See my previous post on tips on how to use them.  This is a very very cool thing which I’m sure many people will find use for.  There aren’t many examples of modal dialog use around, since up until now it was IE-specific, but hopefully it’ll become much more popular.

The Mozilla team seem to have simply copied the window.showModalDialog function exactly from Microsoft, so any code previously used to open modals in IE works just fine in FireFox 3.

You’ve got to love open source: out-innovating the proprietary guys 99% of the time, then copying whatever you missed 🙂

Update: I’ve confirmed that in FireFox 3 modal dialogs, unlike in IE, when you click a hyperlink the resulting page will correctly open in the dialog, and NOT open a new window.  This makes them infinitely more useful, and should negate the need for the horrendous hacks that IE forces on people.


12 Responses to “Firefox 3 has proper modal dialogs!”

  1. Gigel Plancton said

    You’ve got to love open source: out-innovating the proprietary guys 99% of the time, then copying whatever you missed.

    I think you mean: copying the proprietary guys (Opera) 99% of the time then copying whatever you missed.
    (Firefox 3).

  2. Well, no, but you’re entitled to your opinion 🙂

  3. DiSiLLUSiON said

    The use of modal dialogs isn’t cool. In fact, in my opinion, it’s a bad thing when you interrupt the workflow of the user for something or the other; the users needs to make a decision *now*, instead of *later*; you are in effect forcing the user to take action when he/she was doing something else. Of course, not *every* use of the modal dialog is evil, but 99% of the times it’s used, it is.

    I think it’s strange Firefox 3 now has support for modal dialogs, when they acknowledge the bad practices usually associated with them, and have worked hard to minimize the use of modal dialogs in the program itself. For example; in version 2 you absolutely *had* to choose to save a username/password combination or not, even though you didn’t yet know if the combination worked. Also; when you installed an extension, you immediately had to decide whether to trust the website providing it. In version 3, you can (when the information bar pops up) Google the website to gather information about the trust-worthiness of that particular site.

    Most software can be redesigned easily to (almost) completely eliminate the use of modal dialogs. This enabled the user to have a multi-threaded workflow and be more productive.

    However, even though it will probably be misused most of the time, it’s nice the ability is there for when it’s really, absolutely, positively needed.

  4. We use modal dialogs quite extensively, and they greatly improve the clarity of flow through the application. There are many times when, in an enterprise application, there IS only one path through a particular series of pages, and modal dialogs are a good fit for this.

    However, I of course don’t recommend using them everywhere – we mostly advocate their use for confirmation dialogs, or for filling in a single form, submitting it and returning to the parent page.

  5. window.showModalDialog is now part of the HTML5 spec:

  6. @Mark, even better! Nice to know Firefox is still following the HTML5 specs closely

  7. rt said

    Modal dialogs cool? Sure, I am fully allright with some retarded script taking over my whole browser…

    Thank you, you’d better stay in your IE world. You seem to make a perfect pair, the two of you.

  8. Rt, that really is quite childish, please keep comments civil.

  9. Brett Carlock said

    Can anyone tell me how to change the password manager back to Modal in Firefox3? It’s quite obnoxious to have the whole page redrawn repeatedly just to show the confirm/later/deny dialog, especially under OS/2 which has a rendering issue with Firefox.


  10. Kaitnieks said

    This is excellent! I’m going to have to port an old and quite big web app from IE-only to IE and FF supported. If FF3 has modal dialogs, it makes my job much, much easier.

  11. Dave said

    I think the hostility towards modal dialog boxes is a bit misplaced. As a web application developer and not really a web “site” developer, maybe I’m approaching this from a different perspective, but modal dialog boxes are essential to usability. Nobody would suggest taking modal dialog boxes out of desktop applications so why wouldn’t we want them in web apps? People seem to be assuming that they will be abused. I agree that the threat is there, but now that most applications are web-based we need to start making jumps toward improving usability. Modal dialogs are a big step in that direction. I’m really glad Firefox supports this now.

  12. IRSHAD ALI said

    It open the Modal Dialog in the firefox but modal dialog in firefox does not return value. is there any possibility to get the modal dialog return value in firefox.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: