Adjust tab rotation angle and enhance pinned tab loading logic for improved user experience

This commit is contained in:
mr. M
2025-02-21 16:50:16 +01:00
parent 22060f90bf
commit 68cf549df3
5 changed files with 21 additions and 16 deletions

View File

@@ -107,6 +107,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
selectEmptyTab() {
console.log(new Error().stack);
if (this._emptyTab && Services.prefs.getBoolPref('zen.urlbar.replace-newtab')) {
gBrowser.selectedTab = this._emptyTab;
return this._emptyTab;
@@ -596,15 +597,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
_selectStartPage() {
const currentTab = gBrowser.selectedTab;
const isEssential = currentTab.hasAttribute('zen-essential');
if (isEssential) {
let showed = false;
if (currentTab.pinned) {
this.selectEmptyTab();
return;
showed = true;
} else {
const currentTabUrl = currentTab.linkedBrowser?.currentURI.spec;
if (currentTabUrl === 'about:newtab' || currentTabUrl === 'about:home') {
this.selectEmptyTab();
gBrowser.removeTab(currentTab);
showed = true;
}
}
const currentTabUrl = currentTab.linkedBrowser?.currentURI.spec;
if (currentTabUrl === 'about:blank' || currentTabUrl === 'about:newtab' || currentTabUrl === 'about:home') {
this.selectEmptyTab();
gBrowser.removeTab(currentTab);
if (Services.prefs.getBoolPref('zen.urlbar.replace-newtab') && showed) {
BrowserCommands.openTab();
}
}
@@ -2225,10 +2231,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this.pinnedTabsContainer.children.length - 1;
}
get normalTabCount() {
return this.tabboxChildren.length - 1;
}
get allWorkspaceTabs() {
const currentWorkspace = this.activeWorkspace;
return this.allStoredTabs.filter(