As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 981796 - Remove window.showModalDialog
: Remove window.showModalDialog
Status: NEW
See comment 25, 26 [platform-rel-Micr...
: addon-compat, compat, dev-doc-needed, site-compat
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86_64 All
: -- normal with 10 votes (vote)
: ---
Assigned To: Blake Kaplan (:mrbkap)
:
: Andrew Overholt [:overholt]
Mentors:
: 1306169 (view as bug list)
Depends on: dialog-element 789261 1031945 1137025 1234700
Blocks: 1208703 1253030 1077002 1257626
  Show dependency treegraph
 
Reported: 2014-03-10 12:56 PDT by Eric Seidel
Modified: 2016-11-03 03:12 PDT (History)
41 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
?


Attachments
Patch to disable (1.16 KB, patch)
2015-02-25 18:02 PST, Blake Kaplan (:mrbkap)
no flags Details | Diff | Splinter Review

Description User image Eric Seidel 2014-03-10 12:56:09 PDT
Chrome plans to remove window.showModalDialog from Chrome M35:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/xh9fPX0ijqk/ixHZCOH6GLgJ

It looks like you all plan to remove it:
https://developer.mozilla.org/en-US/docs/Web/API/Window.showModalDialog
but I didn't see a bug on file.
Comment 1 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-03-10 14:33:31 PDT
Yes. Our plan is definitely to remove this. We've been sending out deprecation warnings since Firefox 28.

We *might* need to get telemetry data from Gecko in order to catch browser-specific code paths, but I'm not sure if we'll wait for that or not.
Comment 2 User image Boris Zbarsky [:bz] (still a bit busy) 2014-03-10 14:34:54 PDT
I don't think we should be removing this until Chrome has shipped their removal and we've had a chance to see what the response is, at the very least.
Comment 3 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-03-10 14:45:46 PDT
I'm ok with waiting for that yeah (we've been doing our fair share of going first with potentially-webcompat-breaking-changes lately).

However we could also just land an implementation that enables preffing this on/off and flipping that pref to off. That way we can easily pref back on even on later branches if it turns out Google runs into too much trouble.
Comment 4 User image Boris Zbarsky [:bz] (still a bit busy) 2014-03-10 14:48:33 PDT
The "dom.disable_window_showModalDialog" preference exists.  It doesn't hide the API (that would depend on bug 789261), so it would fail object-detection stuff for people who want to use showModalDialog if available but fall back to something else if not, but it does make the API throw when called.  So flipping that pref is strictly less web-compatible than removing the API altogether, I guess. ;)
Comment 5 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-03-10 15:09:14 PDT
Yeah, I think we need the pref to hide the API as well. According to the thread in comment 0 there are pages that feature detect the API (and I seem to recall that being the case when we first implemented the API too).
Comment 6 User image Eric Seidel 2014-03-14 11:52:47 PDT
crbug.com/345831 is the Chrome bug on the subject.
Comment 7 User image :Ehsan Akhgari 2014-03-14 12:48:51 PDT
Should we write a hacks blog post about the upcoming removal or something?  Blink got into some trouble because of lack of enough communication on this.
Comment 8 User image Boris Zbarsky [:bz] (still a bit busy) 2014-03-14 13:28:04 PDT
We should, imo, start with telemetry, just to avoid crying wolf.
Comment 9 User image Olli Pettay [:smaug] (review request backlog because of a work week) 2014-03-17 14:27:42 PDT
Yes, some telemetry, hopefully for FF31 (which will be an ESR too), and perhaps remove
in FF32.
If we get WebIDL-fied Window for FF32, disabling SMD would be rather simple.
Comment 10 User image Mathias Bynens 2014-03-27 08:00:59 PDT
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #7)
> Should we write a hacks blog post about the upcoming removal or something? 
> Blink got into some trouble because of lack of enough communication on this.

