Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e079732686 | ||
|
|
71f2680eef | ||
|
|
808a376c65 | ||
|
|
eff7cfc5fe | ||
|
|
bbb6ba4078 | ||
|
|
c10131aca8 | ||
|
|
49159a6d5c | ||
|
|
d80ba6b058 | ||
|
|
f2e188a86c | ||
|
|
2f03446c37 |
@@ -12,6 +12,10 @@ pref("browser.urlbar.untrimOnUserInteraction.featureGate", true);
|
||||
// Keep in sync with browser/components/topsites/constants.mjs
|
||||
pref("browser.urlbar.maxRichResults", 7);
|
||||
|
||||
// Enable private suggestions
|
||||
pref('browser.search.suggest.enabled', false);
|
||||
pref('browser.search.suggest.enabled.private', false);
|
||||
|
||||
pref("browser.urlbar.trimHttps", true);
|
||||
pref("browser.search.separatePrivateDefault.ui.enabled", true);
|
||||
pref("browser.urlbar.update2.engineAliasRefresh", true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a5d0924e5 100644
|
||||
index 6dece2b9d0462d90a28e75350ce983d87816ef73..fdcfd020326b45eb23cbe74d0ce53a06c17cde8a 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -415,11 +415,45 @@
|
||||
@@ -232,17 +232,20 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
}));
|
||||
|
||||
if (focusUrlBar) {
|
||||
@@ -2898,6 +2966,9 @@
|
||||
@@ -2898,6 +2966,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (typeof window.gZenVerticalTabsManager !== "undefined") {
|
||||
+ gZenVerticalTabsManager.animateTab(t);
|
||||
+ }
|
||||
+ if (typeof window.gZenCompactModeManager !== "undefined" && !skipLoad && insertTab) {
|
||||
+ gZenCompactModeManager._onTabOpen(t, inBackground);
|
||||
+ }
|
||||
// Additionally send pinned tab events
|
||||
if (pinned) {
|
||||
this._notifyPinnedStatus(t);
|
||||
@@ -2945,12 +3016,15 @@
|
||||
@@ -2945,12 +3019,15 @@
|
||||
* @param {string} [label=]
|
||||
* @returns {MozTabbrowserTabGroup}
|
||||
*/
|
||||
@@ -259,7 +262,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
return group;
|
||||
}
|
||||
|
||||
@@ -2993,6 +3067,7 @@
|
||||
@@ -2993,6 +3070,7 @@
|
||||
insertBefore = null,
|
||||
isUserTriggered = false,
|
||||
telemetryUserCreateSource = "unknown",
|
||||
@@ -267,7 +270,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
} = {}
|
||||
) {
|
||||
if (!tabs?.length) {
|
||||
@@ -3011,7 +3086,12 @@
|
||||
@@ -3011,7 +3089,12 @@
|
||||
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
||||
}
|
||||
let group = this._createTabGroup(id, color, false, label);
|
||||
@@ -281,7 +284,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
group,
|
||||
insertBefore?.group ?? insertBefore
|
||||
);
|
||||
@@ -3342,6 +3422,7 @@
|
||||
@@ -3342,6 +3425,7 @@
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
triggeringRemoteType,
|
||||
@@ -289,7 +292,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
}
|
||||
) {
|
||||
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
||||
@@ -3411,6 +3492,7 @@
|
||||
@@ -3411,6 +3495,7 @@
|
||||
openWindowInfo,
|
||||
name,
|
||||
skipLoad,
|
||||
@@ -297,7 +300,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3599,7 +3681,7 @@
|
||||
@@ -3599,7 +3684,7 @@
|
||||
// Add a new tab if needed.
|
||||
if (!tab) {
|
||||
let createLazyBrowser =
|
||||
@@ -306,7 +309,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
|
||||
let url = "about:blank";
|
||||
if (tabData.entries?.length) {
|
||||
@@ -3638,6 +3720,27 @@
|
||||
@@ -3638,6 +3723,27 @@
|
||||
preferredRemoteType,
|
||||
});
|
||||
|
||||
@@ -334,7 +337,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -3661,7 +3764,8 @@
|
||||
@@ -3661,7 +3767,8 @@
|
||||
// needs calling:
|
||||
shouldUpdateForPinnedTabs = true;
|
||||
}
|
||||
@@ -344,7 +347,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
let { groupId } = tabData;
|
||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||
// if a tab refers to a tab group we don't know, skip any group
|
||||
@@ -3675,7 +3779,10 @@
|
||||
@@ -3675,7 +3782,10 @@
|
||||
tabGroup.stateData.id,
|
||||
tabGroup.stateData.color,
|
||||
tabGroup.stateData.collapsed,
|
||||
@@ -356,7 +359,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
);
|
||||
tabsFragment.appendChild(tabGroup.node);
|
||||
}
|
||||
@@ -3723,8 +3830,21 @@
|
||||
@@ -3723,8 +3833,21 @@
|
||||
// to remove the old selected tab.
|
||||
if (tabToSelect) {
|
||||
let leftoverTab = this.selectedTab;
|
||||
@@ -378,7 +381,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
}
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
@@ -3912,7 +4032,7 @@
|
||||
@@ -3912,7 +4035,7 @@
|
||||
// Ensure we have an index if one was not provided.
|
||||
if (typeof index != "number") {
|
||||
// Move the new tab after another tab if needed, to the end otherwise.
|
||||
@@ -387,7 +390,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (
|
||||
!bulkOrderedOpen &&
|
||||
((openerTab &&
|
||||
@@ -3935,7 +4055,7 @@
|
||||
@@ -3935,7 +4058,7 @@
|
||||
) {
|
||||
index = Infinity;
|
||||
} else if (previousTab.visible) {
|
||||
@@ -396,7 +399,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
} else if (previousTab == FirefoxViewHandler.tab) {
|
||||
index = 0;
|
||||
}
|
||||
@@ -3958,18 +4078,18 @@
|
||||
@@ -3958,18 +4081,18 @@
|
||||
|
||||
// Ensure index is within bounds.
|
||||
if (tab.pinned) {
|
||||
@@ -419,7 +422,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
|
||||
// Place at the front of, or between tabs in, the same tab group
|
||||
this.tabContainer.insertBefore(tab, itemAfter);
|
||||
@@ -4290,6 +4410,9 @@
|
||||
@@ -4290,6 +4413,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -429,7 +432,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
this.removeTabs(selectedTabs, { telemetrySource });
|
||||
}
|
||||
|
||||
@@ -4542,6 +4665,7 @@
|
||||
@@ -4542,6 +4668,7 @@
|
||||
telemetrySource,
|
||||
} = {}
|
||||
) {
|
||||
@@ -437,7 +440,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
||||
// can be considered equivalent to closing the window.
|
||||
if (
|
||||
@@ -4626,6 +4750,7 @@
|
||||
@@ -4626,6 +4753,7 @@
|
||||
if (lastToClose) {
|
||||
this.removeTab(lastToClose, aParams);
|
||||
}
|
||||
@@ -445,7 +448,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -4650,6 +4775,7 @@
|
||||
@@ -4650,6 +4778,7 @@
|
||||
telemetrySource,
|
||||
} = {}
|
||||
) {
|
||||
@@ -453,12 +456,12 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.finish("browser.tabs.opening", window);
|
||||
}
|
||||
@@ -4663,6 +4789,12 @@
|
||||
@@ -4663,6 +4792,12 @@
|
||||
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
|
||||
}
|
||||
|
||||
+ if (ZenWorkspaces.workspaceEnabled) {
|
||||
+ let newTab = ZenWorkspaces.handleTabBeforeClose(aTab);
|
||||
+ let newTab = ZenWorkspaces.handleTabBeforeClose(aTab, closeWindowWithLastTab);
|
||||
+ if (newTab) {
|
||||
+ this.selectedTab = newTab;
|
||||
+ }
|
||||
@@ -466,7 +469,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -4677,7 +4809,9 @@
|
||||
@@ -4677,7 +4812,9 @@
|
||||
// frame created for it (for example, by updating the visually selected
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
@@ -477,7 +480,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -4840,7 +4974,7 @@
|
||||
@@ -4840,7 +4977,7 @@
|
||||
closeWindowWithLastTab != null
|
||||
? closeWindowWithLastTab
|
||||
: !window.toolbar.visible ||
|
||||
@@ -486,7 +489,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
|
||||
if (closeWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
@@ -4864,6 +4998,7 @@
|
||||
@@ -4864,6 +5001,7 @@
|
||||
|
||||
newTab = true;
|
||||
}
|
||||
@@ -494,7 +497,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||
|
||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||
@@ -4903,9 +5038,7 @@
|
||||
@@ -4903,9 +5041,7 @@
|
||||
aTab._mouseleave();
|
||||
|
||||
if (newTab) {
|
||||
@@ -505,7 +508,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
} else {
|
||||
TabBarVisibility.update();
|
||||
}
|
||||
@@ -5034,6 +5167,8 @@
|
||||
@@ -5034,6 +5170,8 @@
|
||||
this.tabs[i]._tPos = i;
|
||||
}
|
||||
|
||||
@@ -514,7 +517,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (!this._windowIsClosing) {
|
||||
if (wasPinned) {
|
||||
this.tabContainer._positionPinnedTabs();
|
||||
@@ -5159,8 +5294,8 @@
|
||||
@@ -5159,8 +5297,8 @@
|
||||
return closedCount;
|
||||
}
|
||||
|
||||
@@ -525,7 +528,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (unloadBlocked) {
|
||||
return;
|
||||
}
|
||||
@@ -5248,6 +5383,7 @@
|
||||
@@ -5248,6 +5386,7 @@
|
||||
}
|
||||
|
||||
let excludeTabs = new Set(aExcludeTabs);
|
||||
@@ -533,7 +536,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
|
||||
// If this tab has a successor, it should be selectable, since
|
||||
// hiding or closing a tab removes that tab as a successor.
|
||||
@@ -5260,13 +5396,13 @@
|
||||
@@ -5260,13 +5399,13 @@
|
||||
!excludeTabs.has(aTab.owner) &&
|
||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||
) {
|
||||
@@ -549,7 +552,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
);
|
||||
|
||||
let tab = this.tabContainer.findNextTab(aTab, {
|
||||
@@ -5282,7 +5418,7 @@
|
||||
@@ -5282,7 +5421,7 @@
|
||||
}
|
||||
|
||||
if (tab) {
|
||||
@@ -558,7 +561,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
}
|
||||
|
||||
// If no qualifying visible tab was found, see if there is a tab in
|
||||
@@ -5303,7 +5439,7 @@
|
||||
@@ -5303,7 +5442,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -567,7 +570,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
}
|
||||
|
||||
_blurTab(aTab) {
|
||||
@@ -5704,10 +5840,10 @@
|
||||
@@ -5704,10 +5843,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
}
|
||||
|
||||
@@ -580,7 +583,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
aTab.selected ||
|
||||
aTab.closing ||
|
||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||
@@ -6001,7 +6137,7 @@
|
||||
@@ -6001,7 +6140,7 @@
|
||||
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (this.isTab(element) && element.pinned) {
|
||||
@@ -589,7 +592,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
} else {
|
||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||
}
|
||||
@@ -6028,9 +6164,16 @@
|
||||
@@ -6028,9 +6167,16 @@
|
||||
element,
|
||||
() => {
|
||||
let neighbor = this.tabs[tabIndex];
|
||||
@@ -607,7 +610,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||
neighbor.after(element);
|
||||
} else {
|
||||
@@ -6099,7 +6242,9 @@
|
||||
@@ -6099,7 +6245,9 @@
|
||||
targetElement = targetElement.group;
|
||||
}
|
||||
}
|
||||
@@ -618,7 +621,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (element.pinned && !targetElement?.pinned) {
|
||||
targetElement = this.tabs[this.pinnedTabCount - 1];
|
||||
@@ -6109,7 +6254,13 @@
|
||||
@@ -6109,7 +6257,13 @@
|
||||
moveBefore = true;
|
||||
}
|
||||
|
||||
@@ -632,7 +635,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
if (element.pinned && this.tabContainer.verticalMode) {
|
||||
return this.tabContainer.verticalPinnedTabsContainer;
|
||||
}
|
||||
@@ -6169,7 +6320,7 @@
|
||||
@@ -6169,7 +6323,7 @@
|
||||
if (!this.isTab(aTab)) {
|
||||
throw new Error("Can only move a tab into a tab group");
|
||||
}
|
||||
@@ -641,7 +644,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -6263,6 +6414,10 @@
|
||||
@@ -6263,6 +6417,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
@@ -652,7 +655,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -7080,7 +7235,7 @@
|
||||
@@ -7080,7 +7238,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
@@ -661,7 +664,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -7981,6 +8136,7 @@
|
||||
@@ -7981,6 +8139,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
@@ -669,7 +672,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -8954,7 +9110,7 @@ var TabContextMenu = {
|
||||
@@ -8954,7 +9113,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
@@ -678,7 +681,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..f191c26b73be69880eb16a83006a9e2a
|
||||
// Move Tab items
|
||||
let contextMoveTabOptions = document.getElementById(
|
||||
"context_moveTabOptions"
|
||||
@@ -9223,6 +9379,7 @@ var TabContextMenu = {
|
||||
@@ -9223,6 +9382,7 @@ var TabContextMenu = {
|
||||
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
|
||||
});
|
||||
} else {
|
||||
|
||||
23
src/testing/mochitest/browser-test-js.patch
Normal file
23
src/testing/mochitest/browser-test-js.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js
|
||||
index ef29179988bb37e7ea441aa051b692e3ccc90f21..7eade843ad62e47f90dc06a4a1fb88b6d1c1a583 100644
|
||||
--- a/testing/mochitest/browser-test.js
|
||||
+++ b/testing/mochitest/browser-test.js
|
||||
@@ -483,12 +483,12 @@ Tester.prototype = {
|
||||
|
||||
// Replace the last tab with a fresh one
|
||||
if (window.gBrowser && AppConstants.MOZ_APP_NAME != "thunderbird") {
|
||||
- gBrowser.addTab("about:blank", {
|
||||
- skipAnimation: true,
|
||||
- triggeringPrincipal:
|
||||
- Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
- });
|
||||
- gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||
+ // gBrowser.addTab("about:blank", {
|
||||
+ // skipAnimation: true,
|
||||
+ // triggeringPrincipal:
|
||||
+ // Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
+ // });
|
||||
+ // gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
|
||||
gBrowser.stop();
|
||||
}
|
||||
|
||||
@@ -350,6 +350,10 @@ menuitem {
|
||||
}
|
||||
|
||||
& .zen-toast {
|
||||
:root[zen-right-side='true'] & {
|
||||
translate: 100%;
|
||||
}
|
||||
|
||||
padding: 10px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(
|
||||
|
||||
@@ -48,7 +48,6 @@ var gZenCompactModeManager = {
|
||||
|
||||
// Clear hover states when window state changes (minimize, maximize, etc.)
|
||||
window.addEventListener('sizemodechange', () => this._clearAllHoverStates());
|
||||
window.addEventListener('TabOpen', this._onTabOpen.bind(this));
|
||||
|
||||
if (AppConstants.platform == 'macosx') {
|
||||
window.addEventListener('mouseover', (event) => {
|
||||
@@ -558,9 +557,8 @@ var gZenCompactModeManager = {
|
||||
);
|
||||
},
|
||||
|
||||
_onTabOpen(event) {
|
||||
const tab = event.target;
|
||||
if (!tab.selected && this.preference && !this.isSidebarPotentiallyOpen()) {
|
||||
async _onTabOpen(tab, inBackground) {
|
||||
if (inBackground && this.preference && !this.isSidebarPotentiallyOpen()) {
|
||||
gZenUIManager.showToast('zen-background-tab-opened-toast');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -106,7 +106,8 @@ var ZenPinnedTabsStorage = {
|
||||
`
|
||||
INSERT OR REPLACE INTO zen_pins (
|
||||
uuid, title, url, container_id, workspace_uuid, position,
|
||||
is_essential, is_group, parent_uuid, created_at, updated_at
|
||||
is_essential, is_group, parent_uuid, created_at, updated_at,
|
||||
edited_title
|
||||
) VALUES (
|
||||
:uuid, :title, :url, :container_id, :workspace_uuid, :position,
|
||||
:is_essential, :is_group, :parent_uuid, :edited_title,
|
||||
|
||||
@@ -1281,7 +1281,7 @@
|
||||
display: grid;
|
||||
|
||||
&[hidden='true'] {
|
||||
--hidden-essentials-width: var(--actual-zen-sidebar-width);
|
||||
--hidden-essentials-width: var(--zen-sidebar-width);
|
||||
max-width: var(--hidden-essentials-width) !important; /* To still allow essentials to grid the tabs */
|
||||
min-width: var(--hidden-essentials-width) !important;
|
||||
}
|
||||
@@ -1477,3 +1477,12 @@
|
||||
position: fixed; /* Fix position to prevent scrolling */
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Section: Workspaces disabled, due to private browsing mode
|
||||
========================================================================== */
|
||||
|
||||
:root:not([zen-workspace-id]) #tabbrowser-arrowscrollbox {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@@ -794,8 +794,14 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
return;
|
||||
}
|
||||
let showed = false;
|
||||
const cleanup = () => {
|
||||
delete this._tabToSelect;
|
||||
delete this._tabToRemoveForEmpty;
|
||||
};
|
||||
|
||||
if (this._initialTab) {
|
||||
if (this._initialTab._shouldRemove && this._initialTab._veryPossiblyEmpty) {
|
||||
this._removedByStartupPage = true;
|
||||
gBrowser.removeTab(this._initialTab, {
|
||||
skipSessionStore: true,
|
||||
animate: false,
|
||||
@@ -806,22 +812,32 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
gBrowser.moveTabTo(this._initialTab, { forceUngrouped: true, tabIndex: 0 });
|
||||
}
|
||||
delete this._initialTab;
|
||||
cleanup();
|
||||
} else if (this._tabToRemoveForEmpty) {
|
||||
if (gZenVerticalTabsManager._canReplaceNewTab) {
|
||||
if (this._tabToSelect) {
|
||||
gBrowser.tabbox.selectedIndex = this._tabToSelect;
|
||||
if (typeof this._tabToSelect === 'number' && this._tabToSelect >= 0) {
|
||||
setTimeout(() => {
|
||||
const tabs = gBrowser.tabs.filter((tab) => !tab.collapsed && !tab.hasAttribute('zen-empty-tab'));
|
||||
gBrowser.selectedTab = tabs[this._tabToSelect];
|
||||
this._removedByStartupPage = true;
|
||||
gBrowser.removeTab(this._tabToRemoveForEmpty, {
|
||||
skipSessionStore: true,
|
||||
animate: false,
|
||||
});
|
||||
cleanup();
|
||||
}, 0);
|
||||
} else {
|
||||
this.selectEmptyTab();
|
||||
showed = true;
|
||||
this._removedByStartupPage = true;
|
||||
gBrowser.removeTab(this._tabToRemoveForEmpty, {
|
||||
skipSessionStore: true,
|
||||
animate: false,
|
||||
});
|
||||
cleanup();
|
||||
}
|
||||
gBrowser.removeTab(this._tabToRemoveForEmpty, {
|
||||
skipSessionStore: true,
|
||||
animate: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
delete this._tabToSelect;
|
||||
delete this._tabToRemoveForEmpty;
|
||||
if (gZenVerticalTabsManager._canReplaceNewTab && showed) {
|
||||
BrowserCommands.openTab();
|
||||
}
|
||||
@@ -829,6 +845,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
handleInitialTab(tab, isEmpty) {
|
||||
if (gZenUIManager.testingEnabled) {
|
||||
return;
|
||||
}
|
||||
// note: We cant access `gZenVerticalTabsManager._canReplaceNewTab` this early
|
||||
if (isEmpty && Services.prefs.getBoolPref('zen.urlbar.replace-newtab', true)) {
|
||||
this._tabToRemoveForEmpty = tab;
|
||||
@@ -864,7 +883,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
) {
|
||||
// Remove any tabs where their workspace doesn't exist anymore
|
||||
gBrowser.removeTab(tab, {
|
||||
animate: false,
|
||||
skipSessionStore: true,
|
||||
closeWindowWithLastTab: false,
|
||||
});
|
||||
@@ -872,7 +890,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
|
||||
handleTabBeforeClose(tab) {
|
||||
handleTabBeforeClose(tab, closeWindowWithLastTab = false) {
|
||||
if (!this.workspaceEnabled || this.__contextIsDelete || this._removedByStartupPage) {
|
||||
return null;
|
||||
}
|
||||
@@ -884,8 +902,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
|
||||
let tabs = gBrowser.visibleTabs;
|
||||
let tabsPinned = tabs.filter((t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned);
|
||||
|
||||
const shouldCloseWindow = this.shouldCloseWindow();
|
||||
const shouldCloseWindow = this.shouldCloseWindow() && closeWindowWithLastTab;
|
||||
if (tabs.length === 1 && tabs[0] === tab) {
|
||||
if (shouldCloseWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
@@ -1814,7 +1831,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
async _performWorkspaceChange(workspace, { onInit = false, alwaysChange = false, whileScrolling = false } = {}) {
|
||||
const previousWorkspace = await this.getActiveWorkspace();
|
||||
alwaysChange = alwaysChange || onInit;
|
||||
|
||||
this.activeWorkspace = workspace.uuid;
|
||||
if (previousWorkspace && previousWorkspace.uuid === workspace.uuid && !alwaysChange) {
|
||||
this._cancelSwipeAnimation();
|
||||
@@ -2589,6 +2605,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
// Switch workspace if needed
|
||||
if (workspaceID && workspaceID !== activeWorkspace.uuid && this._hasInitializedTabsStrip) {
|
||||
const workspaceToChange = this.getWorkspaceFromId(workspaceID);
|
||||
if (!workspaceToChange) {
|
||||
return;
|
||||
}
|
||||
await this.changeWorkspace(workspaceToChange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"brandShortName": "Zen",
|
||||
"brandFullName": "Zen Browser",
|
||||
"release": {
|
||||
"displayVersion": "1.12.2b",
|
||||
"displayVersion": "1.12.3b",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
},
|
||||
@@ -39,7 +39,7 @@
|
||||
"brandShortName": "Twilight",
|
||||
"brandFullName": "Zen Twilight",
|
||||
"release": {
|
||||
"displayVersion": "1.12.2t",
|
||||
"displayVersion": "1.12.3t",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user