mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-28 15:46:16 +00:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35a9a9ea2a | ||
|
|
e78e2488ff | ||
|
|
1c23ad92b3 | ||
|
|
32ba6ef81b | ||
|
|
a8559f84c1 | ||
|
|
0e07f65bc0 | ||
|
|
4046dd01a1 | ||
|
|
e51592898e | ||
|
|
9afbd1befd | ||
|
|
ccc1e998da | ||
|
|
3a51b36a05 | ||
|
|
e05cb0e0dc | ||
|
|
a892721306 | ||
|
|
950f6dfb66 | ||
|
|
9b6937650d | ||
|
|
2c63376782 | ||
|
|
f5356dbcb6 | ||
|
|
45ecacfb04 | ||
|
|
4327684f9f | ||
|
|
8997a24996 | ||
|
|
5a6a565b0f | ||
|
|
d39fff2e4a | ||
|
|
ab12e72cc5 | ||
|
|
8a2e015048 | ||
|
|
83de087b0b | ||
|
|
5dea28a3cb | ||
|
|
956841a76e | ||
|
|
3f03ffb27b |
@@ -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
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
783b222b1b93fb9e8c52eb57558ef7f07bca6e7e
|
||||
7712a9ac90683965f71be525fe2827467632715d
|
||||
@@ -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
|
||||
|
||||
@@ -23,4 +23,4 @@ zen-menubar-appearance-dark =
|
||||
.label = Dark
|
||||
|
||||
zen-menubar-new-unsynced-window =
|
||||
.label = New Blank Window
|
||||
.label = New blank window
|
||||
@@ -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
|
||||
|
||||
@@ -1193,6 +1193,11 @@ Preferences.addAll([
|
||||
type: "bool",
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
id: "zen.tabs.select-recently-used-on-close",
|
||||
type: "bool",
|
||||
default: true,
|
||||
},
|
||||
]);
|
||||
|
||||
Preferences.addSetting({
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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..2ab8633d0378e5a25cf75c50b29d4689b5f65e94 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -398,6 +398,7 @@
|
||||
@@ -384,7 +384,15 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3746,6 +3867,7 @@
|
||||
@@ -3599,6 +3720,7 @@
|
||||
color: group.color,
|
||||
insertBefore: newTabs[0],
|
||||
isAdoptingGroup: true,
|
||||
+ forSplitView: group.hasAttribute('split-view-group'),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3746,6 +3868,7 @@
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
triggeringRemoteType,
|
||||
@@ -392,7 +400,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 +3938,7 @@
|
||||
openWindowInfo,
|
||||
name,
|
||||
skipLoad,
|
||||
@@ -400,7 +408,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4003,7 +4126,7 @@
|
||||
@@ -4003,7 +4127,7 @@
|
||||
// Add a new tab if needed.
|
||||
if (!tab) {
|
||||
let createLazyBrowser =
|
||||
@@ -409,7 +417,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
|
||||
let url = "about:blank";
|
||||
if (tabData.entries?.length) {
|
||||
@@ -4040,8 +4163,10 @@
|
||||
@@ -4040,8 +4164,10 @@
|
||||
insertTab: false,
|
||||
skipLoad: true,
|
||||
preferredRemoteType,
|
||||
@@ -421,7 +429,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -4053,7 +4178,8 @@
|
||||
@@ -4053,7 +4179,8 @@
|
||||
this.pinTab(tab);
|
||||
// Then ensure all the tab open/pinning information is sent.
|
||||
this._fireTabOpen(tab, {});
|
||||
@@ -431,7 +439,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 +4194,10 @@
|
||||
tabGroup.stateData.id,
|
||||
tabGroup.stateData.color,
|
||||
tabGroup.stateData.collapsed,
|
||||
@@ -443,7 +451,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
);
|
||||
tabsFragment.appendChild(tabGroup.node);
|
||||
}
|
||||
@@ -4112,9 +4241,23 @@
|
||||
@@ -4112,9 +4242,23 @@
|
||||
// to remove the old selected tab.
|
||||
if (tabToSelect) {
|
||||
let leftoverTab = this.selectedTab;
|
||||
@@ -467,7 +475,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
this._updateTabsAfterInsert();
|
||||
@@ -4305,11 +4448,14 @@
|
||||
@@ -4305,11 +4449,14 @@
|
||||
if (ownerTab) {
|
||||
tab.owner = ownerTab;
|
||||
}
|
||||
@@ -483,7 +491,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (
|
||||
!bulkOrderedOpen &&
|
||||
((openerTab &&
|
||||
@@ -4321,7 +4467,7 @@
|
||||
@@ -4321,7 +4468,7 @@
|
||||
let lastRelatedTab =
|
||||
openerTab && this._lastRelatedTabMap.get(openerTab);
|
||||
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
|
||||
@@ -492,7 +500,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
tabGroup = previousTab.group;
|
||||
}
|
||||
if (
|
||||
@@ -4337,7 +4483,7 @@
|
||||
@@ -4337,7 +4484,7 @@
|
||||
previousTab.splitview
|
||||
) + 1;
|
||||
} else if (previousTab.visible) {
|
||||
@@ -501,7 +509,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
} else if (previousTab == FirefoxViewHandler.tab) {
|
||||
elementIndex = 0;
|
||||
}
|
||||
@@ -4365,14 +4511,14 @@
|
||||
@@ -4365,14 +4512,14 @@
|
||||
}
|
||||
// Ensure index is within bounds.
|
||||
if (tab.pinned) {
|
||||
@@ -520,7 +528,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
|
||||
if (pinned && !itemAfter?.pinned) {
|
||||
itemAfter = null;
|
||||
@@ -4385,7 +4531,7 @@
|
||||
@@ -4385,7 +4532,7 @@
|
||||
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
|
||||
@@ -529,7 +537,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (
|
||||
(this.isTab(itemAfter) && itemAfter.group == tabGroup) ||
|
||||
this.isSplitViewWrapper(itemAfter)
|
||||
@@ -4416,7 +4562,11 @@
|
||||
@@ -4416,7 +4563,11 @@
|
||||
const tabContainer = pinned
|
||||
? this.tabContainer.pinnedTabsContainer
|
||||
: this.tabContainer;
|
||||
@@ -541,7 +549,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
}
|
||||
|
||||
if (tab.group?.collapsed) {
|
||||
@@ -4431,6 +4581,7 @@
|
||||
@@ -4431,6 +4582,7 @@
|
||||
if (pinned) {
|
||||
this._updateTabBarForPinnedTabs();
|
||||
}
|
||||
@@ -549,7 +557,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
|
||||
TabBarVisibility.update();
|
||||
}
|
||||
@@ -4983,6 +5134,7 @@
|
||||
@@ -4983,6 +5135,7 @@
|
||||
telemetrySource,
|
||||
} = {}
|
||||
) {
|
||||
@@ -557,7 +565,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 +5225,7 @@
|
||||
if (lastToClose) {
|
||||
this.removeTab(lastToClose, aParams);
|
||||
}
|
||||
@@ -565,7 +573,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -5110,6 +5263,12 @@
|
||||
@@ -5110,6 +5264,12 @@
|
||||
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
|
||||
}
|
||||
|
||||
@@ -578,7 +586,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -5124,6 +5283,9 @@
|
||||
@@ -5124,6 +5284,9 @@
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
let isLastTab = this.#isLastTabInWindow(aTab);
|
||||
@@ -588,7 +596,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -5172,7 +5334,13 @@
|
||||
@@ -5172,7 +5335,13 @@
|
||||
// We're not animating, so we can cancel the animation stopwatch.
|
||||
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
|
||||
aTab._closeTimeAnimTimerId = null;
|
||||
@@ -603,7 +611,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5306,7 +5474,7 @@
|
||||
@@ -5306,7 +5475,7 @@
|
||||
closeWindowWithLastTab != null
|
||||
? closeWindowWithLastTab
|
||||
: !window.toolbar.visible ||
|
||||
@@ -612,7 +620,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 +5499,7 @@
|
||||
|
||||
newTab = true;
|
||||
}
|
||||
@@ -620,7 +628,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||
|
||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||
@@ -5370,13 +5539,7 @@
|
||||
@@ -5370,13 +5540,7 @@
|
||||
aTab._mouseleave();
|
||||
|
||||
if (newTab) {
|
||||
@@ -635,7 +643,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
} else {
|
||||
TabBarVisibility.update();
|
||||
}
|
||||
@@ -5509,6 +5672,7 @@
|
||||
@@ -5509,6 +5673,7 @@
|
||||
this.tabs[i]._tPos = i;
|
||||
}
|
||||
|
||||
@@ -643,7 +651,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (!this._windowIsClosing) {
|
||||
// update tab close buttons state
|
||||
this.tabContainer._updateCloseButtons();
|
||||
@@ -5732,6 +5896,7 @@
|
||||
@@ -5732,6 +5897,7 @@
|
||||
}
|
||||
|
||||
let excludeTabs = new Set(aExcludeTabs);
|
||||
@@ -651,7 +659,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 +5910,22 @@
|
||||
!excludeTabs.has(aTab.owner) &&
|
||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||
) {
|
||||
@@ -676,7 +684,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
let tab = this.tabContainer.findNextTab(aTab, {
|
||||
direction: 1,
|
||||
filter: _tab => remainingTabs.includes(_tab),
|
||||
@@ -5766,7 +5938,7 @@
|
||||
@@ -5766,7 +5939,7 @@
|
||||
}
|
||||
|
||||
if (tab) {
|
||||
@@ -685,7 +693,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
}
|
||||
|
||||
// If no qualifying visible tab was found, see if there is a tab in
|
||||
@@ -5787,7 +5959,7 @@
|
||||
@@ -5787,7 +5960,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -694,7 +702,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
}
|
||||
|
||||
_blurTab(aTab) {
|
||||
@@ -5798,7 +5970,7 @@
|
||||
@@ -5798,7 +5971,7 @@
|
||||
* @returns {boolean}
|
||||
* False if swapping isn't permitted, true otherwise.
|
||||
*/
|
||||
@@ -703,7 +711,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 +6025,7 @@
|
||||
// fire the beforeunload event in the process. Close the other
|
||||
// window if this was its last tab.
|
||||
if (
|
||||
@@ -711,7 +719,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
!remoteBrowser._beginRemoveTab(aOtherTab, {
|
||||
adoptedByTab: aOurTab,
|
||||
closeWindowWithLastTab: true,
|
||||
@@ -5863,7 +6036,7 @@
|
||||
@@ -5863,7 +6037,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 +728,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (closeWindow) {
|
||||
let win = aOtherTab.ownerGlobal;
|
||||
win.windowUtils.suppressAnimation(true);
|
||||
@@ -5987,11 +6160,13 @@
|
||||
@@ -5987,11 +6161,13 @@
|
||||
}
|
||||
|
||||
// Finish tearing down the tab that's going away.
|
||||
@@ -734,7 +742,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
|
||||
this.setTabTitle(aOurTab);
|
||||
|
||||
@@ -6193,10 +6368,10 @@
|
||||
@@ -6193,10 +6369,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
}
|
||||
|
||||
@@ -747,7 +755,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 +6430,8 @@
|
||||
*
|
||||
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
|
||||
*/
|
||||
@@ -757,7 +765,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (this.tabs.length == 1) {
|
||||
return null;
|
||||
}
|
||||
@@ -6278,12 +6454,14 @@
|
||||
@@ -6278,12 +6455,14 @@
|
||||
}
|
||||
|
||||
// tell a new window to take the "dropped" tab
|
||||
@@ -773,7 +781,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6388,7 +6566,7 @@
|
||||
@@ -6388,7 +6567,7 @@
|
||||
* `true` if element is a `<tab-group>`
|
||||
*/
|
||||
isTabGroup(element) {
|
||||
@@ -782,7 +790,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6473,8 +6651,8 @@
|
||||
@@ -6473,8 +6652,8 @@
|
||||
}
|
||||
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
@@ -793,7 +801,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
} else {
|
||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||
}
|
||||
@@ -6500,10 +6678,16 @@
|
||||
@@ -6500,10 +6679,16 @@
|
||||
this.#handleTabMove(
|
||||
element,
|
||||
() => {
|
||||
@@ -812,7 +820,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||
neighbor.after(element);
|
||||
} else {
|
||||
@@ -6561,23 +6745,31 @@
|
||||
@@ -6561,23 +6746,31 @@
|
||||
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
||||
if (this.isTabGroupLabel(targetElement)) {
|
||||
targetElement = targetElement.group;
|
||||
@@ -850,7 +858,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 +6783,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 +894,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
element.pinned
|
||||
? this.tabContainer.pinnedTabsContainer
|
||||
: this.tabContainer;
|
||||
@@ -6606,7 +6818,7 @@
|
||||
@@ -6606,7 +6819,7 @@
|
||||
element,
|
||||
() => {
|
||||
if (moveBefore) {
|
||||
@@ -895,7 +903,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
} else if (targetElement) {
|
||||
targetElement.after(element);
|
||||
} else {
|
||||
@@ -6676,10 +6888,10 @@
|
||||
@@ -6676,10 +6889,10 @@
|
||||
* @param {TabMetricsContext} [metricsContext]
|
||||
*/
|
||||
moveTabToExistingGroup(aTab, aGroup, metricsContext) {
|
||||
@@ -908,7 +916,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -6751,6 +6963,7 @@
|
||||
@@ -6751,6 +6964,7 @@
|
||||
|
||||
let state = {
|
||||
tabIndex: tab._tPos,
|
||||
@@ -916,7 +924,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
};
|
||||
if (tab.visible) {
|
||||
state.elementIndex = tab.elementIndex;
|
||||
@@ -6777,7 +6990,7 @@
|
||||
@@ -6777,7 +6991,7 @@
|
||||
let changedTabGroup =
|
||||
previousTabState.tabGroupId != currentTabState.tabGroupId;
|
||||
|
||||
@@ -925,7 +933,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
tab.dispatchEvent(
|
||||
new CustomEvent("TabMove", {
|
||||
bubbles: true,
|
||||
@@ -6818,6 +7031,10 @@
|
||||
@@ -6818,6 +7032,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
@@ -936,11 +944,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 +7087,19 @@
|
||||
* 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) {
|
||||
@@ -956,7 +964,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..9c1fa86151f3d5896c45fef31a141757
|
||||
// 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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -743,6 +743,10 @@ window.gZenCompactModeManager = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._isTabBeingDragged) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.hoverableElements[i].keepHoverDuration) {
|
||||
this.flashElement(
|
||||
target,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#zen-dragover-background {
|
||||
width: calc(100% - var(--zen-toolbox-padding) * 2 - 5px);
|
||||
left: unset;
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
|
||||
#zen-tabbox-wrapper {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,6 +872,10 @@
|
||||
this._tempDragImageParent.remove();
|
||||
delete this._tempDragImageParent;
|
||||
}
|
||||
delete gZenCompactModeManager._isTabBeingDragged;
|
||||
if (dt.dropEffect !== "move") {
|
||||
gZenCompactModeManager._clearAllHoverStates();
|
||||
}
|
||||
}
|
||||
|
||||
#applyDragOverBackground(element) {
|
||||
@@ -973,11 +975,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();
|
||||
|
||||
@@ -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`);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
@@ -165,6 +166,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 +183,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 +192,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 +207,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 +214,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 +240,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 +267,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 +290,14 @@ 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
|
||||
);
|
||||
// Restore spaces into the sidebar object if we don't
|
||||
// have any yet.
|
||||
if (!this.#sidebar.spaces?.length) {
|
||||
@@ -286,6 +306,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 +347,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 +368,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 +548,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 +566,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
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -2131,7 +2131,11 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
|
||||
|
||||
const layout = deserializeNode(groupData.layoutTree);
|
||||
const splitData = this.splitTabs(group.tabs, groupData.gridType, -1);
|
||||
splitData.layoutTree = layout;
|
||||
if (splitData) {
|
||||
splitData.layoutTree = layout;
|
||||
} else {
|
||||
gBrowser.removeTabGroup(group);
|
||||
}
|
||||
}
|
||||
|
||||
delete this._sessionRestoring;
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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'"]
|
||||
|
||||
@@ -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'"]
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
@@ -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)];
|
||||
|
||||
@@ -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.2b",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
},
|
||||
@@ -54,4 +54,4 @@
|
||||
"licenseType": "MPL-2.0"
|
||||
},
|
||||
"updateHostname": "updates.zen-browser.app"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user