From 82ca8925d25b1c918f66fb5bda8ec0c02313d4e9 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 4 Apr 2022 17:19:24 +0000 Subject: [PATCH] Bug 1757657. Remove some about:printpreview cruft that was missed in 1702501. r=mstriemer Differential Revision: https://phabricator.services.mozilla.com/D139993 --- browser/components/sessionstore/SessionStore.jsm | 6 +----- docshell/base/nsAboutRedirector.cpp | 4 ---- docshell/build/components.conf | 1 - dom/security/nsContentSecurityUtils.cpp | 2 -- netwerk/ipc/DocumentChannel.cpp | 3 +-- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 650a597ca6fae..79ba35eaf9816 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -5490,7 +5490,6 @@ var SessionStoreInternal = { aTabState.entries.length == 1 && (aTabState.entries[0].url == "about:blank" || aTabState.entries[0].url == "about:newtab" || - aTabState.entries[0].url == "about:printpreview" || aTabState.entries[0].url == "about:privatebrowsing") && !aTabState.userTypedValue ) @@ -5515,10 +5514,7 @@ var SessionStoreInternal = { aTabState.userTypedValue || (aTabState.attributes && aTabState.attributes.customizemode == "true") || (aTabState.entries.length && - !( - aTabState.entries[0].url == "about:printpreview" || - aTabState.entries[0].url == "about:privatebrowsing" - )) + aTabState.entries[0].url != "about:privatebrowsing") ); }, diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp index 41dcfafd73901..4c566ccebab4f 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -166,10 +166,6 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT}, {"webrtc", "chrome://global/content/aboutwebrtc/aboutWebrtc.html", nsIAboutModule::ALLOW_SCRIPT}, - {"printpreview", "about:blank", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT | - nsIAboutModule::URI_CAN_LOAD_IN_CHILD}, {"crashparent", "about:blank", nsIAboutModule::HIDE_FROM_ABOUTABOUT}, {"crashcontent", "about:blank", nsIAboutModule::HIDE_FROM_ABOUTABOUT | diff --git a/docshell/build/components.conf b/docshell/build/components.conf index 96eb71e275ca4..5f11df641e378 100644 --- a/docshell/build/components.conf +++ b/docshell/build/components.conf @@ -24,7 +24,6 @@ about_pages = [ 'networking', 'performance', 'plugins', - 'printpreview', 'processes', 'serviceworkers', 'srcdoc', diff --git a/dom/security/nsContentSecurityUtils.cpp b/dom/security/nsContentSecurityUtils.cpp index 5720a524eafce..018c9316ad8e5 100644 --- a/dom/security/nsContentSecurityUtils.cpp +++ b/dom/security/nsContentSecurityUtils.cpp @@ -1157,8 +1157,6 @@ void nsContentSecurityUtils::AssertAboutPageHasCSP(Document* aDocument) { "about:srcdoc"_ns, // about:sync-log displays plain text only -> no CSP "about:sync-log"_ns, - // about:printpreview displays plain text only -> no CSP - "about:printpreview"_ns, // about:logo just displays the firefox logo -> no CSP "about:logo"_ns, // about:sync is a special mozilla-signed developer addon with low usage -> diff --git a/netwerk/ipc/DocumentChannel.cpp b/netwerk/ipc/DocumentChannel.cpp index 9d8aefa9b137a..efc50fc5cc4a5 100644 --- a/netwerk/ipc/DocumentChannel.cpp +++ b/netwerk/ipc/DocumentChannel.cpp @@ -159,8 +159,7 @@ static bool URIUsesDocChannel(nsIURI* aURI) { } nsCString spec = aURI->GetSpecOrDefault(); - return !spec.EqualsLiteral("about:printpreview") && - !spec.EqualsLiteral("about:crashcontent"); + return !spec.EqualsLiteral("about:crashcontent"); } bool DocumentChannel::CanUseDocumentChannel(nsIURI* aURI) {