mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 09:26:34 +00:00
Added zen essentials!
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
|
||||
index 26f5671c849d9b0a126d79b07bc7d3d7870826ec..366e3693001eb1c2fce0443f1dd196cccd3ed846 100644
|
||||
index 26f5671c849d9b0a126d79b07bc7d3d7870826ec..36b535321f17a4e3dfdfdbb677a4e4b869038154 100644
|
||||
--- a/browser/components/sessionstore/TabState.sys.mjs
|
||||
+++ b/browser/components/sessionstore/TabState.sys.mjs
|
||||
@@ -98,6 +98,12 @@ var TabStateInternal = {
|
||||
@@ -98,6 +98,13 @@ var TabStateInternal = {
|
||||
tabData.muteReason = tab.muteReason;
|
||||
}
|
||||
|
||||
+ tabData.zenWorkspace = tab.getAttribute("zen-workspace-id");
|
||||
+ tabData.zenPinnedId = tab.getAttribute("zen-pin-id");
|
||||
+ tabData.zenEssential = tab.getAttribute("zen-essential");
|
||||
+ tabData.zenDefaultUserContextId = tab.getAttribute("zenDefaultUserContextId");
|
||||
+ tabData.zenPinnedEntry = tab.getAttribute("zen-pinned-entry");
|
||||
+ tabData.zenPinnedIcon = tab.getAttribute("zen-pinned-icon");
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd521e1e4c 100644
|
||||
index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..06e24d8e165d3c2035f11dfc2c6d7d419137d490 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -462,11 +462,26 @@
|
||||
@@ -31,6 +31,15 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
}
|
||||
return i;
|
||||
},
|
||||
@@ -860,7 +875,7 @@
|
||||
if (this.tabContainer.verticalMode) {
|
||||
let wasFocused = document.activeElement == this.selectedTab;
|
||||
let oldPosition = aTab._tPos;
|
||||
- this.verticalPinnedTabsContainer.appendChild(aTab);
|
||||
+ aTab.hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(aTab) : this.verticalPinnedTabsContainer.appendChild(aTab);
|
||||
this._updateAfterMoveTabTo(aTab, oldPosition, wasFocused);
|
||||
} else {
|
||||
this.moveTabTo(aTab, this._numPinnedTabs);
|
||||
@@ -1346,6 +1361,7 @@
|
||||
if (!this._previewMode) {
|
||||
newTab.recordTimeFromUnloadToReload();
|
||||
@@ -79,7 +88,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
if (insertTab) {
|
||||
// insert the tab into the tab container in the correct position
|
||||
this._insertTabAtIndex(t, {
|
||||
@@ -3291,6 +3315,17 @@
|
||||
@@ -3291,6 +3315,20 @@
|
||||
) {
|
||||
tabWasReused = true;
|
||||
tab = this.selectedTab;
|
||||
@@ -90,6 +99,9 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
+ if (tabData.zenPinnedId) {
|
||||
+ tab.setAttribute("zen-pin-id", tabData.zenPinnedId);
|
||||
+ }
|
||||
+ if (tabData.zenEssential) {
|
||||
+ tab.setAttribute("zen-essential", "true");
|
||||
+ }
|
||||
+ if (tabData.zenDefaultUserContextId) {
|
||||
+ tab.setAttribute("zenDefaultUserContextId", "true");
|
||||
+ }
|
||||
@@ -97,7 +109,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
if (!tabData.pinned) {
|
||||
this.unpinTab(tab);
|
||||
} else {
|
||||
@@ -3304,6 +3339,9 @@
|
||||
@@ -3304,6 +3342,9 @@
|
||||
restoreTabsLazily && !select && !tabData.pinned;
|
||||
|
||||
let url = "about:blank";
|
||||
@@ -107,7 +119,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
if (tabData.entries?.length) {
|
||||
let activeIndex = (tabData.index || tabData.entries.length) - 1;
|
||||
// Ensure the index is in bounds.
|
||||
@@ -3340,6 +3378,15 @@
|
||||
@@ -3340,6 +3381,18 @@
|
||||
preferredRemoteType,
|
||||
});
|
||||
|
||||
@@ -117,13 +129,16 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
+ if (tabData.zenPinnedId) {
|
||||
+ tab.setAttribute("zen-pin-id", tabData.zenPinnedId);
|
||||
+ }
|
||||
+ if (tabData.zenEssential) {
|
||||
+ tab.setAttribute("zen-essential", "true");
|
||||
+ }
|
||||
+ if (tabData.zenDefaultUserContextId) {
|
||||
+ tab.setAttribute("zenDefaultUserContextId", "true");
|
||||
+ }
|
||||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -3374,7 +3421,6 @@
|
||||
@@ -3374,7 +3427,6 @@
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
}
|
||||
}
|
||||
@@ -131,7 +146,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
tab.initialize();
|
||||
}
|
||||
|
||||
@@ -4148,6 +4194,13 @@
|
||||
@@ -4148,6 +4200,13 @@
|
||||
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
|
||||
}
|
||||
|
||||
@@ -145,7 +160,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -4163,6 +4216,10 @@
|
||||
@@ -4163,6 +4222,10 @@
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
|
||||
@@ -156,7 +171,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -5123,10 +5180,10 @@
|
||||
@@ -5123,10 +5186,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
},
|
||||
|
||||
@@ -169,7 +184,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
aTab.selected ||
|
||||
aTab.closing ||
|
||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||
@@ -7042,6 +7099,7 @@
|
||||
@@ -7042,6 +7105,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
@@ -177,7 +192,7 @@ index 14de79b543cf07b04d06ef5a3f94d9aa988ea39a..4ff11ec41543e4ab2b4aa96548db60fd
|
||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
gBrowser.syncThrobberAnimations(this.mTab);
|
||||
@@ -7874,7 +7932,7 @@ var TabContextMenu = {
|
||||
@@ -7874,7 +7938,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !multiselectionContext;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||
index f3a2f226a9056c5a75023281fdeb704cec49b4a6..6864f4011676e2c114bacc4b55adca470b97b2a8 100644
|
||||
index f3a2f226a9056c5a75023281fdeb704cec49b4a6..39c46b141145864fb3b8043d2a9865299561a6cc 100644
|
||||
--- a/browser/components/tabbrowser/content/tabs.js
|
||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||
@@ -894,7 +894,7 @@
|
||||
@@ -20,6 +20,15 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..6864f4011676e2c114bacc4b55adca47
|
||||
postTransitionCleanup();
|
||||
} else {
|
||||
let onTransitionEnd = transitionendEvent => {
|
||||
@@ -1284,7 +1284,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- let allChildren = [...verticalPinnedTabsContainer.children, ...children];
|
||||
+ let allChildren = [...document.getElementById("zen-essentials-container").children, ...verticalPinnedTabsContainer.children, ...children];
|
||||
this._allTabs = allChildren;
|
||||
return allChildren;
|
||||
}
|
||||
@@ -1480,7 +1480,7 @@
|
||||
let rect = ele => {
|
||||
return window.windowUtils.getBoundsWithoutFlushing(ele);
|
||||
@@ -63,7 +72,7 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..6864f4011676e2c114bacc4b55adca47
|
||||
if (!isEndTab) {
|
||||
// keep tabs the same width
|
||||
tab.style.transition = "none";
|
||||
@@ -1630,9 +1632,9 @@
|
||||
@@ -1630,13 +1632,13 @@
|
||||
let verticalTabsContainer = document.getElementById(
|
||||
"vertical-pinned-tabs-container"
|
||||
);
|
||||
@@ -75,6 +84,11 @@ index f3a2f226a9056c5a75023281fdeb704cec49b4a6..6864f4011676e2c114bacc4b55adca47
|
||||
let tabs = this._getVisibleTabs();
|
||||
for (let i = 0; i < numPinned; i++) {
|
||||
tabs[i].style.marginInlineStart = "";
|
||||
- verticalTabsContainer.appendChild(tabs[i]);
|
||||
+ tabs[i].hasAttribute("zen-essential") ? document.getElementById("zen-essentials-container").appendChild(tabs[i]) : verticalTabsContainer.appendChild(tabs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1660,7 +1662,7 @@
|
||||
|
||||
_positionPinnedTabs() {
|
||||
|
Reference in New Issue
Block a user