Bug 854340 - Firefox for Android cannot against loop + alert attack r=wesj

This commit is contained in:
Mark Finkle 2013-03-27 00:53:24 -04:00
parent 3b054d3f86
commit cfb0ef1a0f

View File

@ -127,8 +127,12 @@ Prompt.prototype = {
if (aCheckMsg)
aInputs.push({ type: "checkbox", label: PromptUtils.cleanUpLabel(aCheckMsg), checked: aCheckState.value });
if (this._domWin)
let callerWin;
if (this._domWin) {
PromptUtils.fireDialogEvent(this._domWin, "DOMWillOpenModalDialog");
let winUtils = this._domWin.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
callerWin = winUtils.enterModalStateWithWindow();
}
let msg = { type: "Prompt:Show" };
if (aTitle) msg.title = aTitle;
@ -138,7 +142,16 @@ Prompt.prototype = {
PromptUtils.getLocaleString("Cancel")
];
msg.inputs = aInputs;
return PromptUtils.sendMessageToJava(msg);
let retval = PromptUtils.sendMessageToJava(msg);
if (this._domWin) {
let winUtils = this._domWin.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
winUtils.leaveModalStateWithWindow(callerWin);
PromptUtils.fireDialogEvent(this._domWin, "DOMModalDialogClosed");
}
return retval;
},
/*