mirror of
https://github.com/zen-browser/desktop.git
synced 2026-04-02 21:59:18 +00:00
gh-13038: Fixed trying to swap browsers that dont exist (gh-13051)
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user