зеркало из https://github.com/mozilla/gecko-dev.git
Bug 332285 - Fixing my screw-up, r+sr=roc
This commit is contained in:
Родитель
dce157c478
Коммит
d1e3621ea3
|
@ -4247,26 +4247,24 @@ nsGlobalWindow::Close()
|
||||||
// Don't allow scripts from content to close windows
|
// Don't allow scripts from content to close windows
|
||||||
// that were not opened by script
|
// that were not opened by script
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
if (!mHadOriginalOpener) {
|
if (!mHadOriginalOpener && !nsContentUtils::IsCallerTrustedForWrite()) {
|
||||||
if (nsContentUtils::IsCallerTrustedForWrite()) {
|
PRBool allowClose =
|
||||||
PRBool allowClose =
|
nsContentUtils::GetBoolPref("dom.allow_scripts_to_close_windows",
|
||||||
nsContentUtils::GetBoolPref("dom.allow_scripts_to_close_windows",
|
PR_TRUE);
|
||||||
PR_TRUE);
|
if (!allowClose) {
|
||||||
if (!allowClose) {
|
// We're blocking the close operation
|
||||||
// We're blocking the close operation
|
// report localized error msg in JS console
|
||||||
// report localized error msg in JS console
|
nsContentUtils::ReportToConsole(
|
||||||
nsContentUtils::ReportToConsole(
|
nsContentUtils::eDOM_PROPERTIES,
|
||||||
nsContentUtils::eDOM_PROPERTIES,
|
"WindowCloseBlockedWarning",
|
||||||
"WindowCloseBlockedWarning",
|
nsnull, 0, // No params
|
||||||
nsnull, 0, // No params
|
nsnull, // No URI. Not clear which URI we should be using
|
||||||
nsnull, // No URI. Not clear which URI we should be using
|
// here anyway
|
||||||
// here anyway
|
EmptyString(), 0, 0, // No source, or column/line number
|
||||||
EmptyString(), 0, 0, // No source, or column/line number
|
nsIScriptError::warningFlag,
|
||||||
nsIScriptError::warningFlag,
|
"DOM Window"); // Better name for the category?
|
||||||
"DOM Window"); // Better name for the category?
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче