diff --git a/mobile/chrome/content/bindings/browser.js b/mobile/chrome/content/bindings/browser.js index ecc98dd79e87..c06e6b61781c 100644 --- a/mobile/chrome/content/bindings/browser.js +++ b/mobile/chrome/content/bindings/browser.js @@ -359,70 +359,3 @@ let ContentScroll = { ContentScroll.init(); - -function PromptRemoter() { - addEventListener("DOMWindowCreated", this, false); -} - -PromptRemoter.prototype = { - handleEvent: function handleEvent(aEvent) { - var window = aEvent.originalTarget.defaultView.content; - // Need to make sure we are called on what we care about - - // content windows. DOMWindowCreated is called on *all* HTMLDocuments, - // some of which belong to ChromeWindows or lack defaultView.content - // altogether. - // - // Note about the syntax used here: |"wrappedJSObject" in window| - // will silently fail, without even letting us catch it as an - // exception, and checking in the way that we do check in some - // cases still throws an exception; see bug 582108 about both. - try { - if (!window || !window.wrappedJSObject) { - return; - } - } - catch(e) { - return; - } - - function bringTabToFront() { - let event = window.document.createEvent("Events"); - event.initEvent("DOMWillOpenModalDialog", true, false); - window.dispatchEvent(event); - } - - function informClosedFrontTab() { - let event = window.document.createEvent("Events"); - event.initEvent("DOMModalDialogClosed", true, false); - window.dispatchEvent(event); - } - - window.wrappedJSObject.alert = function(aMessage) { - bringTabToFront(); - sendSyncMessage("Prompt:Alert", { - message: aMessage - }); - informClosedFrontTab(); - } - - window.wrappedJSObject.confirm = function(aMessage) { - bringTabToFront(); - return sendSyncMessage("Prompt:Confirm", { - message: aMessage - }); - informClosedFrontTab(); - } - - window.wrappedJSObject.prompt = function(aText, aValue) { - bringTabToFront(); - return sendSyncMessage("Prompt:Prompt", { - text: aText, - value: aValue - }); - informClosedFrontTab(); - } - }, -}; - -new PromptRemoter(); - diff --git a/mobile/chrome/content/bindings/browser.xml b/mobile/chrome/content/bindings/browser.xml index a7d4d88c031b..7825b3a5eaa7 100644 --- a/mobile/chrome/content/bindings/browser.xml +++ b/mobile/chrome/content/bindings/browser.xml @@ -145,16 +145,6 @@ break; } break; - - case "Prompt:Alert": - alert(aMessage.json.message); - break; - - case "Prompt:Confirm": - return confirm(aMessage.json.message); - - case "Prompt:Prompt": - return prompt(aMessage.json.text, aMessage.json.value); } ]]> @@ -394,11 +384,6 @@ this.messageManager.addMessageListener("pagehide", this); this.messageManager.addMessageListener("DOMPopupBlocked", this); - // Prompt remoting - ["Alert", "Confirm", "Prompt"].forEach(function(name) { - this.messageManager.addMessageListener("Prompt:" + name, this); - }, this); - this._webProgress._init(); ]]>