gh-13038: Fixed trying to swap browsers that dont exist (gh-13051)

This commit is contained in:
mr. m
2026-04-02 16:10:18 +02:00
committed by GitHub
parent 0619d3d8de
commit 36aa7b0a20
2 changed files with 14 additions and 10 deletions

View File

@@ -790,7 +790,10 @@ class nsZenWindowSync {
// We *shouldn't* care about this scenario since the remoteness should be
// the same anyways.
if (!aOurTab.linkedBrowser || !aOtherTab.linkedBrowser) {
return true;
this.log(
`Cannot swap browsers between tabs ${aOurTab.id} and ${aOtherTab.id} because one of them doesn't have a linked browser`
);
return false;
}
// Can't swap between chrome and content processes.
if (

View File

@@ -678,14 +678,15 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
return tab;
}
let workspaceId;
if (
!tab.hasAttribute("zen-essential") &&
tab.getAttribute("zen-workspace-id") != gZenWorkspaces.activeWorkspace
) {
workspaceId = gZenWorkspaces.activeWorkspace;
}
if (tab.ownerGlobal !== window) {
fromDifferentWindow = true;
if (
!tab.hasAttribute("zen-essential") &&
tab.getAttribute("zen-workspace-id") !=
gZenWorkspaces.activeWorkspace
) {
workspaceId = gZenWorkspaces.activeWorkspace;
if (workspaceId) {
tab.ownerGlobal.gBrowser.selectedTab =
tab.ownerGlobal.gBrowser._findTabToBlurTo(tab, movingTabs);
tab.ownerGlobal.gZenWorkspaces.moveTabToWorkspace(tab, workspaceId);
@@ -700,9 +701,9 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
if (tab) {
++newIndex;
}
if (workspaceId) {
tab.setAttribute("zen-workspace-id", workspaceId);
}
}
if (workspaceId) {
tab.setAttribute("zen-workspace-id", workspaceId);
}
return tab;
});