Compare commits

...

33 Commits

Author SHA1 Message Date
mr. m
b5efe62739 fix: Make sure drop indicator is under the last item when newtab button is below, b=no-bug, c=common 2026-01-29 11:05:43 +01:00
mr. m
e34ed3e882 feat: Fixed unpinning an essential tab directly from shortcuts, b=no-bug, c=folders, split-view, tabs, workspaces 2026-01-29 07:39:09 +01:00
mr. m
658e35ebde feat: Add more migration options, b=no-bug, c=no-component 2026-01-28 20:45:45 +01:00
mr. m
1176f5ac8b fix: Fixed auto focus not working on popup windows, b=closes #11377, c=common, workspaces 2026-01-28 12:12:52 +01:00
mr. m
4de01a9bc9 fix: Fixed drag-and-dropping tabs between windows not working with WS off, b=closes #12103, c=no-component 2026-01-28 10:31:19 +01:00
mr. m
35a9a9ea2a fix: Fixed low accesibility on text on sidenar, b=closes #12095, c=tests, workspaces 2026-01-27 23:53:25 +01:00
TogiFerretFerret
e78e2488ff fix(sync): prevent window shrinking by resetting scale/size in pseudo-image, p=#12082 2026-01-27 16:15:28 +01:00
mr. m
1c23ad92b3 Sync upstream Firefox to version 147.0.2, p=#12079 2026-01-27 15:03:38 +01:00
mr. m
32ba6ef81b fix: Fixed small QA issues, b=no-bug, c=common, compact-mode, split-view, tabs, tests 2026-01-27 14:35:27 +01:00
mr. m
a8559f84c1 Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2026-01-27 11:59:10 +01:00
mr. m
0e07f65bc0 feat: Add select-recently-used-on-close to the preferences page, b=no-bug, c=no-component 2026-01-27 11:59:04 +01:00
mr. m
4046dd01a1 chore: Sync upstream to Firefox 147.0.2, p=#12067 2026-01-27 09:00:57 +01:00
mr. m
e51592898e fix: Fixed restoring pinned tab to base url on startup not working, b=closes #12055, c=tabs 2026-01-26 18:42:54 +01:00
mr. m
9afbd1befd feat: Make sure to run a migration for deferred sessions as well, b=no-bug, c=tabs, workspaces 2026-01-26 17:24:12 +01:00
mr. m
ccc1e998da fix: Fixed 'Restore previous session' not working winth wsync disabled, b=closes #12034, c=common 2026-01-26 09:43:31 +01:00
mr. m
3a51b36a05 feat: Add debug log for last session state object, b=no-bug, c=no-component 2026-01-26 02:41:56 +01:00
mr. m
e05cb0e0dc feat: Make inspector shortcut use L key by default, b=no-bug, c=kbs 2026-01-26 02:20:20 +01:00
mr. m
a892721306 fix: Fixed dropping tabs into the same instance, b=closes #12032, c=no-component 2026-01-26 01:47:54 +01:00
mr. m
950f6dfb66 Revert "feat: Implement new wizzard watermarks, b=no-bug, c=configs"
This reverts commit 956841a76e.
2026-01-26 01:47:28 +01:00
mr. m
9b6937650d chore: Format project, b=no-bug, c=split-view 2026-01-25 20:02:16 +01:00
mr. m
2c63376782 fix: Fixed handling split data that may be undefined, b=no-bug, c=split-view 2026-01-25 19:58:18 +01:00
mr. m
f5356dbcb6 feat: Hide essentials visibility on the same thread, b=no-bug, c=no-component 2026-01-25 19:35:03 +01:00
mr. m
45ecacfb04 feat: Make sure to prioritize last session state before closed windows, b=no-bug, c=no-component 2026-01-25 18:23:07 +01:00
mr. m
4327684f9f feat: Make sure focus event only accepts the window object, b=no-bug, c=no-component 2026-01-25 18:10:26 +01:00
mr. m
8997a24996 fix: Fixed migration not working for previous states, b=bug #11994, c=no-component 2026-01-25 18:07:25 +01:00
mr. m
5a6a565b0f Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2026-01-25 17:44:08 +01:00
mr. m
d39fff2e4a fix: Fixed dimmed text color for linux, b=no-bug, c=glance, workspaces 2026-01-25 17:43:47 +01:00
Andrey Bochkarev
ab12e72cc5 fix: Prevent sidebar from flickering when moving a tab, p=#12016 2026-01-25 14:57:12 +01:00
mr. m
8a2e015048 fix: Fixed dragging split views into blank windows, b=no-bug, c=no-component 2026-01-25 12:26:26 +01:00
mr. m
83de087b0b feat: Dont bring unpinned tabs to new windows if window sync is disabled, b=no-bug, c=no-component 2026-01-25 12:22:53 +01:00
mr. m
5dea28a3cb feat: Fixed windows not initializing when window sync is disabled, b=closes #11999, p=#12015 2026-01-25 12:12:56 +01:00
mr. m
956841a76e feat: Implement new wizzard watermarks, b=no-bug, c=configs 2026-01-25 09:51:17 +01:00
mr. m
3f03ffb27b fix: Fixed Inconsistant capitalization in blank window locales, b=closes #12009, c=kbs 2026-01-25 00:05:49 +01:00
30 changed files with 385 additions and 238 deletions

View File

@@ -34,8 +34,8 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
### Firefox Versions
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.1`! 🚀
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.1`!
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.2`! 🚀
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.2`!
### Contributing

View File

@@ -1 +1 @@
783b222b1b93fb9e8c52eb57558ef7f07bca6e7e
7712a9ac90683965f71be525fe2827467632715d

View File

@@ -53,8 +53,8 @@ category-zen-workspaces =
.tooltiptext = { pane-zen-tabs-title }
pane-settings-workspaces-title = Workspaces
zen-tabs-unloader-enabled =
.label = Enable Tab Unloader
zen-tabs-select-recently-used-on-close =
.label = When closing a tab, switch to the most recently used tab instead of the next tab
zen-tabs-close-on-back-with-no-history =
.label = Close tab and switch to its owner tab (or most recently used tab) when going back with no history

View File

@@ -23,4 +23,4 @@ zen-menubar-appearance-dark =
.label = Dark
zen-menubar-new-unsynced-window =
.label = New Blank Window
.label = New blank window

View File

@@ -6,7 +6,7 @@
value: true
- name: zen.session-store.log
value: "@IS_TWILIGHT@"
value: true
- name: zen.session-store.restore-unsynced-windows
value: true

View File

@@ -1193,6 +1193,11 @@ Preferences.addAll([
type: "bool",
default: false,
},
{
id: "zen.tabs.select-recently-used-on-close",
type: "bool",
default: true,
},
]);
Preferences.addSetting({

View File

@@ -37,15 +37,10 @@
class="description-deemphasized"
data-l10n-id="zen-tabs-cycle-by-attribute-warning"
hidden="true"/>
<checkbox data-l10n-id="zen-tabs-select-recently-used-on-close"
preference="zen.tabs.select-recently-used-on-close"/>
</groupbox>
<hbox id="zenTabsUnloadCategory"
class="subcategory"
hidden="true"
data-category="paneZenTabManagement">
<html:h1 data-l10n-id="pane-zen-tabs-unloader-title"/>
</hbox>
<hbox id="zenPinnedTabsManagerCategory"
class="subcategory"
hidden="true"

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a1417570d4f1266 100644
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..7f759f43a4aa1e0d96f8003a50c5df269ec4a131 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -398,6 +398,7 @@
@@ -119,7 +119,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
aTab.setAttribute("pinned", "true");
this._updateTabBarForPinnedTabs();
@@ -931,11 +994,18 @@
@@ -931,11 +994,19 @@
}
this.#handleTabMove(aTab, () => {
@@ -133,13 +133,14 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// and back into arrowscrollbox.
aTab.removeAttribute("pinned");
- this.tabContainer.arrowScrollbox.prepend(aTab);
+ aTab.removeAttribute("zen-essential");
+ if (!handled) {
+ gZenWorkspaces.activeWorkspaceStrip.prepend(aTab);
+ }
});
aTab.style.marginInlineStart = "";
@@ -1112,6 +1182,9 @@
@@ -1112,6 +1183,9 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@@ -149,7 +150,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (
aIconURL &&
!LOCAL_PROTOCOLS.some(protocol => aIconURL.startsWith(protocol))
@@ -1121,6 +1194,9 @@
@@ -1121,6 +1195,9 @@
);
return;
}
@@ -159,7 +160,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL;
@@ -1393,7 +1469,6 @@
@@ -1393,7 +1470,6 @@
// Preview mode should not reset the owner
if (!this._previewMode && !oldTab.selected) {
@@ -167,7 +168,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
let lastRelatedTab = this._lastRelatedTabMap.get(oldTab);
@@ -1484,6 +1559,7 @@
@@ -1484,6 +1560,7 @@
if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed();
@@ -175,7 +176,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1636,6 +1712,9 @@
@@ -1636,6 +1713,9 @@
}
let activeEl = document.activeElement;
@@ -185,7 +186,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1959,6 +2038,11 @@
@@ -1959,6 +2039,11 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@@ -197,7 +198,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (!aLabel || aLabel.includes("about:reader?")) {
return false;
}
@@ -2067,7 +2151,7 @@
@@ -2067,7 +2152,7 @@
newIndex = this.selectedTab._tPos + 1;
}
@@ -206,7 +207,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (this.isTabGroupLabel(targetTab)) {
throw new Error(
"Replacing a tab group label with a tab is not supported"
@@ -2342,6 +2426,7 @@
@@ -2342,6 +2427,7 @@
uriIsAboutBlank,
userContextId,
skipLoad,
@@ -214,7 +215,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2415,8 +2500,7 @@
@@ -2415,8 +2501,7 @@
// we use a different attribute name for this?
b.setAttribute("name", name);
}
@@ -224,7 +225,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
b.setAttribute("transparent", "true");
}
@@ -2581,7 +2665,7 @@
@@ -2581,7 +2666,7 @@
let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID();
@@ -233,7 +234,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary.
@@ -2640,8 +2724,8 @@
@@ -2640,8 +2725,8 @@
// If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) {
@@ -244,7 +245,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
}
@@ -2828,7 +2912,6 @@
@@ -2828,7 +2913,6 @@
this.selectedTab = this.addTrustedTab(BROWSER_NEW_TAB_URL, {
tabIndex: tab._tPos + 1,
userContextId: tab.userContextId,
@@ -252,7 +253,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
focusUrlBar: true,
});
resolve(this.selectedBrowser);
@@ -2938,6 +3021,9 @@
@@ -2938,6 +3022,9 @@
schemelessInput,
hasValidUserGestureActivation = false,
textDirectiveUserActivation = false,
@@ -262,7 +263,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2948,10 +3034,17 @@
@@ -2948,10 +3035,17 @@
);
}
@@ -280,7 +281,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// If we're opening a foreground tab, set the owner by default.
ownerTab ??= inBackground ? null : this.selectedTab;
@@ -2959,6 +3052,7 @@
@@ -2959,6 +3053,7 @@
if (this.selectedTab.owner) {
this.selectedTab.owner = null;
}
@@ -288,7 +289,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// Find the tab that opened this one, if any. This is used for
// determining positioning, and inherited attributes such as the
@@ -3011,6 +3105,22 @@
@@ -3011,6 +3106,22 @@
noInitialLabel,
skipBackgroundNotify,
});
@@ -311,7 +312,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (insertTab) {
// Insert the tab into the tab container in the correct position.
this.#insertTabAtIndex(t, {
@@ -3019,6 +3129,7 @@
@@ -3019,6 +3130,7 @@
ownerTab,
openerTab,
pinned,
@@ -319,7 +320,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
bulkOrderedOpen,
tabGroup: tabGroup ?? openerTab?.group,
});
@@ -3037,6 +3148,7 @@
@@ -3037,6 +3149,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -327,7 +328,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}));
if (focusUrlBar) {
@@ -3161,6 +3273,12 @@
@@ -3161,6 +3274,12 @@
}
}
@@ -340,7 +341,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// Additionally send pinned tab events
if (pinned) {
this.#notifyPinnedStatus(t);
@@ -3375,6 +3493,7 @@
@@ -3375,6 +3494,7 @@
isAdoptingGroup = false,
isUserTriggered = false,
telemetryUserCreateSource = "unknown",
@@ -348,7 +349,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} = {}
) {
if (
@@ -3385,9 +3504,6 @@
@@ -3385,9 +3505,6 @@
!this.isSplitViewWrapper(tabOrSplitView)
)
) {
@@ -358,7 +359,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
if (!color) {
@@ -3408,9 +3524,14 @@
@@ -3408,9 +3525,14 @@
label,
isAdoptingGroup
);
@@ -375,7 +376,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
);
group.addTabs(tabsAndSplitViews);
@@ -3531,7 +3652,7 @@
@@ -3531,7 +3653,7 @@
}
this.#handleTabMove(tab, () =>
@@ -384,7 +385,15 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
);
}
@@ -3746,6 +3867,7 @@
@@ -3599,6 +3721,7 @@
color: group.color,
insertBefore: newTabs[0],
isAdoptingGroup: true,
+ forSplitView: group.hasAttribute('split-view-group'),
});
}
@@ -3746,6 +3869,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -392,7 +401,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
) {
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
@@ -3815,6 +3937,7 @@
@@ -3815,6 +3939,7 @@
openWindowInfo,
name,
skipLoad,
@@ -400,7 +409,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
});
}
@@ -4003,7 +4126,7 @@
@@ -4003,7 +4128,7 @@
// Add a new tab if needed.
if (!tab) {
let createLazyBrowser =
@@ -409,7 +418,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let url = "about:blank";
if (tabData.entries?.length) {
@@ -4040,8 +4163,10 @@
@@ -4040,8 +4165,10 @@
insertTab: false,
skipLoad: true,
preferredRemoteType,
@@ -421,7 +430,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (select) {
tabToSelect = tab;
}
@@ -4053,7 +4178,8 @@
@@ -4053,7 +4180,8 @@
this.pinTab(tab);
// Then ensure all the tab open/pinning information is sent.
this._fireTabOpen(tab, {});
@@ -431,7 +440,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group
@@ -4067,7 +4193,10 @@
@@ -4067,7 +4195,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
@@ -443,7 +452,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -4112,9 +4241,23 @@
@@ -4112,9 +4243,23 @@
// to remove the old selected tab.
if (tabToSelect) {
let leftoverTab = this.selectedTab;
@@ -459,15 +468,15 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
+ gZenWorkspaces._initialTab._shouldRemove = true;
+ }
+ }
}
+ }
+ else {
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
+ }
}
+ this._hasAlreadyInitializedZenSessionStore = true;
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -4305,11 +4448,14 @@
@@ -4305,11 +4450,14 @@
if (ownerTab) {
tab.owner = ownerTab;
}
@@ -483,7 +492,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -4321,7 +4467,7 @@
@@ -4321,7 +4469,7 @@
let lastRelatedTab =
openerTab && this._lastRelatedTabMap.get(openerTab);
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
@@ -492,7 +501,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
tabGroup = previousTab.group;
}
if (
@@ -4337,7 +4483,7 @@
@@ -4337,7 +4485,7 @@
previousTab.splitview
) + 1;
} else if (previousTab.visible) {
@@ -501,7 +510,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else if (previousTab == FirefoxViewHandler.tab) {
elementIndex = 0;
}
@@ -4365,14 +4511,14 @@
@@ -4365,14 +4513,14 @@
}
// Ensure index is within bounds.
if (tab.pinned) {
@@ -520,7 +529,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (pinned && !itemAfter?.pinned) {
itemAfter = null;
@@ -4385,7 +4531,7 @@
@@ -4385,7 +4533,7 @@
this.tabContainer._invalidateCachedTabs();
@@ -529,7 +538,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
this.isSplitViewWrapper(itemAfter)
@@ -4416,7 +4562,11 @@
@@ -4416,7 +4564,11 @@
const tabContainer = pinned
? this.tabContainer.pinnedTabsContainer
: this.tabContainer;
@@ -541,7 +550,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
if (tab.group?.collapsed) {
@@ -4431,6 +4581,7 @@
@@ -4431,6 +4583,7 @@
if (pinned) {
this._updateTabBarForPinnedTabs();
}
@@ -549,7 +558,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
TabBarVisibility.update();
}
@@ -4983,6 +5134,7 @@
@@ -4983,6 +5136,7 @@
telemetrySource,
} = {}
) {
@@ -557,7 +566,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
@@ -5072,6 +5224,7 @@
@@ -5072,6 +5226,7 @@
if (lastToClose) {
this.removeTab(lastToClose, aParams);
}
@@ -565,7 +574,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} catch (e) {
console.error(e);
}
@@ -5110,6 +5263,12 @@
@@ -5110,6 +5265,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
}
@@ -578,7 +587,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -5124,6 +5283,9 @@
@@ -5124,6 +5285,9 @@
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
let isLastTab = this.#isLastTabInWindow(aTab);
@@ -588,7 +597,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -5172,7 +5334,13 @@
@@ -5172,7 +5336,13 @@
// We're not animating, so we can cancel the animation stopwatch.
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
aTab._closeTimeAnimTimerId = null;
@@ -603,7 +612,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
return;
}
@@ -5306,7 +5474,7 @@
@@ -5306,7 +5476,7 @@
closeWindowWithLastTab != null
? closeWindowWithLastTab
: !window.toolbar.visible ||
@@ -612,7 +621,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -5330,6 +5498,7 @@
@@ -5330,6 +5500,7 @@
newTab = true;
}
@@ -620,7 +629,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -5370,13 +5539,7 @@
@@ -5370,13 +5541,7 @@
aTab._mouseleave();
if (newTab) {
@@ -635,7 +644,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else {
TabBarVisibility.update();
}
@@ -5509,6 +5672,7 @@
@@ -5509,6 +5674,7 @@
this.tabs[i]._tPos = i;
}
@@ -643,7 +652,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (!this._windowIsClosing) {
// update tab close buttons state
this.tabContainer._updateCloseButtons();
@@ -5732,6 +5896,7 @@
@@ -5732,6 +5898,7 @@
}
let excludeTabs = new Set(aExcludeTabs);
@@ -651,7 +660,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// If this tab has a successor, it should be selectable, since
// hiding or closing a tab removes that tab as a successor.
@@ -5744,15 +5909,22 @@
@@ -5744,15 +5911,22 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -676,7 +685,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let tab = this.tabContainer.findNextTab(aTab, {
direction: 1,
filter: _tab => remainingTabs.includes(_tab),
@@ -5766,7 +5938,7 @@
@@ -5766,7 +5940,7 @@
}
if (tab) {
@@ -685,7 +694,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5787,7 +5959,7 @@
@@ -5787,7 +5961,7 @@
});
}
@@ -694,7 +703,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
_blurTab(aTab) {
@@ -5798,7 +5970,7 @@
@@ -5798,7 +5972,7 @@
* @returns {boolean}
* False if swapping isn't permitted, true otherwise.
*/
@@ -703,7 +712,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// Do not allow transfering a private tab to a non-private window
// and vice versa.
if (
@@ -5852,6 +6024,7 @@
@@ -5852,6 +6026,7 @@
// fire the beforeunload event in the process. Close the other
// window if this was its last tab.
if (
@@ -711,7 +720,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
!remoteBrowser._beginRemoveTab(aOtherTab, {
adoptedByTab: aOurTab,
closeWindowWithLastTab: true,
@@ -5863,7 +6036,7 @@
@@ -5863,7 +6038,7 @@
// If this is the last tab of the window, hide the window
// immediately without animation before the docshell swap, to avoid
// about:blank being painted.
@@ -720,7 +729,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (closeWindow) {
let win = aOtherTab.ownerGlobal;
win.windowUtils.suppressAnimation(true);
@@ -5987,11 +6160,13 @@
@@ -5987,11 +6162,13 @@
}
// Finish tearing down the tab that's going away.
@@ -734,7 +743,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
this.setTabTitle(aOurTab);
@@ -6193,10 +6368,10 @@
@@ -6193,10 +6370,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -747,7 +756,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -6254,7 +6429,8 @@
@@ -6254,7 +6431,8 @@
*
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
*/
@@ -757,7 +766,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (this.tabs.length == 1) {
return null;
}
@@ -6278,12 +6454,14 @@
@@ -6278,12 +6456,14 @@
}
// tell a new window to take the "dropped" tab
@@ -773,7 +782,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
/**
@@ -6388,7 +6566,7 @@
@@ -6388,7 +6568,7 @@
* `true` if element is a `<tab-group>`
*/
isTabGroup(element) {
@@ -782,7 +791,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
}
/**
@@ -6473,8 +6651,8 @@
@@ -6473,8 +6653,8 @@
}
// Don't allow mixing pinned and unpinned tabs.
@@ -793,7 +802,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
}
@@ -6500,10 +6678,16 @@
@@ -6500,10 +6680,16 @@
this.#handleTabMove(
element,
() => {
@@ -812,7 +821,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
@@ -6561,23 +6745,31 @@
@@ -6561,23 +6747,31 @@
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
if (this.isTabGroupLabel(targetElement)) {
targetElement = targetElement.group;
@@ -850,7 +859,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else if (!element.pinned && targetElement && targetElement.pinned) {
// If the caller asks to move an unpinned element next to a pinned
// tab, move the unpinned element to be the first unpinned element
@@ -6590,14 +6782,34 @@
@@ -6590,14 +6784,34 @@
// move the tab group right before the first unpinned tab.
// 4. Moving a tab group and the first unpinned tab is grouped:
// move the tab group right before the first unpinned tab's tab group.
@@ -886,7 +895,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
element.pinned
? this.tabContainer.pinnedTabsContainer
: this.tabContainer;
@@ -6606,7 +6818,7 @@
@@ -6606,7 +6820,7 @@
element,
() => {
if (moveBefore) {
@@ -895,7 +904,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
} else if (targetElement) {
targetElement.after(element);
} else {
@@ -6676,10 +6888,10 @@
@@ -6676,10 +6890,10 @@
* @param {TabMetricsContext} [metricsContext]
*/
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
@@ -908,7 +917,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6751,6 +6963,7 @@
@@ -6751,6 +6965,7 @@
let state = {
tabIndex: tab._tPos,
@@ -916,7 +925,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
};
if (tab.visible) {
state.elementIndex = tab.elementIndex;
@@ -6777,7 +6990,7 @@
@@ -6777,7 +6992,7 @@
let changedTabGroup =
previousTabState.tabGroupId != currentTabState.tabGroupId;
@@ -925,7 +934,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
tab.dispatchEvent(
new CustomEvent("TabMove", {
bubbles: true,
@@ -6818,6 +7031,10 @@
@@ -6818,6 +7033,10 @@
moveActionCallback();
@@ -936,11 +945,11 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -6869,6 +7086,19 @@
@@ -6869,6 +7088,18 @@
* The new tab in the current window, null if the tab couldn't be adopted.
*/
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
+ if (window.gZenWorkspaces.currentWindowIsSyncing === aTab.ownerGlobal.gZenWorkspaces.currentWindowIsSyncing) {
+ if (window.gZenWorkspaces.currentWindowIsSyncing && aTab.ownerGlobal.gZenWorkspaces?.currentWindowIsSyncing) {
+ const tabId = aTab.id;
+ const thisTab = window.gZenWindowSync.getItemFromWindow(window, tabId);
+ if (thisTab) {
@@ -951,12 +960,11 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
+ }
+ return thisTab;
+ }
+ return;
+ }
// Swap the dropped tab with a new one we create and then close
// it in the other window (making it seem to have moved between
// windows). We also ensure that the tab we create to swap into has
@@ -6910,6 +7140,8 @@
@@ -6910,6 +7141,8 @@
params.userContextId = aTab.getAttribute("usercontextid");
}
let newTab = this.addWebTab("about:blank", params);
@@ -965,7 +973,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let newBrowser = this.getBrowserForTab(newTab);
aTab.container.tabDragAndDrop.finishAnimateTabMove();
@@ -7718,7 +7950,7 @@
@@ -7718,7 +7951,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -974,7 +982,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
window.focus();
aEvent.preventDefault();
break;
@@ -7735,7 +7967,6 @@
@@ -7735,7 +7968,6 @@
}
case "TabGroupCollapse":
aEvent.target.tabs.forEach(tab => {
@@ -982,7 +990,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
});
break;
case "TabGroupCreateByUser":
@@ -7895,7 +8126,9 @@
@@ -7895,7 +8127,9 @@
let filter = this._tabFilters.get(tab);
if (filter) {
@@ -992,7 +1000,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
let listener = this._tabListeners.get(tab);
if (listener) {
@@ -8698,6 +8931,7 @@
@@ -8698,6 +8932,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -1000,7 +1008,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8778,6 +9012,7 @@
@@ -8778,6 +9013,7 @@
// known defaults. Note we use the original URL since about:newtab
// redirects to a prerendered page.
const shouldRemoveFavicon =
@@ -1008,7 +1016,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
!this.mBrowser.mIconURL &&
!ignoreBlank &&
!(originalLocation.spec in FAVICON_DEFAULTS);
@@ -9803,7 +10038,7 @@ var TabContextMenu = {
@@ -9803,7 +10039,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;

View File

@@ -124,6 +124,9 @@ export class nsZenMenuBar {
}
#hideWindowRestoreMenus() {
if (!Services.prefs.getBoolPref("zen.window-sync.enabled", true)) {
return;
}
const itemsToHide = ["appMenuRecentlyClosedWindows", "historyUndoWindowMenu"];
for (const id of itemsToHide) {
const element = PanelMultiView.getViewNode(document, id);

View File

@@ -87,7 +87,6 @@ class ZenStartup {
await delayedStartupPromise;
await SessionStore.promiseAllWindowsRestored;
delete gZenUIManager.promiseInitialized;
this.#initSearchBar();
gZenCompactModeManager.init();
// Fix for https://github.com/zen-browser/desktop/issues/7605, specially in compact mode
if (gURLBar.hasAttribute("breakout-extend")) {
@@ -154,11 +153,6 @@ class ZenStartup {
}
}
#initSearchBar() {
// Only focus the url bar
gURLBar.focus();
}
#checkForWelcomePage() {
if (!Services.prefs.getBoolPref("zen.welcome-screen.seen", false)) {
Services.prefs.setBoolPref("zen.welcome-screen.seen", true);

View File

@@ -891,8 +891,8 @@ window.gZenVerticalTabsManager = {
marginBottom: isLastItem() ? ["0px", "0px"] : [transform, "0px"],
},
{
duration: 0.11,
easing: "ease-out",
duration: 0.075,
easing: "easeOut",
}
)
.then(() => {})
@@ -913,8 +913,8 @@ window.gZenVerticalTabsManager = {
filter: ["blur(1px)", "blur(0px)"],
},
{
duration: 0.11,
easing: "ease-out",
duration: 0.075,
easing: "easeOut",
}
)
.then(() => {})
@@ -949,7 +949,7 @@ window.gZenVerticalTabsManager = {
},
{
duration: 0.075,
easing: "ease-out",
easing: "easeOut",
}
);
},
@@ -1362,7 +1362,7 @@ window.gZenVerticalTabsManager = {
// Check if name is blank, reset if so
// Always remove, so we can always rename and if it's empty,
// it will reset to the original name anyway
if (hasChanged) {
if (hasChanged || (this._tabEdited.zenStaticLabel && newName)) {
this._tabEdited.zenStaticLabel = newName;
gBrowser._setTabLabel(this._tabEdited, newName);
gZenUIManager.showToast("zen-tabs-renamed");

View File

@@ -61,6 +61,9 @@
.zen-pseudo-browser-image {
position: absolute;
transform: scale(1);
width: 100%;
height: 100%;
inset: 0;
opacity: 0.4;
pointer-events: none;

View File

@@ -743,6 +743,10 @@ window.gZenCompactModeManager = {
return;
}
if (this._isTabBeingDragged) {
return;
}
if (this.hoverableElements[i].keepHoverDuration) {
this.flashElement(
target,

View File

@@ -12,6 +12,7 @@
#zen-dragover-background {
width: calc(100% - var(--zen-toolbox-padding) * 2 - 5px);
left: unset;
transform: translateY(-4px);
}
#zen-tabbox-wrapper {

View File

@@ -105,7 +105,7 @@
startTabDrag(event, tab, ...args) {
this.ZenDragAndDropService.onDragStart(1);
gZenCompactModeManager._isTabBeingDragged = true;
super.startTabDrag(event, tab, ...args);
const dt = event.dataTransfer;
if (isTabGroupLabel(tab)) {
@@ -117,9 +117,7 @@
this.originalDragImageArgs = [dragImage, offsetX, offsetY];
dt.setDragImage(...this.originalDragImageArgs);
if (tab.hasAttribute("zen-essential")) {
setTimeout(() => {
tab.style.visibility = "hidden";
}, 0);
tab.style.visibility = "hidden";
}
}
@@ -680,6 +678,7 @@
clientX < 0 || clientX > innerWidth || clientY < 0 || clientY > innerHeight;
if (isOutOfWindow && !this.#isOutOfWindow) {
this.#isOutOfWindow = true;
gZenViewSplitter.onBrowserDragEndToSplit(event, true);
this.#maybeClearVerticalPinnedGridDragOver();
this.clearSpaceSwitchTimer();
this.clearDragOverVisuals();
@@ -718,20 +717,22 @@
const dt = event.dataTransfer;
const activeWorkspace = gZenWorkspaces.activeWorkspace;
let draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
if (
isTab(draggedTab) &&
!draggedTab.hasAttribute("zen-essential") &&
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
) {
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
for (let tab of movingTabs) {
tab.setAttribute("zen-workspace-id", activeWorkspace);
if (draggedTab.ownerGlobal === window) {
if (
isTab(draggedTab) &&
!draggedTab.hasAttribute("zen-essential") &&
draggedTab.getAttribute("zen-workspace-id") != activeWorkspace
) {
const movingTabs = draggedTab._dragData?.movingTabs || [draggedTab];
for (let tab of movingTabs) {
tab.setAttribute("zen-workspace-id", activeWorkspace);
}
gBrowser.selectedTab = draggedTab;
}
if (isTabGroupLabel(draggedTab)) {
draggedTab = draggedTab.group;
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
}
gBrowser.selectedTab = draggedTab;
}
if (isTabGroupLabel(draggedTab)) {
draggedTab = draggedTab.group;
gZenFolders.changeFolderToSpace(draggedTab, activeWorkspace, { hasDndSwitch: true });
}
gZenWorkspaces.updateTabsContainers();
}
@@ -874,6 +875,10 @@
this._tempDragImageParent.remove();
delete this._tempDragImageParent;
}
delete gZenCompactModeManager._isTabBeingDragged;
if (dt.dropEffect !== "move") {
gZenCompactModeManager._clearAllHoverStates();
}
}
#applyDragOverBackground(element) {
@@ -926,7 +931,7 @@
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
let lastTab = gBrowser.tabs.at(-1);
dropElement =
(hoveringPeriphery
(hoveringPeriphery && Services.prefs.getBoolPref("zen.view.show-newtab-button-top")
? this._tabbrowserTabs.ariaFocusableItems.at(
gBrowser._numVisiblePinTabsWithoutCollapsed
)
@@ -973,11 +978,11 @@
(possibleFolderElement.collapsed ||
possibleFolderElement.childGroupsAndTabs.length < 2)));
if (
(isTabGroupLabel(draggedTab) &&
draggedTab.group?.isZenFolder &&
(isTab(dropElement) || dropElement.hasAttribute("split-view-group")) &&
isTabGroupLabel(draggedTab) &&
draggedTab.group?.isZenFolder &&
(((isTab(dropElement) || dropElement.hasAttribute("split-view-group")) &&
(!dropElement.pinned || dropElement.hasAttribute("zen-essential"))) ||
showIndicatorUnderNewTabButton
showIndicatorUnderNewTabButton)
) {
dropElement = null;
this.clearDragOverVisuals();

View File

@@ -1038,43 +1038,47 @@ class nsZenFolders extends nsZenDOMOperatedFeature {
const tabFolderWorkingData = new Map();
for (const folderData of data) {
const workingData = {
stateData: folderData,
node: null,
containingTabsFragment: document.createDocumentFragment(),
};
tabFolderWorkingData.set(folderData.id, workingData);
try {
const workingData = {
stateData: folderData,
node: null,
containingTabsFragment: document.createDocumentFragment(),
};
tabFolderWorkingData.set(folderData.id, workingData);
const oldGroup = document.getElementById(folderData.id);
folderData.emptyTabIds.forEach((id) => {
oldGroup?.querySelector(`tab[id="${id}"]`)?.setAttribute("zen-empty-tab", true);
});
if (gBrowser.isTabGroup(oldGroup)) {
if (!folderData.splitViewGroup) {
const folder = this._createFolderNode({
id: folderData.id,
label: folderData.name,
collapsed: folderData.collapsed,
pinned: folderData.pinned,
saveOnWindowClose: folderData.saveOnWindowClose,
workspaceId: folderData.workspaceId,
});
folder.setAttribute("id", folderData.id);
workingData.node = folder;
oldGroup.before(folder);
} else {
workingData.node = oldGroup;
}
while (oldGroup.tabs.length) {
const tab = oldGroup.tabs[0];
if (folderData.workspaceId) {
tab.setAttribute("zen-workspace-id", folderData.workspaceId);
const oldGroup = document.getElementById(folderData.id);
folderData.emptyTabIds.forEach((id) => {
oldGroup?.querySelector(`tab[id="${id}"]`)?.setAttribute("zen-empty-tab", true);
});
if (gBrowser.isTabGroup(oldGroup)) {
if (!folderData.splitViewGroup) {
const folder = this._createFolderNode({
id: folderData.id,
label: folderData.name,
collapsed: folderData.collapsed,
pinned: folderData.pinned,
saveOnWindowClose: folderData.saveOnWindowClose,
workspaceId: folderData.workspaceId,
});
folder.setAttribute("id", folderData.id);
workingData.node = folder;
oldGroup.before(folder);
} else {
workingData.node = oldGroup;
}
while (oldGroup.tabs.length) {
const tab = oldGroup.tabs[0];
if (folderData.workspaceId) {
tab.setAttribute("zen-workspace-id", folderData.workspaceId);
}
workingData.containingTabsFragment.appendChild(tab);
}
if (!folderData.splitViewGroup) {
oldGroup.remove();
}
workingData.containingTabsFragment.appendChild(tab);
}
if (!folderData.splitViewGroup) {
oldGroup.remove();
}
} catch (e) {
console.error("Error restoring Zen Folders session data:", e);
}
}

View File

@@ -640,7 +640,6 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
left: [],
width: [],
height: [],
transform: [],
};
const steps = this.#ARC_CONFIG.ARC_STEPS;
@@ -674,7 +673,6 @@ class nsZenGlanceManager extends nsZenDOMOperatedFeature {
const y =
startPosition.y + distanceY * eased + arcDirection * arcHeight * (1 - (2 * eased - 1) ** 2);
sequence.transform.push(`translate(-50%, -50%)`);
sequence.top.push(`${y}px`);
sequence.left.push(`${x}px`);
sequence.width.push(`${currentWidth}px`);

View File

@@ -800,6 +800,10 @@ class nsZenKeyboardShortcutsLoader {
continue;
}
let parsed = KeyShortcut.parseFromXHTML(key, { group: "devTools" });
// Move "inspector" shortcut to use "L" key instead of "I"
if (parsed.getID() == "key_inspector" || parsed.getID() == "key_inspectorMac") {
parsed.setNewBinding("L");
}
newShortcutList.push(parsed);
}
@@ -1109,7 +1113,7 @@ class nsZenKeyboardShortcutsVersioner {
if (version < 15) {
// Migrate from version 13 to 14
// Add shortcut to open a new unsynced window: Default accelt+option+N (Ctrl+Alt+N on non-macOS)
// Add shortcut to open a new unsynced window: Default accelt+shift+N
data.push(
new KeyShortcut(
"zen-new-unsynced-window",

View File

@@ -84,6 +84,7 @@ export class nsZenSessionManager {
compression: "lz4",
backupFile,
});
this.log("Session file path:", this.#file.path);
this.#deferredBackupTask = new lazy.DeferredTask(async () => {
await this.#createBackupsIfNeeded();
}, REGENERATION_DEBOUNCE_RATE_MS);
@@ -150,6 +151,19 @@ export class nsZenSessionManager {
folderIcon: row.getResultByName("folder_icon"),
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
}));
try {
data.recoveryData = await IOUtils.readJSON(
PathUtils.join(
Services.dirsvc.get("ProfD", Ci.nsIFile).path,
"sessionstore-backups",
"recovery.jsonlz4"
),
{ decompress: true }
);
this.log("Recovered recovery data from sessionstore-backups");
} catch {
/* ignore errors reading recovery data */
}
this._migrationData = data;
} catch {
/* ignore errors during migration */
@@ -165,6 +179,7 @@ export class nsZenSessionManager {
async readFile() {
let fileExists = await IOUtils.exists(this.#storeFilePath);
if (!fileExists) {
this.log("Session file does not exist, running migration", this.#storeFilePath);
this._shouldRunMigration = true;
}
this.init();
@@ -181,6 +196,7 @@ export class nsZenSessionManager {
}
this.#sidebar = this.#file.data || {};
if (!this.#sidebar.spaces?.length && !this._shouldRunMigration) {
this.log("No spaces data found in session file, running migration", this.#sidebar);
// If we have no spaces data, we should run migration
// to restore them from the database. Note we also do a
// check if we already planned to run migration for optimization.
@@ -189,6 +205,13 @@ export class nsZenSessionManager {
}
}
get #shouldRestoreOnlyPinned() {
return (
Services.prefs.getIntPref("browser.startup.page", 1) !== BROWSER_STARTUP_RESUME_SESSION ||
lazy.PrivateBrowsingUtils.permanentPrivateBrowsing
);
}
/**
* Called when the session file is read. Restores the sidebar data
* into all windows.
@@ -197,9 +220,6 @@ export class nsZenSessionManager {
* The initial session state read from the session file.
*/
onFileRead(initialState) {
if (!lazy.gWindowSyncEnabled) {
return initialState;
}
// For the first time after migration, we restore the tabs
// That where going to be restored by SessionStore. The sidebar
// object will always be empty after migration because we haven't
@@ -207,6 +227,16 @@ export class nsZenSessionManager {
if (this._shouldRunMigration) {
initialState = this.#runStateMigration(initialState);
}
if (!lazy.gWindowSyncEnabled) {
if (initialState?.windows?.length && this.#shouldRestoreOnlyPinned) {
this.log("Window sync disabled, restoring only pinned tabs");
for (let i = 0; i < initialState.windows.length; i++) {
let winData = initialState.windows[i];
winData.tabs = (winData.tabs || []).filter((tab) => tab.pinned);
}
}
return initialState;
}
// If there are no windows, we create an empty one. By default,
// firefox would create simply a new empty window, but we want
// to make sure that the sidebar object is properly initialized.
@@ -223,10 +253,7 @@ export class nsZenSessionManager {
}
// When we don't have browser.startup.page set to resume session,
// we only want to restore the pinned tabs into the new windows.
const shouldRestoreOnlyPinned =
Services.prefs.getIntPref("browser.startup.page", 1) !== BROWSER_STARTUP_RESUME_SESSION ||
lazy.PrivateBrowsingUtils.permanentPrivateBrowsing;
if (shouldRestoreOnlyPinned && this.#sidebar?.tabs) {
if (this.#shouldRestoreOnlyPinned && this.#sidebar?.tabs) {
this.log("Restoring only pinned tabs into windows");
const sidebar = this.#sidebar;
sidebar.tabs = (sidebar.tabs || []).filter((tab) => tab.pinned);
@@ -253,9 +280,9 @@ export class nsZenSessionManager {
}
this.#restoreWindowData(winData);
}
} else {
} else if (initialState) {
this.log("Saving windata state after migration");
this.saveState(initialState);
this.saveState(Cu.cloneInto(initialState, {}));
}
delete this._shouldRunMigration;
return initialState;
@@ -276,8 +303,19 @@ export class nsZenSessionManager {
* @param {object} initialState
* The initial session state read from the session file.
*/
// eslint-disable-next-line complexity
#runStateMigration(initialState) {
this.log("Restoring tabs from Places DB after migration", initialState, this._migrationData);
this.log(
"Restoring tabs from Places DB after migration",
initialState,
initialState?.lastSessionState,
this._migrationData
);
if (!initialState?.windows?.length && this._migrationData?.recoveryData) {
this.log("Using recovery data for migration");
initialState = this._migrationData.recoveryData;
}
delete this._migrationData?.recoveryData;
// Restore spaces into the sidebar object if we don't
// have any yet.
if (!this.#sidebar.spaces?.length) {
@@ -286,6 +324,12 @@ export class nsZenSessionManager {
spaces: this._migrationData?.spaces || [],
};
}
if (
!initialState?.windows?.length &&
(initialState?.lastSessionState || initialState?.deferredInitialState)
) {
initialState = { ...(initialState.lastSessionState || initialState.deferredInitialState) };
}
// There might be cases where there are no windows in the
// initial state, for example if the user had 'restore previous
// session' disabled before migration. In that case, we try
@@ -321,9 +365,6 @@ export class nsZenSessionManager {
}
}
}
// Save the state to the sidebar object so that it gets written
// to the session file.
delete this._migrationData;
return initialState;
}
@@ -345,7 +386,7 @@ export class nsZenSessionManager {
saveState(state) {
let windows = state?.windows || [];
windows = windows.filter((win) => this.#isWindowSaveable(win));
if (!windows.length || !lazy.gWindowSyncEnabled) {
if (!windows.length) {
// Don't save (or even collect) anything in permanent private
// browsing mode. We also don't want to save if there are no windows.
return;
@@ -525,7 +566,7 @@ export class nsZenSessionManager {
* Whether this new window is being restored from a closed window.
*/
restoreNewWindow(aWindow, SessionStoreInternal, fromClosedWindow = false) {
if (aWindow.gZenWorkspaces?.privateWindowOrDisabled || !lazy.gWindowSyncEnabled) {
if (aWindow.gZenWorkspaces?.privateWindowOrDisabled) {
return;
}
this.log("Restoring new window with Zen session data");
@@ -543,6 +584,10 @@ export class nsZenSessionManager {
this.#restoreWindowData(newWindow);
}
newWindow.tabs = this.#filterUnusedTabs(newWindow.tabs || []);
if (!lazy.gWindowSyncEnabled) {
// Don't bring over any unpinned tabs if window sync is disabled.
newWindow.tabs = newWindow.tabs.filter((tab) => tab.pinned);
}
// These are window-specific from the previous window state that
// we don't want to restore into the new window. Otherwise, new

View File

@@ -17,7 +17,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gWindowSyncEnabled", "zen.window-sync.enabled");
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gWindowSyncEnabled", "zen.window-sync.enabled", true);
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gShouldLog", "zen.window-sync.log", true);
const OBSERVING = ["browser-window-before-show", "sessionstore-windows-restored"];
@@ -140,7 +140,7 @@ class nsZenWindowSync {
}
init() {
if (!lazy.gWindowSyncEnabled || this.#initialized) {
if (this.#initialized) {
return;
}
this.#initialized = true;
@@ -309,6 +309,9 @@ class nsZenWindowSync {
) {
return;
}
if (!lazy.gWindowSyncEnabled && !UNSYNCED_WINDOW_EVENTS.includes(aEvent.type)) {
return;
}
if (INSTANT_EVENTS.includes(aEvent.type)) {
this.#handleNextEvent(aEvent);
return;
@@ -514,7 +517,11 @@ class nsZenWindowSync {
*/
#moveItemToMatchOriginal(aOriginalItem, aTargetItem, aWindow, { isEssential, isPinned }) {
const { gBrowser, gZenWorkspaces } = aWindow;
const originalSibling = aOriginalItem.previousElementSibling;
let originalSibling = aOriginalItem.previousElementSibling;
if (originalSibling?.classList.contains("space-fake-collapsible-start")) {
// Skip space fake elements.
originalSibling = originalSibling.previousElementSibling;
}
let isFirstTab = true;
if (gBrowser.isTabGroup(originalSibling) || gBrowser.isTab(originalSibling)) {
isFirstTab =
@@ -1084,7 +1091,7 @@ class nsZenWindowSync {
}
tab._zenContentsVisible = true;
tab.id = this.#newTabSyncId;
if (isUnsyncedWindow) {
if (isUnsyncedWindow || !lazy.gWindowSyncEnabled) {
return;
}
this.#runOnAllWindows(window, (win) => {
@@ -1168,6 +1175,9 @@ class nsZenWindowSync {
}
on_focus(aEvent) {
if (typeof aEvent.target !== "object") {
return;
}
const { ownerGlobal: window } = aEvent.target;
if (
!window?.gBrowser ||

View File

@@ -2093,45 +2093,53 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
this._sessionRestoring = true;
for (const groupData of data) {
const group = document.getElementById(groupData.groupId);
if (!gBrowser.isTabGroup(group)) {
continue;
}
// Backwards compatibility
group.setAttribute("split-view-group", "true");
if (!groupData?.layoutTree) {
this.splitTabs(group.tabs, group.gridType);
delete this._sessionRestoring;
return;
}
const deserializeNode = (nodeData) => {
if (nodeData.type === "leaf") {
const tab = document.getElementById(nodeData.tabId);
if (!tab) {
return null;
}
return new nsSplitLeafNode(tab, nodeData.sizeInParent);
try {
const group = document.getElementById(groupData.groupId);
if (!gBrowser.isTabGroup(group)) {
continue;
}
const splitter = new nsSplitNode(nodeData.direction, nodeData.sizeInParent);
splitter._children = [];
for (const childData of nodeData.children) {
const childNode = deserializeNode(childData);
if (childNode) {
childNode.parent = splitter;
splitter._children.push(childNode);
}
// Backwards compatibility
group.setAttribute("split-view-group", "true");
if (!groupData?.layoutTree) {
this.splitTabs(group.tabs, group.gridType);
delete this._sessionRestoring;
return;
}
return splitter;
};
const deserializeNode = (nodeData) => {
if (nodeData.type === "leaf") {
const tab = document.getElementById(nodeData.tabId);
if (!tab) {
return null;
}
return new nsSplitLeafNode(tab, nodeData.sizeInParent);
}
const layout = deserializeNode(groupData.layoutTree);
const splitData = this.splitTabs(group.tabs, groupData.gridType, -1);
splitData.layoutTree = layout;
const splitter = new nsSplitNode(nodeData.direction, nodeData.sizeInParent);
splitter._children = [];
for (const childData of nodeData.children) {
const childNode = deserializeNode(childData);
if (childNode) {
childNode.parent = splitter;
splitter._children.push(childNode);
}
}
return splitter;
};
const layout = deserializeNode(groupData.layoutTree);
const splitData = this.splitTabs(group.tabs, groupData.gridType, -1);
if (splitData) {
splitData.layoutTree = layout;
} else {
gBrowser.removeTabGroup(group);
}
} catch (e) {
console.error("Error restoring split view session data:", e);
}
}
delete this._sessionRestoring;

View File

@@ -76,6 +76,17 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
this._zenClickEventListener = this._onTabClick.bind(this);
gZenWorkspaces._resolvePinnedInitialized();
if (lazy.zenPinnedTabRestorePinnedTabsToPinnedUrl) {
gZenWorkspaces.promiseInitialized.then(() => {
for (const tab of gZenWorkspaces.allStoredTabs) {
try {
this.resetPinnedTab(tab);
} catch (ex) {
console.error("Error restoring pinned tab:", ex);
}
}
});
}
}
log(message) {
@@ -162,7 +173,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
this._resetTabToStoredState(tab);
}
async replacePinnedUrlWithCurrent(tab = undefined) {
replacePinnedUrlWithCurrent(tab = undefined) {
tab ??= TabContextMenu.contextTab;
if (!tab || !tab.pinned) {
return;
@@ -566,8 +577,8 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
}
movingTabs = movingTabs.filter((tab) =>
gBrowser.isTabGroupLabel(tab)
? tab.group?.isZenFolder && !tabsTarget && !essentialTabsTarget
gBrowser.isTabGroupLabel(tab) && tab.group?.isZenFolder
? !tabsTarget && !essentialTabsTarget
: true
);
@@ -592,7 +603,10 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
let isRegularTabs = false;
// Check for essentials container
if (essentialTabsTarget) {
if (!draggedTab.hasAttribute("zen-essential") && !draggedTab?.group) {
if (
!draggedTab.hasAttribute("zen-essential") &&
!draggedTab?.group?.hasAttribute("split-view-group")
) {
moved = true;
isVertical = false;
hasActuallyMoved = this.addToEssentials(draggedTab);

View File

@@ -682,6 +682,13 @@ async function testFileAccessWindowsOnly() {
let tests = [];
let extDir = GetPerUserExtensionDir();
// We used to unconditionally create this directory from Firefox, but that
// was dropped in bug 2001887. The value of this directory is questionable;
// the test was added in Firefox 56 (bug 1403744) to cover legacy add-ons,
// but legacy add-on support was discontinued in Firefox 57, and we stopped
// sideloading add-ons from this directory on all builds except ESR in
// Firefox 74 (bug 1602840).
await IOUtils.makeDirectory(extDir.path);
tests.push({
desc: "per-user extensions dir",
ok: true,

View File

@@ -22,6 +22,13 @@ add_setup(async function setup() {
const xdgConfigHome = Services.env.get("XDG_CONFIG_HOME");
Assert.greater(xdgConfigHome.length, 1, "XDG_CONFIG_HOME is defined");
// Verify the profile directory is inside XDG_CONFIG_HOME
const profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
Assert.ok(
profileDir.path.startsWith(xdgConfigHome),
`Profile directory (${profileDir.path}) should be inside XDG_CONFIG_HOME (${xdgConfigHome})`
);
// If it is there, do actual testing
sanityChecks();
});

View File

@@ -12,11 +12,14 @@ support-files = [
"browser_content_sandbox_utils.js",
"browser_content_sandbox_fs_tests.js",
]
# .config needs to exists for the sandbox to properly add it
test-directories = ["/tmp/.xdg_default_test", "/tmp/.xdg_default_test/.config"]
test-directories = [
"/tmp/.xdg_default_test",
"/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile",
]
environment = [
"HOME=/tmp/.xdg_default_test",
]
profile-path = "/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile"
["browser_content_sandbox_fs_xdg_default.js"]
run-if = ["os == 'linux'"]

View File

@@ -12,12 +12,17 @@ support-files = [
"browser_content_sandbox_utils.js",
"browser_content_sandbox_fs_tests.js",
]
test-directories = ["/tmp/.xdg_mozLegacyHome_test/.config", "/tmp/.xdg_config_home_test"]
test-directories = [
"/tmp/.xdg_mozLegacyHome_test/.config",
"/tmp/.xdg_config_home_test",
"/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile",
]
environment = [
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
"HOME=/tmp/.xdg_mozLegacyHome_test",
"MOZ_LEGACY_HOME=1",
]
profile-path = "/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile"
["browser_content_sandbox_fs_xdg_mozLegacyHome.js"]
run-if = ["os == 'linux'"]

View File

@@ -11,11 +11,15 @@ support-files = [
"browser_content_sandbox_utils.js",
"browser_content_sandbox_fs_tests.js",
]
test-directories = "/tmp/.xdg_config_home_test"
test-directories = [
"/tmp/.xdg_config_home_test",
"/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile",
]
environment = [
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
"MOZ_LEGACY_HOME=0",
]
profile-path = "/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile"
["browser_content_sandbox_fs_xdg_xdgConfigHome.js"]
run-if = [

View File

@@ -1348,7 +1348,8 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
}
getToolbarColor(isDarkMode = false) {
return isDarkMode ? [255, 255, 255, 0.6] : [0, 0, 0, 0.6]; // Default toolbar
const opacity = 0.8;
return isDarkMode ? [255, 255, 255, opacity] : [0, 0, 0, opacity]; // Default toolbar
}
onWorkspaceChange(workspace, skipUpdate = false, theme = null) {

View File

@@ -6,6 +6,12 @@
import { nsZenThemePicker } from "chrome://browser/content/zen-components/ZenGradientGenerator.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ZenSessionStore: "resource:///modules/zen/ZenSessionManager.sys.mjs",
});
/**
* Zen Spaces manager. This class is mainly responsible for the UI
* and user interactions but it also contains some logic to manage
@@ -801,7 +807,7 @@ class nsZenWorkspaces {
chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MENUBAR;
return this._shouldHaveWorkspaces;
}
return this._shouldHaveWorkspaces;
return this._shouldHaveWorkspaces && !document.documentElement.hasAttribute("taskbartab");
}
get isPrivateWindow() {
@@ -888,6 +894,13 @@ class nsZenWorkspaces {
return Promise.resolve();
}
const spacesFromStore = aWinData.spaces || [];
if (
!this.privateWindowOrDisabled &&
spacesFromStore.length === 0 &&
lazy.ZenSessionStore._migrationData
) {
spacesFromStore.push(...lazy.ZenSessionStore._migrationData.spaces);
}
this._workspaceCache = spacesFromStore.length
? [...spacesFromStore]
: [this.#createWorkspaceData("Space", undefined)];
@@ -1031,11 +1044,17 @@ class nsZenWorkspaces {
delete this._initialTab;
}
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
BrowserCommands.openTab();
} else if (!showed) {
gBrowser.selectedBrowser.focus();
}
// Wait for the next event loop to ensure that the startup focus logic by
// firefox has finished doing it's thing.
setTimeout(() => {
setTimeout(() => {
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
BrowserCommands.openTab();
} else if (!showed) {
gBrowser.selectedBrowser.focus();
}
});
});
if (
!gZenVerticalTabsManager._canReplaceNewTab &&

View File

@@ -5,8 +5,8 @@
"binaryName": "zen",
"version": {
"product": "firefox",
"version": "147.0.1",
"candidate": "147.0.1",
"version": "147.0.2",
"candidate": "147.0.2",
"candidateBuild": 1
},
"buildOptions": {
@@ -20,7 +20,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.18.1b",
"displayVersion": "1.18.3b",
"github": {
"repo": "zen-browser/desktop"
},
@@ -54,4 +54,4 @@
"licenseType": "MPL-2.0"
},
"updateHostname": "updates.zen-browser.app"
}
}