Bug 1676492, when new tab page is configured to show a blank page, it should not be added to session history, r=Mardak

Differential Revision: https://phabricator.services.mozilla.com/D156303
This commit is contained in:
Neil Deakin 2022-11-01 20:43:02 +00:00
parent 7997a24179
commit cc3da6c652

View file

@ -11711,8 +11711,13 @@ bool nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel) {
if (buf.EqualsLiteral("blank")) {
return false;
}
// We only want to add about:newtab if it's not privileged:
// We only want to add about:newtab if it's not privileged, and
// if it is not configured to show the blank page.
if (buf.EqualsLiteral("newtab")) {
if (!StaticPrefs::browser_newtabpage_enabled()) {
return false;
}
NS_ENSURE_TRUE(aChannel, false);
nsCOMPtr<nsIPrincipal> resultPrincipal;
rv = nsContentUtils::GetSecurityManager()->GetChannelResultPrincipal(