mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 700080: don't show prompts for tabs that are closing, r=jst
This commit is contained in:
parent
f92f919db2
commit
8a9208c6c6
@ -1599,6 +1599,11 @@
|
||||
evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
|
||||
aTab.dispatchEvent(evt);
|
||||
|
||||
// Prevent this tab from showing further dialogs, since we're closing it
|
||||
var windowUtils = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
windowUtils.preventFurtherDialogs();
|
||||
|
||||
// Remove the tab's filter and progress listener.
|
||||
const filter = this.mTabFilters[aTab._tPos];
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
|
@ -1936,3 +1936,8 @@ nsDOMWindowUtils::CheckAndClearPaintedState(nsIDOMElement* aElement, bool* aResu
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::PreventFurtherDialogs() {
|
||||
mWindow->PreventFurtherDialogs();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2627,10 +2627,7 @@ nsGlobalWindow::AreDialogsBlocked()
|
||||
|
||||
topWindow = topWindow->GetCurrentInnerWindowInternal();
|
||||
|
||||
return !topWindow ||
|
||||
(topWindow->mDialogDisabled &&
|
||||
(topWindow->GetPopupControlState() > openAllowed ||
|
||||
topWindow->mDialogAbuseCount >= MAX_DIALOG_COUNT));
|
||||
return !topWindow || topWindow->mDialogDisabled;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -926,4 +926,9 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
*/
|
||||
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
|
||||
|
||||
/**
|
||||
* Prevent this window (and any child windows) from displaying any further
|
||||
* dialogs (e.g. window.alert()).
|
||||
*/
|
||||
void preventFurtherDialogs();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user