From e04e910a6fa2fc2001c1daf3f3ed33962591d9af Mon Sep 17 00:00:00 2001 From: Rishab Shah <89949620+rishabshah0@users.noreply.github.com> Date: Wed, 3 Jun 2026 02:06:16 -0700 Subject: [PATCH] no-bug: bypass workspace container coercion for extension-opened tabs (gh-14001) Co-authored-by: pokeshah <89949620+pokeshah@users.noreply.github.com> --- configs/windows/mozconfig | 10 ++++++++-- .../components/tabbrowser/content/tabbrowser-js.patch | 2 +- src/zen/spaces/ZenSpaceManager.mjs | 9 ++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configs/windows/mozconfig b/configs/windows/mozconfig index 065ed1291..83f4283a4 100644 --- a/configs/windows/mozconfig +++ b/configs/windows/mozconfig @@ -9,6 +9,12 @@ if test "$ZEN_CROSS_COMPILING"; then export WINE="$(echo ~)/win-cross/wine/bin/wine" export WINEDEBUG=-all + # Force Wine to load the genuine Microsoft d3dcompiler_47.dll that ships next + # to fxc.exe in the Windows SDK instead of its built-in vkd3d reimplementation, + # whose HLSL front-end mishandles #include directives (emits an #hlsl_full_path + # marker it then fails to re-parse, breaking shader compilation). + export WINEDLLOVERRIDES="d3dcompiler_47=n" + export MOZ_STUB_INSTALLER=1 export MOZ_PKG_FORMAT=TAR @@ -16,9 +22,9 @@ if test "$ZEN_CROSS_COMPILING"; then CROSS_COMPILE=1 if test "$SURFER_COMPAT" = "aarch64"; then - export WIN32_REDIST_DIR="$(echo ~)/win-cross/vs2026/VC/Redist/MSVC/14.50.35710/arm64/Microsoft.VC145.CRT" + export WIN32_REDIST_DIR="$WINSYSROOT/VC/Redist/MSVC/14.50.35710/arm64/Microsoft.VC145.CRT" else - export WIN32_REDIST_DIR="$(echo ~)/win-cross/vs2026/VC/Redist/MSVC/14.50.35710/x64/Microsoft.VC145.CRT" + export WIN32_REDIST_DIR="$WINSYSROOT/VC/Redist/MSVC/14.50.35710/x64/Microsoft.VC145.CRT" fi fi diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index e2458ba13..95bf58cee 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -281,7 +281,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 + let hasZenDefaultUserContextId = false; + let zenForcedWorkspaceId = undefined; + if (typeof gZenWorkspaces !== "undefined" && !_forZenEmptyTab) { -+ [userContextId, hasZenDefaultUserContextId, zenForcedWorkspaceId] = gZenWorkspaces.getContextIdIfNeeded(userContextId, fromExternal); ++ [userContextId, hasZenDefaultUserContextId, zenForcedWorkspaceId] = gZenWorkspaces.getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal); + } + if (!UserInteraction.running("browser.tabs.opening", window)) { diff --git a/src/zen/spaces/ZenSpaceManager.mjs b/src/zen/spaces/ZenSpaceManager.mjs index bad548890..67d29725f 100644 --- a/src/zen/spaces/ZenSpaceManager.mjs +++ b/src/zen/spaces/ZenSpaceManager.mjs @@ -2979,11 +2979,18 @@ class nsZenWorkspaces { // Tab browser utilities - getContextIdIfNeeded(userContextId, fromExternal) { + getContextIdIfNeeded(userContextId, fromExternal, triggeringPrincipal) { if (!this.workspaceEnabled) { return [userContextId, false, undefined]; } + if ( + triggeringPrincipal && + triggeringPrincipal.isAddonOrExpandedAddonPrincipal + ) { + return [userContextId, false, undefined]; + } + if ( this.shouldForceContainerTabsToWorkspace && typeof userContextId !== "undefined" &&