From 7046d16956d8e9f28d49aef64eeb3a2f509deb43 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Fri, 17 Apr 2026 13:32:22 +0200 Subject: [PATCH] gh-13149: Fixed WS marking tabs as inactive in certain cases (gh-13298) --- scripts/mar_sign.sh | 20 ++++++++++++++++---- src/zen/sessionstore/ZenWindowSync.sys.mjs | 10 ++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/scripts/mar_sign.sh b/scripts/mar_sign.sh index fb47c6a80..e0c02802b 100644 --- a/scripts/mar_sign.sh +++ b/scripts/mar_sign.sh @@ -47,10 +47,22 @@ import_cert() { echo "Error: public_key.der not found. Run with -g first." >&2 exit 1 fi - echo "Importing certificate into $UPDATER_CERT_DIR/release_primary.der" - cp "$CERT_PATH_DIR/public_key.der" "$UPDATER_CERT_DIR/release_primary.der" - echo "Importing certificate into $UPDATER_CERT_DIR/release_secondary.der" - cp "$CERT_PATH_DIR/public_key.der" "$UPDATER_CERT_DIR/release_secondary.der" + files=( + "$UPDATER_CERT_DIR/release_primary.der" + "$UPDATER_CERT_DIR/release_secondary.der" + "$UPDATER_CERT_DIR/dep1.der" + "$UPDATER_CERT_DIR/dep2.der" + "$UPDATER_CERT_DIR/xpcshellCertificate.der" + ) + for file in "${files[@]}"; do + if [ ! -f "$file" ]; then + echo "Error: $file not found. Make sure the updater certificates exist." >&2 + exit 1 + fi + rm -f "$file" + echo "Copying $CERT_PATH_DIR/public_key.der to $file" + cp "$CERT_PATH_DIR/public_key.der" "$file" + done echo "Done. Rebuild the updater to embed the new certificate." } diff --git a/src/zen/sessionstore/ZenWindowSync.sys.mjs b/src/zen/sessionstore/ZenWindowSync.sys.mjs index 564693dca..8612601c4 100644 --- a/src/zen/sessionstore/ZenWindowSync.sys.mjs +++ b/src/zen/sessionstore/ZenWindowSync.sys.mjs @@ -795,6 +795,16 @@ class nsZenWindowSync { ); return false; } + // Theoretical case where we are trying to swap two tabs in the same window. + // There has been some reports of this happening in the wild, and while it shouldn't + // cause any critical issues, it can cause some weird states and we should avoid it. + // For example, see gh-13149 + if (aOtherTab.ownerGlobal === aOurTab.ownerGlobal) { + this.log( + `Cannot swap browsers between tabs ${aOurTab.id} and ${aOtherTab.id} because they are in the same window` + ); + return false; + } // Can't swap between chrome and content processes. if ( aOurTab.linkedBrowser.isRemoteBrowser !=