Don't do a replace load unless explicitly requested if the script that set

location is running in a different window.  Bug 178729, r+sr=jst
This commit is contained in:
bzbarsky%mit.edu 2004-06-01 15:18:32 +00:00
parent 8230791f39
commit 24377c162f

View File

@ -611,7 +611,13 @@ LocationImpl::SetHrefWithBase(const nsAString& aHref,
nsJSUtils::GetDynamicScriptContext(cx);
if (scriptContext) {
inScriptTag = scriptContext->GetProcessingScriptTag();
if (scriptContext->GetProcessingScriptTag()) {
// Now check to make sure that the script is running in our window,
// since we only want to replace if the location is set by a
// <script> tag in the same window. See bug 178729.
nsCOMPtr<nsIScriptGlobalObject> ourGlobal(do_GetInterface(mDocShell));
inScriptTag = (ourGlobal == scriptContext->GetGlobalObject());
}
}
} //cx
} // stack