Commit 764638e4 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

amend! BB 31575: Disable Firefox Home (Activity Stream)

BB 31575: Disable Firefox Home (Activity Stream)

Treat about:blank as the default home page and new tab page.

BB 43886: Disable the newtab component/addon.

Bug 41624: Disable about:pocket-* pages.

Bug 40144: Redirect about:privatebrowsing to the user's home
parent 90f9e94a
Loading
Loading
Loading
Loading
+1 −2
Changes for browser/actors/moz.build: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ with Files("WebRTCChild.sys.mjs"):
    BUG_COMPONENT = ("Firefox", "Site Permissions")

FINAL_TARGET_FILES.actors += [
    "AboutNewTabChild.sys.mjs",
    "AboutNewTabParent.sys.mjs",
    # Remove newtab actors. tor-browser#43886.
    "AboutPrivateBrowsingChild.sys.mjs",
    "AboutPrivateBrowsingParent.sys.mjs",
    "AboutProtectionsChild.sys.mjs",
+1 −1
Changes for browser/components/BrowserComponents.manifest: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ category browser-before-ui-startup resource:///modules/BuiltInThemes.sys.mjs Bui
category browser-before-ui-startup resource://normandy/Normandy.sys.mjs Normandy.init
#endif
category browser-before-ui-startup resource:///modules/ResetPBMPanel.sys.mjs ResetPBMPanel.init
category browser-before-ui-startup resource:///modules/AboutHomeStartupCache.sys.mjs AboutHomeStartupCache.init
# newtab component is disabled. tor-browser#43886
category browser-before-ui-startup resource:///modules/AccountsGlue.sys.mjs AccountsGlue.init

# Browser window lifecycle consumers
+2 −5
Changes for browser/components/BrowserGlue.sys.mjs: 2 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
  AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs",
  // newtab component is disabled. tor-browser#43886
  AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs",
  ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
  AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
@@ -558,10 +558,7 @@ BrowserGlue.prototype = {

  // cleanup (called on application shutdown)
  _dispose: function BG__dispose() {
    // AboutHomeStartupCache might write to the cache during
    // quit-application-granted, so we defer uninitialization
    // until here.
    lazy.AboutHomeStartupCache.uninit();
    // newtab component is disabled. tor-browser#43886

    if (this._lateTasksIdleObserver) {
      this._userIdleService.removeIdleObserver(
+16 −16
Changes for browser/components/about/AboutRedirector.cpp: 16 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#define ABOUT_WELCOME_CHROME_URL \
  "chrome://browser/content/aboutwelcome/aboutwelcome.html"
#define ABOUT_HOME_URL "about:home"
#define BASE_BROWSER_HOME_PAGE_URL "chrome://browser/content/blanktab.html"

namespace mozilla {
namespace browser {
@@ -33,6 +34,11 @@ struct RedirEntry {
  uint32_t flags;
};

static const uint32_t BASE_BROWSER_HOME_PAGE_FLAGS =
    nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
    nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
    nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI;

/*
  Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome
  privileges. This is potentially dangerous. Please use
@@ -77,10 +83,7 @@ static const RedirEntry kRedirMap[] = {
         nsIAboutModule::IS_SECURE_CHROME_UI},
    {"policies", "chrome://browser/content/policies/aboutPolicies.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
    {"privatebrowsing", "about:blank",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
    {"privatebrowsing", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
    {"profiling",
     "chrome://devtools/content/performance-new/aboutprofiling/index.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
@@ -101,11 +104,10 @@ static const RedirEntry kRedirMap[] = {
    {"welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
    {"welcome", "about:blank",
     nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::ALLOW_SCRIPT},
    {"welcome", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
    {"home", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
    {"newtab", "chrome://browser/content/blanktab.html",
     BASE_BROWSER_HOME_PAGE_FLAGS},
    {"messagepreview",
     "chrome://browser/content/messagepreview/messagepreview.html",
     nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
@@ -191,13 +193,11 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
    if (!strcmp(path.get(), redir.id)) {
      nsAutoCString url;

      if (path.EqualsLiteral("welcome")) {
        NimbusFeatures::RecordExposureEvent("aboutwelcome"_ns, true);
        if (NimbusFeatures::GetBool("aboutwelcome"_ns, "enabled"_ns, true)) {
          url.AssignASCII(ABOUT_WELCOME_CHROME_URL);
        } else {
          url.AssignASCII(ABOUT_HOME_URL);
        }
      if (path.EqualsLiteral("welcome") || path.EqualsLiteral("home") ||
          path.EqualsLiteral("privatebrowsing") ||
          (path.EqualsLiteral("newtab") &&
           StaticPrefs::browser_newtabpage_enabled())) {
        url.AssignASCII(BASE_BROWSER_HOME_PAGE_URL);
      }

      // fall back to the specified url in the map
+2 −0
Changes for browser/components/about/components.conf: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,9 +10,11 @@ pages = [
    'certerror',
    'downloads',
    'framecrashed',
    'home',
    'logins',
    'loginsimportreport',
    'messagepreview',
    'newtab',
    'policies',
    'preferences',
    'privatebrowsing',
Loading