Bug 769254 - Part 2: Modify nsPIWindowWatcher::OpenWindowJS (renamed to OpenWindow2) so we can pass in the URL for target=_blank links without navigating the opened window to that URL. r=bz
This commit is contained in:
@@ -8274,16 +8274,19 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
|
||||
bool isNewWindow = false;
|
||||
if (!targetDocShell) {
|
||||
nsCOMPtr<nsIDOMWindow> win =
|
||||
nsCOMPtr<nsPIDOMWindow> win =
|
||||
do_GetInterface(GetAsSupports(this));
|
||||
NS_ENSURE_TRUE(win, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsDependentString name(aWindowTarget);
|
||||
nsCOMPtr<nsIDOMWindow> newWin;
|
||||
rv = win->Open(EmptyString(), // URL to load
|
||||
name, // window name
|
||||
EmptyString(), // Features
|
||||
getter_AddRefs(newWin));
|
||||
nsCAutoString spec;
|
||||
if (aURI)
|
||||
aURI->GetSpec(spec);
|
||||
rv = win->OpenNoNavigate(NS_ConvertUTF8toUTF16(spec),
|
||||
name, // window name
|
||||
EmptyString(), // Features
|
||||
getter_AddRefs(newWin));
|
||||
|
||||
// In some cases the Open call doesn't actually result in a new
|
||||
// window being opened. We can detect these cases by examining the
|
||||
|
||||
Reference in New Issue
Block a user