diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index 6f0134401484..46e9a6a82108 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -141,6 +141,9 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS | nsIAboutModule::HIDE_FROM_ABOUTABOUT}, + {"settings", "chrome://browser/content/preferences/preferences.xhtml", + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI | + nsIAboutModule::HIDE_FROM_ABOUTABOUT}, {"preferences", "chrome://browser/content/preferences/preferences.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}, {"downloads", diff --git a/browser/components/about/components.conf b/browser/components/about/components.conf index c03994b11c81..b94c49b61dc2 100644 --- a/browser/components/about/components.conf +++ b/browser/components/about/components.conf @@ -31,6 +31,7 @@ pages = [ 'rights', 'robots', 'sessionrestore', + 'settings', 'shoppingsidebar', 'tabcrashed', 'unloads', diff --git a/browser/components/preferences/home.js b/browser/components/preferences/home.js index 6aa72b84b8f6..90f33875b873 100644 --- a/browser/components/preferences/home.js +++ b/browser/components/preferences/home.js @@ -344,12 +344,15 @@ var gHomePane = { }, /** - * _isTabAboutPreferences: Is a given tab set to about:preferences? + * _isTabAboutPreferencesOrSettings: Is a given tab set to about:preferences or about:settings? * @param {Element} aTab A tab element - * @returns {bool} Is the linkedBrowser of aElement set to about:preferences? + * @returns {bool} Is the linkedBrowser of aElement set to about:preferences or about:settings? */ - _isTabAboutPreferences(aTab) { - return aTab.linkedBrowser.currentURI.spec.startsWith("about:preferences"); + _isTabAboutPreferencesOrSettings(aTab) { + return ( + aTab.linkedBrowser.currentURI.spec.startsWith("about:preferences") || + aTab.linkedBrowser.currentURI.spec.startsWith("about:settings") + ); }, /** @@ -367,7 +370,7 @@ var gHomePane = { "navigator:browser" ) { tabs = win.gBrowser.visibleTabs.slice(win.gBrowser._numPinnedTabs); - tabs = tabs.filter(tab => !this._isTabAboutPreferences(tab)); + tabs = tabs.filter(tab => !this._isTabAboutPreferencesOrSettings(tab)); // XXX: Bug 1441637 - Fix tabbrowser to report tab.closing before it blurs it tabs = tabs.filter(tab => !tab.closing); } diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js index a700124f3dbe..11969cc0fee8 100644 --- a/browser/components/preferences/main.js +++ b/browser/components/preferences/main.js @@ -278,7 +278,10 @@ var gMainPane = { let uri = win.gBrowser.currentURI.spec; if ( - (uri == "about:preferences" || uri == "about:preferences#general") && + (uri == "about:preferences" || + uri == "about:preferences#general" || + uri == "about:settings" || + uri == "about:settings#general") && document.visibilityState == "visible" ) { this.updateSetDefaultBrowser(); diff --git a/dom/security/nsContentSecurityUtils.cpp b/dom/security/nsContentSecurityUtils.cpp index a483522499e8..d2c1b257bcd4 100644 --- a/dom/security/nsContentSecurityUtils.cpp +++ b/dom/security/nsContentSecurityUtils.cpp @@ -1365,6 +1365,7 @@ void nsContentSecurityUtils::AssertAboutPageHasCSP(Document* aDocument) { // preferences and downloads allow legacy inline scripts through hash src. MOZ_ASSERT(!foundScriptSrc || StringBeginsWith(aboutSpec, "about:preferences"_ns) || + StringBeginsWith(aboutSpec, "about:settings"_ns) || StringBeginsWith(aboutSpec, "about:downloads"_ns) || StringBeginsWith(aboutSpec, "about:asrouter"_ns) || StringBeginsWith(aboutSpec, "about:newtab"_ns) || @@ -1383,6 +1384,7 @@ void nsContentSecurityUtils::AssertAboutPageHasCSP(Document* aDocument) { // remote web resources MOZ_ASSERT(!foundWebScheme || StringBeginsWith(aboutSpec, "about:preferences"_ns) || + StringBeginsWith(aboutSpec, "about:settings"_ns) || StringBeginsWith(aboutSpec, "about:addons"_ns) || StringBeginsWith(aboutSpec, "about:newtab"_ns) || StringBeginsWith(aboutSpec, "about:debugging"_ns) || @@ -1411,6 +1413,7 @@ void nsContentSecurityUtils::AssertAboutPageHasCSP(Document* aDocument) { // Bug 1579160: Remove 'unsafe-inline' from style-src within // about:preferences "about:preferences"_ns, + "about:settings"_ns, // Bug 1571346: Remove 'unsafe-inline' from style-src within about:addons "about:addons"_ns, // Bug 1584485: Remove 'unsafe-inline' from style-src within: @@ -1553,7 +1556,7 @@ bool nsContentSecurityUtils::ValidateScriptFilename(JSContext* cx, // and this is the most reasonable. See 1727770 u"about:downloads"_ns, // We think this is the same problem as about:downloads - u"about:preferences"_ns, + u"about:preferences"_ns, u"about:settings"_ns, // Browser console will give a filename of 'debugger' See 1763943 // Sometimes it's 'debugger eager eval code', other times just 'debugger // eval code' diff --git a/toolkit/modules/BrowserUtils.sys.mjs b/toolkit/modules/BrowserUtils.sys.mjs index 1963b9728e14..db9ef425c5f5 100644 --- a/toolkit/modules/BrowserUtils.sys.mjs +++ b/toolkit/modules/BrowserUtils.sys.mjs @@ -112,6 +112,7 @@ export var BrowserUtils = { canFindInPage(location) { return ( !location.startsWith("about:preferences") && + !location.startsWith("about:settings") && !location.startsWith("about:logins") && !(location.startsWith("about:firefoxview") && lazy.FXVIEW_SEARCH_ENABLED) );