зеркало из https://github.com/mozilla/pjs.git
Bug 700080: don't show prompts for tabs that are closing, r=jst
This commit is contained in:
Родитель
56381c2dea
Коммит
1d3c99bc7e
|
@ -1599,6 +1599,11 @@
|
||||||
evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
|
evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
|
||||||
aTab.dispatchEvent(evt);
|
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.
|
// Remove the tab's filter and progress listener.
|
||||||
const filter = this.mTabFilters[aTab._tPos];
|
const filter = this.mTabFilters[aTab._tPos];
|
||||||
#ifdef MOZ_E10S_COMPAT
|
#ifdef MOZ_E10S_COMPAT
|
||||||
|
|
|
@ -1936,3 +1936,8 @@ nsDOMWindowUtils::CheckAndClearPaintedState(nsIDOMElement* aElement, bool* aResu
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDOMWindowUtils::PreventFurtherDialogs() {
|
||||||
|
mWindow->PreventFurtherDialogs();
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
|
@ -2627,10 +2627,7 @@ nsGlobalWindow::AreDialogsBlocked()
|
||||||
|
|
||||||
topWindow = topWindow->GetCurrentInnerWindowInternal();
|
topWindow = topWindow->GetCurrentInnerWindowInternal();
|
||||||
|
|
||||||
return !topWindow ||
|
return !topWindow || topWindow->mDialogDisabled;
|
||||||
(topWindow->mDialogDisabled &&
|
|
||||||
(topWindow->GetPopupControlState() > openAllowed ||
|
|
||||||
topWindow->mDialogAbuseCount >= MAX_DIALOG_COUNT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -926,4 +926,9 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||||
*/
|
*/
|
||||||
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
|
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent this window (and any child windows) from displaying any further
|
||||||
|
* dialogs (e.g. window.alert()).
|
||||||
|
*/
|
||||||
|
void preventFurtherDialogs();
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче