Sitecore Modal Dialogs Fix For Chrome 37+

In the newest release of Chrome (37), the showModalDialog function is disabled by default (Chromium Blog). This change will affect all Sitecore instances using version lower than 7.1.

Show Modal Dialog Is not Defined

Fortunately, there are options to workaround the issue.

The first approach is to enable the showModalDialog function via the EnableDeprecatedWebPlatformFeatures policy. For more information on how to set policies you can refer to one of these two articles depending on your organization – Set Chrome policies for devices or Set Chrome policies for users. Keep in mind that this fix needs to be applied on every device.

!!!UPDATE!!!

As it seems the javascript solution with window.open is not working as it is not blocking the execution. The window is actually opened, but the changes won`t be saved because they won`t be passed back to the caller. So the only solution is enabling the deprecated web platform features (or upgrading Sitecore to 7.1+). The big problem is that Mozilla currently deprecated the Window.showModalDialog(), so if they obsolete it in the near future the only option will remain to use IE or upgrade to 7.1+.

The second approach is to replace the showModalDialog function with window.open. This should be done in [Web_Root]\sitecore\shell\Controls\Gecko.js. There are two functions which should be modified.

scBrowser.prototype.prompt

Modify the following line (Line 231 in the JS file):

From

return showModalDialog(“/sitecore/shell/prompt.html”, arguments, features);

To

return window.open(“/sitecore/shell/prompt.html”, arguments, features);

scBrowser.prototype.showModalDialog

Modify the following line (The line number varies for different versions of Sitecore. For Sitecore 7.0 it is Line 350 and for Sitecore 6.6 Line 345):

From

showModalDialog(url, arguments, features);

To

window.open(url, arguments, features);

The big difference is that now the opened windows will not block the GUI, because they are opened in a new browser window and the fabulous dim effect is gone :).

Fixed Modal

Hope this will help you stick to your favorite browser !

Here are some useful links from other sources:

Main SDN Discussion Thread – PSA: showModalDialog disabled by default in Chrome 37

Blog Post By Dheer Rajpoot which covers the chrome policies approach in details – Sitecore Modal Pop-ups are not working in Chrome

Blog Post By Ben McCallum – Sitecore modals and problems in newer browsers

Blog Post By Kamruz Jaman using jQuery UI Dialog – Fix for Dialog Modals not working in Sitecore in Chrome 37+ browsers 

Sitecore KB – Sitecore does not work in Chrome 37 and later

3 thoughts on “Sitecore Modal Dialogs Fix For Chrome 37+”

  1. Thanks for the mention. This is a tricky issue as I’m all for progress and can understand dropping such an old and crappy browser feature. Hopefully it doesn’t cause too much of a headache. Cheers, Ben.

  2. Looks like everyone is battling the same fire! Although this kind of works for most scenarios, any function expecting the return value no longer works. The biggest is Package Installation Wizard, you can no longer select a file. There are some other minor things I mentioned, but it may be enough for your average content editor to live with…

    1. The problem is that the links, media and other stuff also stops working. That is why I gave up from the js solution. It would be too much trouble modifying the sheer controls in order to work with this kind of solutions. Enabling the deprecated method seems like the best solution for now.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s