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

TB 7494: Create local home page for TBB.

Bug 41333: Update about:tor to new design. Including:
+ make the favicon match the branding icon.
+ make the location bar show a search icon.
parent 6e74bcc0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1480,6 +1480,10 @@ var BookmarkingUI = {
      newTabURL,
      "about:home",
      "chrome://browser/content/blanktab.html",
      // Add the "about:tor" uri. See tor-browser#41717.
      // NOTE: "about:newtab", "about:welcome", "about:home" and
      // "about:privatebrowsing" can also redirect to "about:tor".
      "about:tor",
    ];
    if (PrivateBrowsingUtils.isWindowPrivate(window)) {
      newTabURLs.push("about:privatebrowsing");
+2 −0
Original line number Diff line number Diff line
@@ -739,6 +739,7 @@ async function gLazyFindCommand(cmd, ...args) {
}

var gPageIcons = {
  "about:tor": "chrome://branding/content/icon32.png",
  "about:home": "chrome://branding/content/icon32.png",
  "about:newtab": "chrome://branding/content/icon32.png",
  "about:opentabs": "chrome://branding/content/icon32.png",
@@ -747,6 +748,7 @@ var gPageIcons = {
};

var gInitialPages = [
  "about:tor",
  "about:torconnect",
  "about:blank",
  "about:home",
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ function isBlankPageURL(aURL) {
  return (
    aURL == "about:blank" ||
    aURL == "about:home" ||
    aURL == "about:tor" ||
    aURL == BROWSER_NEW_TAB_URL ||
    aURL == "chrome://browser/content/blanktab.html"
  );
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ category browser-before-ui-startup resource://normandy/Normandy.sys.mjs Normandy
#endif
category browser-before-ui-startup moz-src:///browser/components/nova/NovaPrefs.sys.mjs NovaPrefs.init
category browser-before-ui-startup moz-src:///browser/components/privatebrowsing/ResetPBMPanel.sys.mjs ResetPBMPanel.init
category browser-before-ui-startup resource:///modules/HomepageOverride.sys.mjs HomepageOverride.check
# newtab component is disabled. tor-browser#43886
category browser-before-ui-startup resource:///modules/AccountsGlue.sys.mjs AccountsGlue.init
category browser-before-ui-startup moz-src:///browser/modules/ObserverForwarder.sys.mjs ObserverForwarder.init
+24 −0
Original line number Diff line number Diff line
@@ -779,6 +779,7 @@ nsBrowserContentHandler.prototype = {
    var overridePage = "";
    var additionalPage = "";
    var willRestoreSession = false;
    let openAboutTor = false;
    try {
      // Read the old value of homepage_override.mstone before
      // needHomepageOverride updates it, so that we can later add it to the
@@ -983,6 +984,19 @@ nsBrowserContentHandler.prototype = {
              "%OLD_BASE_BROWSER_VERSION%",
              old_forkVersion
            );
            if (AppConstants.BASE_BROWSER_UPDATE) {
              // Tor Browser: Instead of opening the post-update "override page"
              // directly, we ensure that about:tor will be opened, which should
              // notify the user that their browser was updated.
              // NOTE: We ignore any existing overridePage value, which can come
              // from the openURL attribute within the updates.xml file.
              Services.prefs.setBoolPref(
                "torbrowser.post_update.shouldNotify",
                true
              );
              openAboutTor = true;
              overridePage = "about:tor";
            }
            break;
          }
          case OVERRIDE_NEW_BUILD_ID: {
@@ -1085,6 +1099,16 @@ nsBrowserContentHandler.prototype = {
      startPage = "";
    }

    // If the user's homepage is about:tor, we do not want to open it twice with
    // the override.
    if (
      openAboutTor &&
      startPage === "about:tor" &&
      overridePage?.split("|").includes("about:tor")
    ) {
      startPage = "";
    }

    // Only show the startPage if we're not restoring an update session and are
    // not set to skip the start page on this profile
    if (overridePage && startPage && !willRestoreSession && !skipStartPage) {
Loading