mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
This commit is contained in:
@@ -180,7 +180,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const activeTab = gBrowser.selectedTab;
|
||||
const pinnedTabsByUUID = new Map();
|
||||
const pinsToCreate = new Set(pins.map((p) => p.uuid));
|
||||
|
||||
@@ -295,11 +294,6 @@
|
||||
newTab.initialize();
|
||||
}
|
||||
|
||||
// Restore active tab
|
||||
if (!activeTab.closing) {
|
||||
gBrowser.selectedTab = activeTab;
|
||||
}
|
||||
|
||||
gBrowser._updateTabBarForPinnedTabs();
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
}
|
||||
|
@@ -128,13 +128,20 @@
|
||||
class ZenTabUnloader extends ZenDOMOperatedFeature {
|
||||
static ACTIVITY_MODIFIERS = ['muted', 'soundplaying', 'label', 'attention'];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
this.intervalUnloader = new ZenTabsIntervalUnloader(this);
|
||||
}
|
||||
|
||||
init() {
|
||||
if (!lazy.zenTabUnloaderEnabled) {
|
||||
return;
|
||||
}
|
||||
this.insertIntoContextMenu();
|
||||
this.observer = new ZenTabsObserver();
|
||||
this.intervalUnloader = new ZenTabsIntervalUnloader(this);
|
||||
this.observer.addTabsListener(this.onTabEvent.bind(this));
|
||||
}
|
||||
|
||||
|
@@ -599,7 +599,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
let showed = false;
|
||||
if (currentTab.pinned) {
|
||||
this.selectEmptyTab();
|
||||
gZenTabUnloader.explicitUnloadTabs([currentTab]);
|
||||
try {
|
||||
gZenTabUnloader.explicitUnloadTabs([currentTab]);
|
||||
} catch (e) {
|
||||
console.error('ZenWorkspaces: Error unloading tab', e);
|
||||
}
|
||||
showed = true;
|
||||
} else {
|
||||
const currentTabURL = currentTab.linkedBrowser?.currentURI?.spec;
|
||||
@@ -1515,7 +1519,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
// First pass: Handle tab visibility and workspace ID assignment
|
||||
const prevTabUsed = this._processTabVisibility(window.uuid, containerId, workspaces);
|
||||
const prevTabUsed = this._processTabVisibility(window.uuid, containerId, workspaces, onInit);
|
||||
|
||||
// Second pass: Handle tab selection
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -1631,7 +1635,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
this._animatingChange = false;
|
||||
}
|
||||
|
||||
_processTabVisibility(workspaceUuid, containerId, workspaces) {
|
||||
_processTabVisibility(workspaceUuid, containerId, workspaces, onInit) {
|
||||
const hiddenTabs = [];
|
||||
const visibleTabs = gBrowser.tabContainer.visibleTabs;
|
||||
for (const tab of gBrowser.tabs) {
|
||||
@@ -1649,7 +1653,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
(hiddenTabs.length === visibleTabs.length ||
|
||||
visibleTabs.every((tab) => tab.getAttribute('zen-essential') === 'true') ||
|
||||
hiddenTabs.includes(gBrowser.selectedTab)) &&
|
||||
gZenVerticalTabsManager._canReplaceNewTab
|
||||
gZenVerticalTabsManager._canReplaceNewTab &&
|
||||
!onInit
|
||||
) {
|
||||
prevTabUsed = gBrowser.selectedTab;
|
||||
this.selectEmptyTab();
|
||||
|
Reference in New Issue
Block a user