Verified Commit 78e3120b authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by ma1
Browse files

MB 80: Enable Mullvad Browser as a default browser

parent bfb87868
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1765,8 +1765,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;
      }
+2 −2
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ let ShellServiceInternal = {
      ) {
        if (this._shouldSetDefaultPDFHandler()) {
          lazy.log.info("Setting Firefox as default PDF handler");
          extraFileExtensions.push(".pdf", "FirefoxPDF");
          extraFileExtensions.push(".pdf", "MullvadBrowserPDF");
        } else {
          lazy.log.info("Not setting Firefox as default PDF handler");
        }
@@ -302,7 +302,7 @@ let ShellServiceInternal = {
      try {
        this.defaultAgent.setDefaultExtensionHandlersUserChoice(aumi, [
          ".pdf",
          "FirefoxPDF",
          "MullvadBrowserPDF",
        ]);
      } catch (err) {
        telemetryResult = "ErrOther";
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,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];
+6 −4
Original line number Diff line number Diff line
@@ -342,10 +342,12 @@ nsWindowsShellService::CheckAllProgIDsExist(bool* aResult) {

    *aResult = result;
  } else {
    *aResult =
        CheckProgIDExists(FormatProgID(L"FirefoxURL", aumid.get()).get()) &&
        CheckProgIDExists(FormatProgID(L"FirefoxHTML", aumid.get()).get()) &&
        CheckProgIDExists(FormatProgID(L"FirefoxPDF", aumid.get()).get());
    *aResult = CheckProgIDExists(
                   FormatProgID(L"MullvadBrowserURL", aumid.get()).get()) &&
               CheckProgIDExists(
                   FormatProgID(L"MullvadBrowserHTML", aumid.get()).get()) &&
               CheckProgIDExists(
                   FormatProgID(L"MullvadBrowserPDF", aumid.get()).get());
  }

  return NS_OK;
+14 −0
Original line number Diff line number Diff line
CXXFLAGS=-Icityhash -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DCITYHASH_EXPORTS -DUNICODE
SRCS=Set.cpp
OBJS=$(subst .cpp,.o,$(SRCS))
LDFLAGS=-lole32 -lshlwapi -shared -Wl,--no-insert-timestamp
PLUGIN=ApplicationID.dll

all: $(PLUGIN)

$(PLUGIN): $(OBJS)
	$(CXX) $(OBJS) $(LDFLAGS) -o $@
	llvm-strip $@

clean:
	$(RM) $(OBJS) $(PLUGIN)
Loading