Bug 611553 - Android: Make DOMWillOpenModalDialog a chrome-only event. r=mbrubeck a=akeybl
authorFrank Yan <fyan@mozilla.com>
Wed, 16 Jan 2013 13:10:20 -0800
changeset 127423 c7115618ac6ee8dc86f275620a76210639a8f214
parent 127422 46d904f2f2525a38e4c7f8859407cdc56024292f
child 127424 5385979f826d60f0f30418c956bc7cb19a4b494c
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, akeybl
bugs611553
milestone20.0a2
Bug 611553 - Android: Make DOMWillOpenModalDialog a chrome-only event. r=mbrubeck a=akeybl
mobile/android/components/PromptService.js
--- a/mobile/android/components/PromptService.js
+++ b/mobile/android/components/PromptService.js
@@ -756,17 +756,19 @@ let PromptUtils = {
 
   fireDialogEvent: function(aDomWin, aEventName) {
     // accessing the document object can throw if this window no longer exists. See bug 789888.
     try {
       if (!aDomWin.document)
         return;
       let event = aDomWin.document.createEvent("Events");
       event.initEvent(aEventName, true, true);
-      aDomWin.dispatchEvent(event);
+      let winUtils = aDomWin.QueryInterface(Ci.nsIInterfaceRequestor)
+                           .getInterface(Ci.nsIDOMWindowUtils);
+      winUtils.dispatchEventToChromeOnly(aDomWin, event);
     } catch(ex) {
     }
   }
 };
 
 XPCOMUtils.defineLazyGetter(PromptUtils, "passwdBundle", function () {
   return Services.strings.createBundle("chrome://passwordmgr/locale/passwordmgr.properties");
 });