mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1108547 - Part 1: Inherit the correct private browsing status on new windows created for targeted navigations; r=jdm
This commit is contained in:
parent
3cab8effef
commit
8c17d11b29
@ -4761,18 +4761,22 @@ nsBrowserAccess.prototype = {
|
||||
else
|
||||
aWhere = gPrefService.getIntPref("browser.link.open_newwindow");
|
||||
}
|
||||
let isPrivate = PrivateBrowsingUtils.isWindowPrivate(aOpener || window);
|
||||
switch (aWhere) {
|
||||
case Ci.nsIBrowserDOMWindow.OPEN_NEWWINDOW :
|
||||
// FIXME: Bug 408379. So how come this doesn't send the
|
||||
// referrer like the other loads do?
|
||||
var url = aURI ? aURI.spec : "about:blank";
|
||||
let features = "all,dialog=no";
|
||||
if (isPrivate) {
|
||||
features += ",private";
|
||||
}
|
||||
// Pass all params to openDialog to ensure that "url" isn't passed through
|
||||
// loadOneOrMoreURIs, which splits based on "|"
|
||||
newWindow = openDialog(getBrowserURL(), "_blank", "all,dialog=no", url, null, null, null);
|
||||
newWindow = openDialog(getBrowserURL(), "_blank", features, url, null, null, null);
|
||||
break;
|
||||
case Ci.nsIBrowserDOMWindow.OPEN_NEWTAB :
|
||||
let referrer = aOpener ? makeURI(aOpener.location.href) : null;
|
||||
let isPrivate = PrivateBrowsingUtils.isWindowPrivate(aOpener || window);
|
||||
let browser = this._openURIInNewTab(aURI, referrer, isPrivate, isExternal);
|
||||
if (browser)
|
||||
newWindow = browser.contentWindow;
|
||||
|
@ -9635,9 +9635,13 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
nsAutoCString spec;
|
||||
if (aURI)
|
||||
aURI->GetSpec(spec);
|
||||
nsAutoString features;
|
||||
if (mInPrivateBrowsing) {
|
||||
features.AssignLiteral("private");
|
||||
}
|
||||
rv = win->OpenNoNavigate(NS_ConvertUTF8toUTF16(spec),
|
||||
name, // window name
|
||||
EmptyString(), // Features
|
||||
features,
|
||||
getter_AddRefs(newWin));
|
||||
|
||||
// In some cases the Open call doesn't actually result in a new
|
||||
|
Loading…
Reference in New Issue
Block a user