Add a flag to nsIWebNavigation to disable popup-blocking for loads as needed. Bug 278357, r=biesi, sr=jst, a=bsmedberg

This commit is contained in:
2007-09-14 12:21:45 -07:00
parent 3d40184830
commit a26807feed
2 changed files with 16 additions and 0 deletions

View File

@@ -2801,6 +2801,16 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
if (NS_FAILED(rv) || !uri)
return NS_ERROR_FAILURE;
PopupControlState popupState;
if (aLoadFlags & LOAD_FLAGS_ALLOW_POPUPS) {
popupState = openAllowed;
aLoadFlags &= ~LOAD_FLAGS_ALLOW_POPUPS;
} else {
popupState = openOverridden;
}
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(mScriptGlobal));
nsAutoPopupStatePusher statePusher(win, popupState);
// Don't pass certain flags that aren't needed and end up confusing
// ConvertLoadTypeToDocShellLoadInfo. We do need to ensure that they are
// passed to LoadURI though, since it uses them.