Bug 735237 - Disable window.showModalDialog in Fennec [r=jst]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 12 Apr 2012 21:55:25 -0700
changeset 94894 3e7aa45f40f7d7e8fc232dd07669082b2bd27a7c
parent 94893 a2d751d71d64f88e81af77ce07a47ccf05b45353
child 94895 906aa73122d98b423452bdca8d93d31a92a77525
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs735237
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 735237 - Disable window.showModalDialog in Fennec [r=jst]
dom/base/nsGlobalWindow.cpp
mobile/android/app/mobile.js
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -7170,16 +7170,19 @@ nsGlobalWindow::ShowModalDialog(const ns
                                 const nsAString& aOptions,
                                 nsIVariant **aRetVal)
 {
   FORWARD_TO_OUTER(ShowModalDialog, (aURI, aArgs, aOptions, aRetVal),
                    NS_ERROR_NOT_INITIALIZED);
 
   *aRetVal = nsnull;
 
+  if (Preferences::GetBool("dom.disable_window_showModalDialog", false))
+    return NS_ERROR_NOT_AVAILABLE;
+
   // Before bringing up the window/dialog, unsuppress painting and flush
   // pending reflows.
   EnsureReflowFlushAndPaint();
 
   if (AreDialogsBlocked() || !ConfirmDialogAllowed())
     return NS_ERROR_NOT_AVAILABLE;
 
   nsCOMPtr<nsIDOMWindow> dlgWin;
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -245,16 +245,17 @@ pref("extensions.blocklist.url", "https:
 pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
 
 /* block popups by default, and notify the user about blocked popups */
 pref("dom.disable_open_during_load", true);
 pref("privacy.popups.showBrowserMessage", true);
 
 /* disable opening windows with the dialog feature */
 pref("dom.disable_window_open_dialog_feature", true);
+pref("dom.disable_window_showModalDialog", true);
 
 pref("keyword.enabled", true);
 pref("keyword.URL", "https://www.google.com/m?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=");
 
 pref("accessibility.typeaheadfind", false);
 pref("accessibility.typeaheadfind.timeout", 5000);
 pref("accessibility.typeaheadfind.flashBar", 1);
 pref("accessibility.typeaheadfind.linksonly", false);