Verified Commit 5a6c0c96 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

MB 112: Updater customization for Mullvad Browser

MB 71: Set the updater base URL to Mullvad domain
parent d9c2a906
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -34,3 +34,15 @@ pref("privacy.resistFingerprinting.spoofOsInUserAgentHeader", false);

// mullvad-browser#222: Hide "List all tabs" when the tabs don't overflow
pref("browser.tabs.tabmanager.enabled", false);

// mullvad-browser#131: Review a few updater preferences
pref("app.update.notifyDuringDownload", true);
pref("app.update.url.manual", "https://mullvad.net/download/browser");
pref("app.update.url.details", "https://mullvad.net/download/browser");
pref("app.update.badgeWaitTime", 0);
pref("app.releaseNotesURL", "https://github.com/mullvad/mullvad-browser/releases");
// disables the 'What's New?' link in the about dialog, otherwise we need to
// duplicate logic for generating the url to the github releases page
pref("app.releaseNotesURL.aboutDialog", "about:blank");
// point to our feedback url rather than Mozilla's
pref("app.feedback.baseURL", "https://mullvad.net/help/tag/browser/");
+35 −15
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ ChromeUtils.defineLazyGetter(lazy, "gWindowsAlertsService", () => {
});

const FORK_VERSION_PREF =
  "browser.startup.homepage_override.basebrowser.version";
  "browser.startup.homepage_override.mullvadbrowser.version";

// One-time startup homepage override configurations
const ONCE_DOMAINS = ["mozilla.org", "firefox.com"];
@@ -720,6 +720,23 @@ nsBrowserContentHandler.prototype = {
      }
    }

    // Retrieve the home page early so we can compare it against
    // about:mullvad-browser to decide whether or not we need an override page
    // (second tab) after an update was applied.
    var startPage = "";
    try {
      var choice = prefb.getIntPref("browser.startup.page");
      if (choice == 1 || choice == 3) {
        startPage = lazy.HomePage.get();
      }
    } catch (e) {
      console.error(e);
    }

    if (startPage == "about:blank") {
      startPage = "";
    }

    var override;
    var overridePage = "";
    var additionalPage = "";
@@ -859,6 +876,23 @@ nsBrowserContentHandler.prototype = {
              "%OLD_BASE_BROWSER_VERSION%",
              old_forkVersion
            );
            if (overridePage && AppConstants.BASE_BROWSER_UPDATE) {
              // Mullvad Browser, copied from tor-browser: Instead of opening
              // the post-update "override page" directly, we include a link in
              // about:mullvad-browser.
              prefb.setCharPref("mullvadbrowser.post_update.url", overridePage);
              prefb.setBoolPref(
                "mullvadbrowser.post_update.shouldNotify",
                true
              );
              // If the user's homepage is about:tor, we will inform them
              // about the update on that page; otherwise, we arrange to
              // open about:tor in a secondary tab.
              overridePage =
                startPage === "about:mullvad-browser"
                  ? ""
                  : "about:mullvad-browser";
            }
            break;
          }
          case OVERRIDE_NEW_BUILD_ID:
@@ -933,20 +967,6 @@ nsBrowserContentHandler.prototype = {
      }
    }

    var startPage = "";
    try {
      var choice = prefb.getIntPref("browser.startup.page");
      if (choice == 1 || choice == 3) {
        startPage = lazy.HomePage.get();
      }
    } catch (e) {
      console.error(e);
    }

    if (startPage == "about:blank") {
      startPage = "";
    }

    let skipStartPage =
      override == OVERRIDE_NEW_PROFILE &&
      prefb.getBoolPref("browser.startup.firstrunSkipsHomepage");
+6 −6
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@ MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
# of values.
# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
if test "$MOZ_UPDATE_CHANNEL" = "alpha"; then
  ACCEPTED_MAR_CHANNEL_IDS=basebrowser-torproject-alpha
  MAR_CHANNEL_ID=basebrowser-torproject-alpha
  ACCEPTED_MAR_CHANNEL_IDS=mullvadbrowser-mullvad-alpha
  MAR_CHANNEL_ID=mullvadbrowser-mullvad-alpha
elif test "$MOZ_UPDATE_CHANNEL" = "nightly"; then
  ACCEPTED_MAR_CHANNEL_IDS=basebrowser-torproject-nightly
  MAR_CHANNEL_ID=basebrowser-torproject-nightly
  ACCEPTED_MAR_CHANNEL_IDS=mullvadbrowser-mullvad-nightly
  MAR_CHANNEL_ID=mullvadbrowser-mullvad-nightly
else
  ACCEPTED_MAR_CHANNEL_IDS=basebrowser-torproject-release
  MAR_CHANNEL_ID=basebrowser-torproject-release
  ACCEPTED_MAR_CHANNEL_IDS=mullvadbrowser-mullvad-release
  MAR_CHANNEL_ID=mullvadbrowser-mullvad-release
fi

# Include the DevTools client, not just the server (which is the default)
+3 −1
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
[PostUpdateWin]
; ExeRelPath is the path to the PostUpdateWin executable relative to the
; application executable.
ExeRelPath=uninstall\helper.exe
ExeRelPath=postupdate.exe
; ExeArg is the argument to pass to the PostUpdateWin exe
; We do not need any argument, but an empty string here will make updater.exe
; not run this step.
ExeArg=/PostUpdate
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
const PREF_SYS_ADDON_UPDATE_ENABLED = "extensions.systemAddon.update.enabled";
const PREF_REMOTESETTINGS_DISABLED = "extensions.remoteSettings.disabled";
const PREF_USE_REMOTE = "extensions.webextensions.remote";
const PREF_EM_LAST_FORK_VERSION = "extensions.lastBaseBrowserVersion";
const PREF_EM_LAST_FORK_VERSION = "extensions.lastMullvadBrowserVersion";

const PREF_MIN_WEBEXT_PLATFORM_VERSION =
  "extensions.webExtensionsMinPlatformVersion";
Loading