Verified Commit 47cb76d4 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 3a1ea21f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -28,3 +28,11 @@ pref("privacy.spoof_english", 2);

// 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);
// point to our feedback url rather than Mozilla's
pref("app.feedback.baseURL", "https://mullvad.net/help/tag/browser/");
+18 −1
Original line number Diff line number Diff line
@@ -45,7 +45,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 = new Set(["mozilla.org", "firefox.com"]);
@@ -975,6 +975,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: {
+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
@@ -38,7 +38,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";
+2 −2
Original line number Diff line number Diff line
@@ -3579,7 +3579,7 @@ static bool CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion,
  nsAutoCString buf;

  nsAutoCString forkVersion(BASE_BROWSER_VERSION_QUOTED);
  rv = parser.GetString("Compatibility", "LastBaseBrowserVersion", buf);
  rv = parser.GetString("Compatibility", "LastMullvadBrowserVersion", buf);
  if (NS_FAILED(rv) || !forkVersion.Equals(buf)) return false;

  rv = parser.GetString("Compatibility", "LastOSABI", buf);
@@ -3663,7 +3663,7 @@ static void WriteVersion(nsIFile* aProfileDir, const nsCString& aVersion,

  nsAutoCString forkVersion(BASE_BROWSER_VERSION_QUOTED);
  static const char kForkVersionHeader[] =
      NS_LINEBREAK "LastBaseBrowserVersion=";
      NS_LINEBREAK "LastMullvadBrowserVersion=";
  PR_Write(fd, kForkVersionHeader, sizeof(kForkVersionHeader) - 1);
  PR_Write(fd, forkVersion.get(), forkVersion.Length());