FWIW, we (at Opera) just published such a blog post: http://dev.opera.com/articles/view/showmodaldialog/ It refers to this bug ticket. Let me know if any Firefox-specific info is missing and I’ll happily add it.
Comment 11 User image :Ehsan Akhgari 2014-03-28 10:24:25 PDT
(In reply to comment #10)
> (In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment
> #7)
> > Should we write a hacks blog post about the upcoming removal or something? 
> > Blink got into some trouble because of lack of enough communication on this.
> 
> FWIW, we (at Opera) just published such a blog post:
> http://dev.opera.com/articles/view/showmodaldialog/ It refers to this bug
> ticket. Let me know if any Firefox-specific info is missing and I’ll happily
> add it.

That's a great blog post!  Thanks for making it.
Comment 12 User image Justin Dolske [:Dolske] 2014-07-16 19:20:15 PDT
I'm so happy to see this dialog going away!

If it ends up being difficult to just dump it... Another possibility I had discussed with someone a long time ago was to put it behind a permission prompt / popup blocker. If a site wants to use it, the user would have to allow/whitelist it. (This was motivated by showModalDialog having potential for being user-hostile, but supposedly being necessary on unknown intranet sites.)
Comment 13 User image Marco 2014-09-09 02:28:49 PDT
Hi there,

we're developers of a huge business app and we absolutely need modal dialogs. 
With Chrome 37 we got in big trouble, because we had to tell the users to switch browsers.

Please give us at least a user option, so our users can work with modal dialogs.

Marco
Comment 14 User image naholyr 2014-09-09 02:40:33 PDT
I don't get how you could not easily replace any modal dialog by a pop-in + iframe.

IMHO it's far from a web-breaker update…
Comment 15 User image Marco 2014-09-09 03:06:37 PDT Comment hidden (off-topic)
Comment 16 User image Masatoshi Kimura [:emk] 2014-09-09 04:42:33 PDT
Marco, Chrome has a Group Policy setting to enable showModalDialog for ease of the transition.
http://www.chromium.org/administrators/policy-list-3#EnableDeprecatedWebPlatformFeatures
Note that it will be removed eventually.
Comment 17 User image Marco 2014-09-09 04:57:37 PDT
Thanks Kimura, we read it, but we are to stupid to get it to work.
And we're suppose our customers (non IT folks, just SaaS-Users) are too.
Comment 18 User image Alexey Lakutin 2014-09-09 05:44:27 PDT
Marco, this setting does work only for PC in domains.
This reg-file works in domain for me:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Google\Chrome\EnableDeprecatedWebPlatformFeatures]
"1"="ShowModalDialog_EffectiveUntil20150430"
Comment 19 User image Marco 2014-09-09 05:53:42 PDT
Hi Alexey,

thanks a lot. Our windows customers are no problem - they just switch to IE (most of them are not in domains, just simple Cloud-solution-users). More a problem are the mac users. But Safari 7 is quite good, so we told them to switch to. (its a lot easier to tell them to switch browser then to tell them to install the business admistration toolkit required for the chrome option)


I just hope, with Firefox doesn't happen the same. So I'm begging to leave this function in or if it really should be removed to provide an option for the user to activate it again.
Comment 20 User image Olli Pettay [:smaug] (review request backlog because of a work week) 2014-09-09 06:26:03 PDT
We don't have particular hurry to remove showModalDialog from Firefox as comment 2 hints.
In Blink showModalDialog does cause certain technical issues which we don't have in Gecko.
(I wonder if Webkit has the same issues as what Blink has.)
Comment 21 User image Miiiiichal 2014-09-16 01:30:01 PDT
Hi,

we have the same problem as Marko. Modal dialogs are very important in business apps to interact with users. In some cases synchronous processing is needed and we cannot replace it with asynchronous one. The other thing is that replacement of showModalDialog function needs a lot of time.

MJ


Ps. What is wrong with showModaldialog on Android - it doesn't work!
Comment 22 User image Florian Bender 2014-09-16 02:23:52 PDT
There's now the <dialog> element which can be used for modal dialogs. There's also a polyfill for browsers that do not implement the element yet. Check out demo.agektmr.com/dialog/ for further info and the WHATWG HTML5 spec for … the spec!

There is no reason showModalDialog() is needed at all. Even if you don't use the <dialog> element, the functionality can be achieved with a simple JS library.
Comment 23 User image Marco 2014-09-16 02:45:18 PDT
Florian, we tried every suggestion so far. But there is no replacement for modal dialogs. Neither the <dialog>-element nor any js library.

It's just that simple. I need a function

sVal = gsGetValueFromUser() 

which opens a html page of my choice and gets back a result.

No callbacks, just a function with a result. 
And without showModalDialog() there is no way, you can do it.


No callbacks, because we use such functions in loops, in libraries and in nested calls. And callbacks would destroy the clean structure of this code. (which in our case runs for tens of thousends of users for 15 years)
Comment 24 User image Miiiiichal 2014-09-16 03:51:11 PDT
First and the most important thing of all is that ShowModalDIalog() makes that function is waiting for result from modal window.

Simple sites can be changed in easy way but business app can not - there is too many realtions between different part of the system which process one-by-one or in loops.
Comment 25 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-09-16 09:47:05 PDT
To be clear:

* Yes, we are aware that there is no simple replacement which enables you to write code like
  var val = getValueFromUser();
* However, it is possible to get *exactly* the same UX as showModalDialog() by using features like
  <dialog> (and polyfills for it) and window.open.
* We are aware that this will require some code changes on your side in order to make the code be
  asynchronous. In many cases these code changes will be non-trivial.

So, put it another way. This will require non-trivial code changes as there's no simply drop-in replacement. However you can still get the exact same UX for your users.

Because of the need for non-trivial code changes, we have announced this change so far in advance. This is also why we quite a while ago added a warning that this function was deprecated. To give you guys time to make the necessary code changes to maintain the current UX without using showModalDialog().

But make no mistake. We *will* remove this function. It's just a question of when. So I'd recommend starting on the necessary code changes.


The reason we are getting rid of showModalDialog() is that it results in bad UI for users since the rest of the process is locked up. And it results in a lot of code complexity for browsers, which is likely why we haven't gotten it working on Android.

This complexity is getting worse as we are making other changes to the browser, like e10s.
Comment 26 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-09-16 09:56:50 PDT
Regarding timing, I would say that we can commit to not removing this function before Firefox 39. This means that the function will be around until around mid June 2015.

It also means that for enterprise you can switch to using ESR 38 builds, which will have the function into mid 2016.

https://www.mozilla.org/en-US/firefox/organizations/faq/


But again, the function *will* go away.
Comment 27 User image Jean-Yves Perrier [:teoli] 2014-09-16 11:09:32 PDT
I've made it clear in the doc (with our timing, but also with Chrome timing that was already in the article before) that this method is going away. Hope it will help a bit in spreading the word.

https://developer.mozilla.org/en-US/docs/Web/API/Window.showModalDialog
Comment 28 User image Miiiiichal 2014-09-17 02:26:27 PDT
(In reply to Jonas Sicking (:sicking) from comment #26)
> Regarding timing, I would say that we can commit to not removing this
> function before Firefox 39. This means that the function will be around
> until around mid June 2015.

Ok, so there is time to make changes. 

> The reason we are getting rid of showModalDialog() is that it results in bad UI for users since 
> the rest of the process is locked up. And it results in a lot of code complexity for browsers, 
> which is likely why we haven't gotten it working on Android.

How about firefox mobile ? (Andorid). showModalDialog() will be working till version 39 too? 

In ff32 (mobile) showModalDialog() is not working. 
Is this situation temporary (is is a bug and you'll fix it) or is it a permanent (and sudden) solution?

Our app worked on tablets with android (ff 31) , now it doesn't (ff32). What should I tell to users?
Comment 29 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2014-09-18 10:35:51 PDT
I don't know why showModalDialog does not work on android, or if that was an intentional change or an accidental regression.

I would suggest filing a separate bug specifically to investigate that. Feel free to cc me.
Comment 30 User image Andrew McCreight [:mccr8] 2014-09-18 10:40:18 PDT
Bug 753555 is about implementing showModalDialog on Android.
Comment 31 User image Masatoshi Kimura [:emk] 2014-09-24 21:57:30 PDT
We shouldn't drop the support without an replacement.
Comment 32 User image Justin Dolske [:Dolske] 2014-10-02 14:21:02 PDT
(In reply to Jonas Sicking (:sicking) from comment #26)
> Regarding timing, I would say that we can commit to not removing this
> function before Firefox 39. This means that the function will be around
> until around mid June 2015.

How about disabling it, say, starting now for pre-release builds? (Nightly/Aurora, maybe Beta later) That will start to give us some early feedback on the impact of removal.
Comment 33 User image Brad Lassey [:blassey] (use needinfo?) 2014-10-02 14:47:39 PDT
*** Bug 1077002 has been marked as a duplicate of this bug. ***
Comment 34 User image Blake Kaplan (:mrbkap) 2015-02-25 18:02:26 PST
Created attachment 8569568 [details] [diff] [review]
Patch to disable

I filed bug 1137025 to get telemetry on how often showModalDialog is used in the wild. I don't suspect any real suprises there. Once we have the results, we can start with this patch to turn off showModalDialog (and then later we'll be able to rip the code out).

Note that at this time, we do not intend to implement showModalDialog for e10s. When we switch to e10s on be default would probably be a good point to rip the code out entirely.
Comment 35 User image Masatoshi Kimura [:emk] 2015-02-26 03:56:14 PST
Will telemetry count internal network usage correctly?
Comment 36 User image Avi Drissman 2015-02-27 12:02:02 PST
FYI, the changes to fully remove showModalDialog just landed in Chrome (http://crbug.com/345831) and will take effect in M43. Good luck to you guys.
Comment 37 User image Simon Pieters 2015-04-15 11:34:10 PDT
(In reply to Jonas Sicking (:sicking) from comment #26)
> Regarding timing, I would say that we can commit to not removing this
> function before Firefox 39. This means that the function will be around
> until around mid June 2015.

Friendly reminder (Firefox Developer Edition is now at 39). :-)

Project Spartan has removed showModalDialog: https://twitter.com/jacobrossi/status/588353411168346113
Comment 38 User image jlregeim 2015-05-04 14:19:11 PDT
The difference with Chrome is they support HTML5 <dialog> elements.  Removing this feature seems to introduce a gap in feature set.  Does FFX team expect to prioritize https://bugzilla.mozilla.org/show_bug.cgi?id=840640
Comment 39 User image Misido 2015-06-25 11:29:34 PDT
I use a local website "windows.showModalDialog" I wonder what the real deadline for it to stop working?
Thank you.
Comment 40 User image Michal Purzynski [:michal`] (use NEEDINFO) 2015-09-15 16:40:27 PDT
How are we doing here?
Comment 41 User image Kohei Yoshino [:kohei] 2015-10-27 23:07:15 PDT
Posted the site compatibility doc: https://www.fxsitecompat.com/en-US/docs/2015/window-showmodaldialog-will-be-removed/

Firefox 45 will be the next ESR so the target milestone could be 46 maybe?
Comment 42 User image jlregeim 2015-11-13 10:29:50 PST
Would you guys please implement HTML5 <Dialog> before you remove showModalDialog?
https://bugzilla.mozilla.org/show_bug.cgi?id=840640
Comment 43 User image Masatoshi Kimura [:emk] 2015-12-22 21:22:53 PST
Recently showModalDialog() has been removed from the spec.
https://github.com/whatwg/html/commit/eec96462b5bd1c7f904a4880bc04dade6efcd597
Comment 44 User image Mike Taylor [:miketaylr] 2016-01-14 09:36:43 PST
Removing this is going to break attachments in Outlook Web App 2010 and reportedly Exchange webmail (see https://github.com/whatwg/html/pull/374#issuecomment-171466693). Chrome and Edge are OK with that but if we go the same route I'd like to avoid us thinking doing evangelism is going to fix those problems.
Comment 45 User image Jesse Ruderman 2016-01-20 14:58:46 PST
Can we make an extension to fix old versions of OWA? Either monkeypatch their code, or shim showModalDialog on top of another semi-synchronous feature such as XHR.
Comment 46 User image Jesse Ruderman 2016-01-20 15:00:01 PST
We should consider removing showModalDialog BEFORE shipping e10s, to avoid giving users too many reasons to stay on old versions at the same time (and to avoid swamping evang teams).
Comment 47 User image Kohei Yoshino [:kohei] 2016-06-08 09:45:14 PDT
Updated the site compat doc as Firefox 48 will enable e10s by default and showModalDialog() is practically gone.

https://www.fxsitecompat.com/en-CA/docs/2016/window-showmodaldialog-has-been-removed/
Comment 48 User image Yuhong Bao 2016-06-09 12:17:53 PDT
(In reply to Jesse Ruderman from comment #45)
> Can we make an extension to fix old versions of OWA? Either monkeypatch
> their code, or shim showModalDialog on top of another semi-synchronous
> feature such as XHR.

Best solution would be to patch the server. MS has fixes for both Exchange 2010 and Exchange 2013.
Comment 49 User image Brad Lassey [:blassey] (use needinfo?) 2016-06-20 11:14:50 PDT
Mike, can we use the system addon to monkey patch these old versions of OWA?
Comment 50 User image Mike Taylor [:miketaylr] 2016-06-23 12:55:24 PDT
Yeah, I think so. That's one of my use cases in the explainer doc I wrote -- will send to dev-platform on Monday (to get more off-PTO eyeballs on it).
Comment 51 User image Jose María Acuña 2016-09-16 04:27:05 PDT
When do you want to implement the dialog tag html5?
Comment 52 User image Mike Taylor [:miketaylr] 2016-10-28 11:00:08 PDT
*** Bug 1306169 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.