Commit 4a380784 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

MB 80: Enable Mullvad Browser as a default browser

parent 86604529
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1761,8 +1761,11 @@ var gMainPane = {
      let shellSvc = getShellService();
      let defaultBrowserBox = document.getElementById("defaultBrowserBox");
      let isInFlatpak = gGIOService?.isRunningUnderFlatpak;
      const xreDirProvider = Cc[
        "@mozilla.org/xre/directory-provider;1"
      ].getService(Ci.nsIXREDirProvider);
      // Flatpak does not support setting nor detection of default browser
      if (!shellSvc || isInFlatpak) {
      if (!shellSvc || isInFlatpak || xreDirProvider.isPortableMode) {
        defaultBrowserBox.hidden = true;
        return;
      }
+4 −3
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ let ShellServiceInternal = {
  },

  isDefaultBrowserOptOut() {
    if (AppConstants.platform == "win") {
    // Mozilla is also going to disable this, see Bug 1274517 and Bug 1272162.
    if (AppConstants.platform == "win" && !AppConstants.BASE_BROWSER_VERSION) {
      let optOutValue = lazy.WindowsRegistry.readRegKey(
        Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
        "Software\\Mozilla\\Firefox",
@@ -295,7 +296,7 @@ let ShellServiceInternal = {
      ) {
        if (this._shouldSetDefaultPDFHandler()) {
          lazy.log.info("Setting Firefox as default PDF handler");
          exeArgs.push(".pdf", "FirefoxPDF");
          exeArgs.push(".pdf", "MullvadBrowserPDF");
        } else {
          lazy.log.info("Not setting Firefox as default PDF handler");
        }
@@ -338,7 +339,7 @@ let ShellServiceInternal = {
          "set-default-extension-handlers-user-choice",
          aumi,
          ".pdf",
          "FirefoxPDF",
          "MullvadBrowserPDF",
        ],
      });
      telemetryResult = "ErrOther";
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <wchar.h>
#include <windows.h>

#define APP_REG_NAME_BASE L"Firefox-"
#define APP_REG_NAME_BASE L"MullvadBrowser-"

static bool IsWindowsLogonConnected() {
  WCHAR userName[UNLEN + 1];
+5 −3
Original line number Diff line number Diff line
@@ -310,9 +310,11 @@ nsWindowsShellService::CheckAllProgIDsExist(bool* aResult) {
    return NS_OK;
  }
  *aResult =
      CheckProgIDExists(FormatProgID(L"FirefoxURL", aumid.get()).get()) &&
      CheckProgIDExists(FormatProgID(L"FirefoxHTML", aumid.get()).get()) &&
      CheckProgIDExists(FormatProgID(L"FirefoxPDF", aumid.get()).get());
      CheckProgIDExists(
          FormatProgID(L"MullvadBrowserURL", aumid.get()).get()) &&
      CheckProgIDExists(
          FormatProgID(L"MullvadBrowserHTML", aumid.get()).get()) &&
      CheckProgIDExists(FormatProgID(L"MullvadBrowserPDF", aumid.get()).get());
  return NS_OK;
}

+2 −2
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@
@RESPATH@/updater.ini
#endif
#ifdef MOZ_DEFAULT_BROWSER_AGENT
@RESPATH@/defaultagent.ini
@RESPATH@/defaultagent_localized.ini
; @RESPATH@/defaultagent.ini
; @RESPATH@/defaultagent_localized.ini
#endif
#if defined(MOZ_UPDATE_AGENT) || defined(MOZ_DEFAULT_BROWSER_AGENT)
@RESPATH@/locale.ini
Loading