Commit 3e48b070 authored by Henry Wilkes's avatar Henry Wilkes Committed by Pier Angelo Vendrame
Browse files

Bug 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 1e9f3323
Loading
Loading
Loading
Loading
+4 −0
Changes for browser/base/content/browser-places.js: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1427,6 +1427,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
Changes for browser/base/content/browser.js: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -743,6 +743,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:welcome": "chrome://branding/content/icon32.png",
@@ -750,6 +751,7 @@ var gPageIcons = {
};

var gInitialPages = [
  "about:tor",
  "about:torconnect",
  "about:blank",
  "about:home",
+1 −0
Changes for browser/base/content/utilityOverlay.js: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -78,6 +78,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"
  );
+20 −0
Changes for browser/components/BrowserGlue.sys.mjs: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
  WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
  WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
  WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.sys.mjs",
  checkHomepageOverride: "resource:///modules/HomepageOverride.sys.mjs",
  clearTimeout: "resource://gre/modules/Timer.sys.mjs",
  setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
@@ -511,6 +512,23 @@ let JSWINDOWACTORS = {
    matches: ["about:tabcrashed*"],
  },

  AboutTor: {
    parent: {
      esModuleURI: "resource:///actors/AboutTorParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///actors/AboutTorChild.sys.mjs",

      events: {
        DOMContentLoaded: {},
        L10nMutationsFinished: {},
        SubmitSearchOnionize: { wantUntrusted: true },
      },
    },

    matches: ["about:tor"],
  },

  // Removed AboutWelcomeShopping. tor-browser#42831.

  AboutWelcome: {
@@ -1581,6 +1599,8 @@ BrowserGlue.prototype = {

    lazy.ResetPBMPanel.init();

    lazy.checkHomepageOverride();

    AboutHomeStartupCache.init();

    Services.obs.notifyObservers(null, "browser-ui-startup-complete");
+27 −0
Changes for browser/components/abouttor/AboutTorChild.sys.mjs: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
/**
 * Actor child class for the about:tor page.
 */
export class AboutTorChild extends JSWindowActorChild {
  handleEvent(event) {
    switch (event.type) {
      case "DOMContentLoaded":
        this.sendQuery("AboutTor:GetInitialData").then(data => {
          const initialDataEvent = new this.contentWindow.CustomEvent(
            "InitialData",
            { detail: Cu.cloneInto(data, this.contentWindow) }
          );
          this.contentWindow.dispatchEvent(initialDataEvent);
        });
        break;
      case "SubmitSearchOnionize":
        this.sendAsyncMessage("AboutTor:SetSearchOnionize", !!event.detail);
        break;
      case "L10nMutationsFinished":
        // Pass on chrome-only event for completed localization to content.
        this.contentWindow.dispatchEvent(
          new this.contentWindow.CustomEvent("L10nMutationsFinished")
        );
        break;
    }
  }
}
Loading