From 2582c25dcf51b73797367bc46b9764780d2fbee3 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Fri, 25 Mar 2022 12:46:45 +0000 Subject: [PATCH] Bug 1760991 - add 'my firefox' shell page, r=sclements Differential Revision: https://phabricator.services.mozilla.com/D142050 --- browser/base/content/browser.js | 4 +++- browser/components/about/AboutRedirector.cpp | 9 ++++++--- browser/components/about/components.conf | 1 + browser/components/moz.build | 4 ++++ browser/components/myfirefox/jar.mn | 7 +++++++ browser/components/myfirefox/moz.build | 10 ++++++++++ browser/components/myfirefox/myfirefox.html | 16 ++++++++++++++++ 7 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 browser/components/myfirefox/jar.mn create mode 100644 browser/components/myfirefox/moz.build create mode 100644 browser/components/myfirefox/myfirefox.html diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f2f17dca9780..886a61162f1a 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -632,6 +632,7 @@ async function gLazyFindCommand(cmd, ...args) { var gPageIcons = { "about:home": "chrome://branding/content/icon32.png", + "about:myfirefox": "chrome://branding/content/icon32.png", "about:newtab": "chrome://branding/content/icon32.png", "about:welcome": "chrome://branding/content/icon32.png", "about:privatebrowsing": "chrome://browser/skin/privatebrowsing/favicon.svg", @@ -639,8 +640,9 @@ var gPageIcons = { var gInitialPages = [ "about:blank", - "about:newtab", "about:home", + "about:myfirefox", + "about:newtab", "about:privatebrowsing", "about:welcomeback", "about:sessionrestore", diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index 89d07dc2e99b..59bddecef40c 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -73,9 +73,9 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS | nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::IS_SECURE_CHROME_UI}, - {"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT}, + {"myfirefox", "chrome://browser/content/myfirefox.html", + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI | + nsIAboutModule::HIDE_FROM_ABOUTABOUT}, {"policies", "chrome://browser/content/policies/aboutPolicies.html", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}, {"privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.html", @@ -94,6 +94,9 @@ static const RedirEntry kRedirMap[] = { {"sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT | nsIAboutModule::IS_SECURE_CHROME_UI}, + {"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml", + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT}, {"welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT | nsIAboutModule::IS_SECURE_CHROME_UI}, diff --git a/browser/components/about/components.conf b/browser/components/about/components.conf index d16e15575ff3..774d81672814 100644 --- a/browser/components/about/components.conf +++ b/browser/components/about/components.conf @@ -12,6 +12,7 @@ pages = [ 'home', 'logins', 'loginsimportreport', + 'myfirefox', 'newtab', 'ion', 'pocket-home', diff --git a/browser/components/moz.build b/browser/components/moz.build index 5a45200d3481..160244bdf822 100644 --- a/browser/components/moz.build +++ b/browser/components/moz.build @@ -62,6 +62,10 @@ DIRS += [ DIRS += ["build"] +if CONFIG["NIGHTLY_BUILD"]: + DIRS += ["myfirefox"] + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": DIRS += ["touchbar"] elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": diff --git a/browser/components/myfirefox/jar.mn b/browser/components/myfirefox/jar.mn new file mode 100644 index 000000000000..cd305e5b44a0 --- /dev/null +++ b/browser/components/myfirefox/jar.mn @@ -0,0 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +browser.jar: + content/browser/myfirefox.html + diff --git a/browser/components/myfirefox/moz.build b/browser/components/myfirefox/moz.build new file mode 100644 index 000000000000..08f60c31d3e1 --- /dev/null +++ b/browser/components/myfirefox/moz.build @@ -0,0 +1,10 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +JAR_MANIFESTS += ["jar.mn"] + +with Files("**"): + BUG_COMPONENT = ("Firefox", "General") diff --git a/browser/components/myfirefox/myfirefox.html b/browser/components/myfirefox/myfirefox.html new file mode 100644 index 000000000000..e02352af17fe --- /dev/null +++ b/browser/components/myfirefox/myfirefox.html @@ -0,0 +1,16 @@ + + + + + + + + + This space intentionally left blank + + + + +