Bug 1839845 - Add about:settings as alias of about:preferences. r=Gijs,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D202594
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -31,6 +31,7 @@ pages = [
|
||||
'rights',
|
||||
'robots',
|
||||
'sessionrestore',
|
||||
'settings',
|
||||
'shoppingsidebar',
|
||||
'tabcrashed',
|
||||
'unloads',
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user