Pier Angelo Vendrame pushed to branch mullvad-browser-146.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser
Commits:
-
0801264b
by Pier Angelo Vendrame at 2025-12-11T12:21:20+01:00
10 changed files:
- browser/components/shell/ShellService.sys.mjs
- browser/components/shell/WindowsDefaultBrowser.cpp
- browser/components/shell/nsWindowsShellService.cpp
- + other-licenses/nsis/Contrib/ApplicationID/Makefile
- other-licenses/nsis/Contrib/ApplicationID/Set.cpp
- + other-licenses/nsis/Contrib/CityHash/Makefile
- toolkit/mozapps/defaultagent/EventLog.h
- toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp
- widget/windows/WinTaskbar.cpp
- widget/windows/moz.build
Changes:
| ... | ... | @@ -286,7 +286,7 @@ let ShellServiceInternal = { |
| 286 | 286 | ) {
|
| 287 | 287 | if (this._shouldSetDefaultPDFHandler()) {
|
| 288 | 288 | lazy.log.info("Setting Firefox as default PDF handler");
|
| 289 | - extraFileExtensions.push(".pdf", "FirefoxPDF");
|
|
| 289 | + extraFileExtensions.push(".pdf", "MullvadBrowserPDF");
|
|
| 290 | 290 | } else {
|
| 291 | 291 | lazy.log.info("Not setting Firefox as default PDF handler");
|
| 292 | 292 | }
|
| ... | ... | @@ -324,7 +324,7 @@ let ShellServiceInternal = { |
| 324 | 324 | try {
|
| 325 | 325 | this.defaultAgent.setDefaultExtensionHandlersUserChoice(aumi, [
|
| 326 | 326 | ".pdf",
|
| 327 | - "FirefoxPDF",
|
|
| 327 | + "MullvadBrowserPDF",
|
|
| 328 | 328 | ]);
|
| 329 | 329 | } catch (err) {
|
| 330 | 330 | telemetryResult = "ErrOther";
|
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | #include <wchar.h>
|
| 25 | 25 | #include <windows.h>
|
| 26 | 26 | |
| 27 | -#define APP_REG_NAME_BASE L"Firefox-"
|
|
| 27 | +#define APP_REG_NAME_BASE L"MullvadBrowser-"
|
|
| 28 | 28 | |
| 29 | 29 | static bool IsWindowsLogonConnected() {
|
| 30 | 30 | WCHAR userName[UNLEN + 1];
|
| ... | ... | @@ -361,10 +361,12 @@ nsWindowsShellService::CheckAllProgIDsExist(bool* aResult) { |
| 361 | 361 | |
| 362 | 362 | *aResult = result;
|
| 363 | 363 | } else {
|
| 364 | - *aResult =
|
|
| 365 | - CheckProgIDExists(FormatProgID(L"FirefoxURL", aumid.get()).get()) &&
|
|
| 366 | - CheckProgIDExists(FormatProgID(L"FirefoxHTML", aumid.get()).get()) &&
|
|
| 367 | - CheckProgIDExists(FormatProgID(L"FirefoxPDF", aumid.get()).get());
|
|
| 364 | + *aResult = CheckProgIDExists(
|
|
| 365 | + FormatProgID(L"MullvadBrowserURL", aumid.get()).get()) &&
|
|
| 366 | + CheckProgIDExists(
|
|
| 367 | + FormatProgID(L"MullvadBrowserHTML", aumid.get()).get()) &&
|
|
| 368 | + CheckProgIDExists(
|
|
| 369 | + FormatProgID(L"MullvadBrowserPDF", aumid.get()).get());
|
|
| 368 | 370 | }
|
| 369 | 371 | |
| 370 | 372 | return NS_OK;
|
| 1 | +CXXFLAGS=-Icityhash -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DCITYHASH_EXPORTS -DUNICODE
|
|
| 2 | +SRCS=Set.cpp
|
|
| 3 | +OBJS=$(subst .cpp,.o,$(SRCS))
|
|
| 4 | +LDFLAGS=-lole32 -lshlwapi -shared -Wl,--no-insert-timestamp
|
|
| 5 | +PLUGIN=ApplicationID.dll
|
|
| 6 | + |
|
| 7 | +all: $(PLUGIN)
|
|
| 8 | + |
|
| 9 | +$(PLUGIN): $(OBJS)
|
|
| 10 | + $(CXX) $(OBJS) $(LDFLAGS) -o $@
|
|
| 11 | + llvm-strip $@
|
|
| 12 | + |
|
| 13 | +clean:
|
|
| 14 | + $(RM) $(OBJS) $(PLUGIN) |
| ... | ... | @@ -35,7 +35,8 @@ unsigned int g_stringsize; |
| 35 | 35 | TCHAR *g_variables;
|
| 36 | 36 | |
| 37 | 37 | // Indicates that an application supports dual desktop and immersive modes. In Windows 8, this property is only applicable for web browsers.
|
| 38 | -DEFINE_PROPERTYKEY(PKEY_AppUserModel_IsDualMode, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 11);
|
|
| 38 | +// mingw already defines this in propkey.h.
|
|
| 39 | +// DEFINE_PROPERTYKEY(PKEY_AppUserModel_IsDualMode, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 11);
|
|
| 39 | 40 | |
| 40 | 41 | int popstring(TCHAR *str, int len);
|
| 41 | 42 | void pushstring(const TCHAR *str, int len);
|
| 1 | +CXXFLAGS=-Icityhash -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DCITYHASH_EXPORTS -DUNICODE
|
|
| 2 | +SRCS=CityHash.cpp cityhash/city.cpp
|
|
| 3 | +OBJS=$(subst .cpp,.o,$(SRCS))
|
|
| 4 | +LDFLAGS=-shared -Wl,--no-insert-timestamp
|
|
| 5 | +PLUGIN=CityHash.dll
|
|
| 6 | + |
|
| 7 | +all: $(PLUGIN)
|
|
| 8 | + |
|
| 9 | +$(PLUGIN): $(OBJS)
|
|
| 10 | + $(CXX) $(OBJS) $(LDFLAGS) -o $@
|
|
| 11 | + llvm-strip $@
|
|
| 12 | + |
|
| 13 | +clean:
|
|
| 14 | + $(RM) $(OBJS) $(PLUGIN) |
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | #ifndef __DEFAULT_BROWSER_AGENT_EVENT_LOG_H__
|
| 8 | 8 | #define __DEFAULT_BROWSER_AGENT_EVENT_LOG_H__
|
| 9 | 9 | |
| 10 | -#include "mozilla/Types.h"
|
|
| 10 | +#include <cwchar>
|
|
| 11 | 11 | |
| 12 | 12 | MOZ_BEGIN_EXTERN_C
|
| 13 | 13 | |
| ... | ... | @@ -15,10 +15,21 @@ extern MOZ_EXPORT const wchar_t* gWinEventLogSourceName; |
| 15 | 15 | |
| 16 | 16 | MOZ_END_EXTERN_C
|
| 17 | 17 | |
| 18 | -#include "mozilla/WindowsEventLog.h"
|
|
| 19 | - |
|
| 20 | -#define LOG_ERROR(hr) MOZ_WIN_EVENT_LOG_ERROR(gWinEventLogSourceName, hr)
|
|
| 21 | -#define LOG_ERROR_MESSAGE(format, ...) \
|
|
| 22 | - MOZ_WIN_EVENT_LOG_ERROR_MESSAGE(gWinEventLogSourceName, format, __VA_ARGS__)
|
|
| 18 | +#ifdef LOG_ERRORS_FILE
|
|
| 19 | +extern FILE* gLogFile;
|
|
| 20 | +# define LOG_ERROR(hr) \
|
|
| 21 | + if (gLogFile) { \
|
|
| 22 | + fprintf(gLogFile, "Error in %s:%d: 0x%X\r\n", __FILE__, __LINE__, \
|
|
| 23 | + (unsigned int)hr); \
|
|
| 24 | + }
|
|
| 25 | +# define LOG_ERROR_MESSAGE(format, ...) \
|
|
| 26 | + if (gLogFile) { \
|
|
| 27 | + fwprintf(gLogFile, format __VA_OPT__(, ) __VA_ARGS__); \
|
|
| 28 | + fputs("\r\n", gLogFile); \
|
|
| 29 | + }
|
|
| 30 | +#else
|
|
| 31 | +# define LOG_ERROR(hr)
|
|
| 32 | +# define LOG_ERROR_MESSAGE(format, ...)
|
|
| 33 | +#endif
|
|
| 23 | 34 | |
| 24 | 35 | #endif // __DEFAULT_BROWSER_AGENT_EVENT_LOG_H__ |
| ... | ... | @@ -444,9 +444,10 @@ nsresult SetDefaultBrowserUserChoice( |
| 444 | 444 | return NS_ERROR_FAILURE;
|
| 445 | 445 | }
|
| 446 | 446 | |
| 447 | - nsTArray<nsString> browserDefaults = {
|
|
| 448 | - u"https"_ns, u"FirefoxURL"_ns, u"http"_ns, u"FirefoxURL"_ns,
|
|
| 449 | - u".html"_ns, u"FirefoxHTML"_ns, u".htm"_ns, u"FirefoxHTML"_ns};
|
|
| 447 | + nsTArray<nsString> browserDefaults = {u"https"_ns, u"MullvadBrowserURL"_ns,
|
|
| 448 | + u"http"_ns, u"MullvadBrowserURL"_ns,
|
|
| 449 | + u".html"_ns, u"MullvadBrowserHTML"_ns,
|
|
| 450 | + u".htm"_ns, u"MullvadBrowserHTML"_ns};
|
|
| 450 | 451 | |
| 451 | 452 | browserDefaults.AppendElements(aExtraFileExtensions);
|
| 452 | 453 |
| ... | ... | @@ -249,7 +249,7 @@ bool WinTaskbar::GenerateAppUserModelID(nsAString& aAppUserModelId, |
| 249 | 249 | nsCString appName;
|
| 250 | 250 | if (appInfo && NS_SUCCEEDED(appInfo->GetName(appName))) {
|
| 251 | 251 | nsAutoString regKey;
|
| 252 | - regKey.AssignLiteral("Software\\Mozilla\\");
|
|
| 252 | + regKey.AssignLiteral("Software\\" MOZ_APP_VENDOR "\\");
|
|
| 253 | 253 | AppendASCIItoUTF16(appName, regKey);
|
| 254 | 254 | regKey.AppendLiteral("\\TaskBarIDs");
|
| 255 | 255 |
| ... | ... | @@ -209,6 +209,7 @@ DEFINES["MOZ_UNICODE"] = True |
| 209 | 209 | DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"]
|
| 210 | 210 | # Turn `firefox` into `Firefox`.
|
| 211 | 211 | DEFINES["MOZ_TOAST_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"].title()
|
| 212 | +DEFINES["MOZ_APP_VENDOR"] = '"%s"' % CONFIG["MOZ_APP_VENDOR"]
|
|
| 212 | 213 | |
| 213 | 214 | USE_LIBS += [
|
| 214 | 215 | "jsoncpp",
|