perf: part 2 - Improved startup speed/performance and added some tests for private browsing, b=no-bug, c=common, kbs, mods, tests, glance, workspaces

This commit is contained in:
Mr. M
2025-06-07 01:02:03 +02:00
parent a1bd202b51
commit 8ef4460f00
15 changed files with 115 additions and 65 deletions

View File

@@ -1,12 +1,11 @@
diff --git a/browser/base/content/browser-init.js b/browser/base/content/browser-init.js diff --git a/browser/base/content/browser-init.js b/browser/base/content/browser-init.js
index bcbfab4a3781ff3c7349115751b3830976eec4bf..1ab08a9344b16cbe791182fce3f6fbf59ca3df91 100644 index bcbfab4a3781ff3c7349115751b3830976eec4bf..8176656b6f5e70ccf3766ad9f5406758fdb7034b 100644
--- a/browser/base/content/browser-init.js --- a/browser/base/content/browser-init.js
+++ b/browser/base/content/browser-init.js +++ b/browser/base/content/browser-init.js
@@ -186,6 +186,8 @@ var gBrowserInit = { @@ -186,6 +186,7 @@ var gBrowserInit = {
}, },
onLoad() { onLoad() {
+ Services.scriptloader.loadSubScript("chrome://browser/content/ZenStartup.mjs", window);
+ Services.scriptloader.loadSubScript("chrome://browser/content/zenThemeModifier.js", window); + Services.scriptloader.loadSubScript("chrome://browser/content/zenThemeModifier.js", window);
gBrowser.addEventListener("DOMUpdateBlockedPopups", e => gBrowser.addEventListener("DOMUpdateBlockedPopups", e =>
PopupBlockerObserver.handleEvent(e) PopupBlockerObserver.handleEvent(e)

View File

@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser.xhtml b/browser/base/content/browser.xhtml diff --git a/browser/base/content/browser.xhtml b/browser/base/content/browser.xhtml
index 8f8c5536cb6e54300897180ca3f950974c60e930..403f821f561a2dfcf6ad23db7e61712aac867716 100644 index 8f8c5536cb6e54300897180ca3f950974c60e930..78076e29faf749b83d6c8e099af6767621f34d58 100644
--- a/browser/base/content/browser.xhtml --- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml +++ b/browser/base/content/browser.xhtml
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
@@ -10,19 +10,18 @@ index 8f8c5536cb6e54300897180ca3f950974c60e930..403f821f561a2dfcf6ad23db7e61712a
persist="screenX screenY width height sizemode" persist="screenX screenY width height sizemode"
data-l10n-sync="true"> data-l10n-sync="true">
<head> <head>
@@ -105,8 +106,11 @@ @@ -105,8 +106,10 @@
<title data-l10n-id="browser-main-window-default-title"></title> <title data-l10n-id="browser-main-window-default-title"></title>
+#include zen-preloaded.inc.xhtml +#include zen-preloaded.inc.xhtml
+
<script src="chrome://browser/content/global-scripts.js"></script> <script src="chrome://browser/content/global-scripts.js"></script>
<script src="chrome://browser/content/browser-main.js"></script> <script src="chrome://browser/content/browser-main.js"></script>
+#include zen-assets.inc.xhtml +#include zen-assets.inc.xhtml
</head> </head>
<html:body xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <html:body xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
# All sets except for popupsets (commands, keys, and stringbundles) # All sets except for popupsets (commands, keys, and stringbundles)
@@ -128,9 +132,11 @@ @@ -128,9 +131,11 @@
</vbox> </vbox>
</html:template> </html:template>

View File

@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include zen-locales.inc.xhtml #include zen-locales.inc.xhtml
# Styles used all over the browser # Styles used all over the browser
@@ -28,16 +32,26 @@
<link rel="stylesheet" type="text/css" href="chrome://browser/content/zen-styles/zen-download-box-animation.css" /> <link rel="stylesheet" type="text/css" href="chrome://browser/content/zen-styles/zen-download-box-animation.css" />
</linkset> </linkset>
# Startup "preloaded" scripts that requre globals such as gBrowser and gURLBar
# JS files which are needed by browser.xhtml but no other top level windows to
# support MacOS specific features should be loaded directly from browser-main.js
# rather than this file.
#
# If you update this list, you may need to add a mapping within the following
# file so that ESLint works correctly:
# tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
<script type="text/javascript" src="chrome://browser/content/ZenPreloadedScripts.js"></script>
# Scripts used all over the browser # Scripts used all over the browser
<script src="chrome://browser/content/ZenUIManager.mjs"></script> <script type="text/javascript" src="chrome://browser/content/ZenUIManager.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenFolders.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenFolders.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenMods.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenMods.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenCompactMode.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenCompactMode.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenPinnedTabsStorage.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenPinnedTabsStorage.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenWorkspacesStorage.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenWorkspacesStorage.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenPinnedTabManager.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenPinnedTabManager.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenGradientGenerator.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenGradientGenerator.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenViewSplitter.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenViewSplitter.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenGlanceManager.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenGlanceManager.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenMediaController.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenMediaController.mjs"></script>
<script src="chrome://browser/content/zen-components/ZenDownloadAnimation.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenDownloadAnimation.mjs"></script>

View File

@@ -1,11 +1,14 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
content/browser/zenThemeModifier.js (../../zen/common/zenThemeModifier.js) content/browser/zenThemeModifier.js (../../zen/common/zenThemeModifier.js)
content/browser/ZenStartup.mjs (../../zen/common/ZenStartup.mjs) content/browser/ZenStartup.mjs (../../zen/common/ZenStartup.mjs)
content/browser/ZenPreloadedScripts.js (../../zen/common/ZenPreloadedScripts.js)
content/browser/zen-sets.js (../../zen/common/zen-sets.js) content/browser/zen-sets.js (../../zen/common/zen-sets.js)
content/browser/ZenUIManager.mjs (../../zen/common/ZenUIManager.mjs) content/browser/ZenUIManager.mjs (../../zen/common/ZenUIManager.mjs)
content/browser/zen-components/ZenActorsManager.mjs (../../zen/common/ZenActorsManager.mjs) content/browser/zen-components/ZenActorsManager.mjs (../../zen/common/ZenActorsManager.mjs)
content/browser/zen-components/ZenEmojis.mjs (../../zen/common/ZenEmojis.mjs) content/browser/zen-components/ZenEmojis.mjs (../../zen/common/ZenEmojis.mjs)
content/browser/ZenCustomizableUI.sys.mjs (../../zen/common/ZenCustomizableUI.sys.mjs) content/browser/ZenCustomizableUI.sys.mjs (../../zen/common/ZenCustomizableUI.sys.mjs)
content/browser/zen-components/ZenUIMigration.mjs (../../zen/common/ZenUIMigration.mjs) content/browser/zen-components/ZenUIMigration.mjs (../../zen/common/ZenUIMigration.mjs)
content/browser/zen-components/ZenCommonUtils.mjs (../../zen/common/ZenCommonUtils.mjs) content/browser/zen-components/ZenCommonUtils.mjs (../../zen/common/ZenCommonUtils.mjs)
@@ -35,7 +38,7 @@
content/browser/zen-components/ZenViewSplitter.mjs (../../zen/split-view/ZenViewSplitter.mjs) content/browser/zen-components/ZenViewSplitter.mjs (../../zen/split-view/ZenViewSplitter.mjs)
content/browser/zen-styles/zen-decks.css (../../zen/split-view/zen-decks.css) content/browser/zen-styles/zen-decks.css (../../zen/split-view/zen-decks.css)
content/browser/zen-components/ZenMods.mjs (../../zen/mods/ZenMods.mjs) content/browser/zen-components/ZenMods.mjs (../../zen/mods/ZenMods.mjs)
content/browser/zen-components/ZenWorkspaceIcons.mjs (../../zen/workspaces/ZenWorkspaceIcons.mjs) content/browser/zen-components/ZenWorkspaceIcons.mjs (../../zen/workspaces/ZenWorkspaceIcons.mjs)
content/browser/zen-components/ZenWorkspace.mjs (../../zen/workspaces/ZenWorkspace.mjs) content/browser/zen-components/ZenWorkspace.mjs (../../zen/workspaces/ZenWorkspace.mjs)
@@ -80,7 +83,7 @@
content/browser/zen-images/note-indicator.svg (../../zen/images/note-indicator.svg) content/browser/zen-images/note-indicator.svg (../../zen/images/note-indicator.svg)
content/browser/zen-images/downloads/download.svg (../../zen/images/downloads/download.svg) content/browser/zen-images/downloads/download.svg (../../zen/images/downloads/download.svg)
content/browser/zen-images/downloads/archive.svg (../../zen/images/downloads/archive.svg) content/browser/zen-images/downloads/archive.svg (../../zen/images/downloads/archive.svg)
# Fonts # Fonts
content/browser/zen-fonts/JunicodeVF-Italic.woff2 (../../zen/fonts/JunicodeVF-Italic.woff2) content/browser/zen-fonts/JunicodeVF-Italic.woff2 (../../zen/fonts/JunicodeVF-Italic.woff2)
@@ -91,13 +94,13 @@
content/browser/zen-vendor/motion.min.mjs (../../zen/vendor/motion.min.mjs) content/browser/zen-vendor/motion.min.mjs (../../zen/vendor/motion.min.mjs)
# FavIcons for startup # FavIcons for startup
content/browser/zen-images/favicons/calendar.ico (../../zen/images/favicons/calendar.ico) content/browser/zen-images/favicons/calendar.ico (../../zen/images/favicons/calendar.ico)
content/browser/zen-images/favicons/discord.ico (../../zen/images/favicons/discord.ico) content/browser/zen-images/favicons/discord.ico (../../zen/images/favicons/discord.ico)
content/browser/zen-images/favicons/figma.ico (../../zen/images/favicons/figma.ico) content/browser/zen-images/favicons/figma.ico (../../zen/images/favicons/figma.ico)
content/browser/zen-images/favicons/github.ico (../../zen/images/favicons/github.ico) content/browser/zen-images/favicons/github.ico (../../zen/images/favicons/github.ico)
content/browser/zen-images/favicons/notion.ico (../../zen/images/favicons/notion.ico) content/browser/zen-images/favicons/notion.ico (../../zen/images/favicons/notion.ico)
content/browser/zen-images/favicons/obsidian.ico (../../zen/images/favicons/obsidian.ico) content/browser/zen-images/favicons/obsidian.ico (../../zen/images/favicons/obsidian.ico)
content/browser/zen-images/favicons/slack.ico (../../zen/images/favicons/slack.ico) content/browser/zen-images/favicons/slack.ico (../../zen/images/favicons/slack.ico)
content/browser/zen-images/favicons/reddit.ico (../../zen/images/favicons/reddit.ico) content/browser/zen-images/favicons/reddit.ico (../../zen/images/favicons/reddit.ico)
content/browser/zen-images/favicons/x.ico (../../zen/images/favicons/x.ico) content/browser/zen-images/favicons/x.ico (../../zen/images/favicons/x.ico)
content/browser/zen-images/favicons/trello.ico (../../zen/images/favicons/trello.ico) content/browser/zen-images/favicons/trello.ico (../../zen/images/favicons/trello.ico)

View File

@@ -10,4 +10,3 @@
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenWorkspacesSync.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenWorkspacesSync.mjs"></script>
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenActorsManager.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenActorsManager.mjs"></script>
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenSessionStore.mjs"></script> <script type="text/javascript" src="chrome://browser/content/zen-components/ZenSessionStore.mjs"></script>

View File

@@ -0,0 +1,9 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// prettier-ignore
// eslint-disable-next-line no-lone-blocks
{
Services.scriptloader.loadSubScript("chrome://browser/content/ZenStartup.mjs", this);
}

View File

@@ -5,12 +5,11 @@
var ZenStartup = { var ZenStartup = {
_watermarkIgnoreElements: ['zen-browser-background', 'zen-toast-container'], _watermarkIgnoreElements: ['zen-browser-background', 'zen-toast-container'],
init() { async init() {
this.openWatermark(); this.openWatermark();
this._initBrowserBackground(); await this._initBrowserBackground();
this._changeSidebarLocation(); this._changeSidebarLocation();
this._zenInitBrowserLayout(); this._zenInitBrowserLayout();
this._initSearchBar();
}, },
_initBrowserBackground() { _initBrowserBackground() {
@@ -22,11 +21,10 @@
document.getElementById('browser').prepend(background); document.getElementById('browser').prepend(background);
}, },
_zenInitBrowserLayout() { async _zenInitBrowserLayout() {
if (this.__hasInitBrowserLayout) return; if (this.__hasInitBrowserLayout) return;
this.__hasInitBrowserLayout = true; this.__hasInitBrowserLayout = true;
try { try {
console.info('ZenThemeModifier: init browser layout');
const kNavbarItems = ['nav-bar', 'PersonalToolbar']; const kNavbarItems = ['nav-bar', 'PersonalToolbar'];
const kNewContainerId = 'zen-appcontent-navbar-container'; const kNewContainerId = 'zen-appcontent-navbar-container';
let newContainer = document.getElementById(kNewContainerId); let newContainer = document.getElementById(kNewContainerId);
@@ -46,7 +44,6 @@
this._hideUnusedElements(); this._hideUnusedElements();
gZenWorkspaces.init(); gZenWorkspaces.init();
gZenVerticalTabsManager.init();
gZenUIManager.init(); gZenUIManager.init();
this._checkForWelcomePage(); this._checkForWelcomePage();
@@ -78,6 +75,8 @@
gZenWorkspaces.promiseInitialized.then(async () => { gZenWorkspaces.promiseInitialized.then(async () => {
await delayedStartupPromise; await delayedStartupPromise;
await SessionStore.promiseAllWindowsRestored; await SessionStore.promiseAllWindowsRestored;
delete gZenUIManager.promiseInitialized;
this._initSearchBar();
setTimeout(() => { setTimeout(() => {
gZenCompactModeManager.init(); gZenCompactModeManager.init();
setTimeout(() => { setTimeout(() => {
@@ -162,10 +161,6 @@
_initSearchBar() { _initSearchBar() {
// Only focus the url bar // Only focus the url bar
gURLBar.focus(); gURLBar.focus();
gURLBar._initCopyCutController();
gURLBar._initPasteAndGo();
gURLBar._initStripOnShare();
}, },
_checkForWelcomePage() { _checkForWelcomePage() {
@@ -179,5 +174,11 @@
}, },
}; };
ZenStartup.init(); window.addEventListener(
'MozBeforeInitialXULLayout',
() => {
ZenStartup.init();
},
{ once: true }
);
} }

View File

@@ -34,8 +34,6 @@ var gZenUIManager = {
true true
); );
gURLBar._zenTrimURL = this.urlbarTrim.bind(this);
document.addEventListener('mousedown', this.handleMouseDown.bind(this), true); document.addEventListener('mousedown', this.handleMouseDown.bind(this), true);
ChromeUtils.defineLazyGetter(this, 'motion', () => { ChromeUtils.defineLazyGetter(this, 'motion', () => {
@@ -48,6 +46,8 @@ var gZenUIManager = {
return document.getElementById('zen-toast-container'); return document.getElementById('zen-toast-container');
}); });
gURLBar._zenTrimURL = this.urlbarTrim.bind(this);
new ResizeObserver(this.updateTabsToolbar.bind(this)).observe( new ResizeObserver(this.updateTabsToolbar.bind(this)).observe(
document.getElementById('TabsToolbar') document.getElementById('TabsToolbar')
); );
@@ -67,6 +67,7 @@ var gZenUIManager = {
window.addEventListener('TabClose', this.onTabClose.bind(this)); window.addEventListener('TabClose', this.onTabClose.bind(this));
gZenMediaController.init(); gZenMediaController.init();
gZenVerticalTabsManager.init();
}, },
handleMouseDown(event) { handleMouseDown(event) {
@@ -956,6 +957,10 @@ var gZenVerticalTabsManager = {
gZenCompactModeManager.getAndApplySidebarWidth(); gZenCompactModeManager.getAndApplySidebarWidth();
} }
gZenUIManager.updateTabsToolbar(); gZenUIManager.updateTabsToolbar();
gURLBar._initCopyCutController();
gURLBar._initPasteAndGo();
gURLBar._initStripOnShare();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }

View File

@@ -1019,8 +1019,6 @@ var gZenKeyboardShortcutsManager = {
this._applyShortcuts(); this._applyShortcuts();
await this._saveShortcuts(); await this._saveShortcuts();
console.info('Zen CKS: Initialized');
} }
}, },

View File

@@ -21,8 +21,6 @@
}).format(new Date().getTime()); }).format(new Date().getTime());
constructor() { constructor() {
console.log('[ZenMods]: Initializing ZenMods module');
super(); super();
} }

View File

@@ -11,8 +11,8 @@ add_task(async function test_Glance_Next_Tab() {
const tabToCheck = gBrowser.selectedTab; const tabToCheck = gBrowser.selectedTab;
gBrowser.selectedTab = selectedTab; gBrowser.selectedTab = selectedTab;
await openGlanceOnTab(async (glanceTab) => { await openGlanceOnTab(async (glanceTab) => {
const next = gBrowser.tabContainer.findNextTab(glanceTab, { direction: 1 }); gBrowser.tabContainer.advanceSelectedTab(1);
Assert.equal(next, tabToCheck, 'Next glance tab should equal'); Assert.equal(gBrowser.selectedTab, tabToCheck, 'Next glance tab should equal');
}); });
await BrowserTestUtils.removeTab(gBrowser.selectedTab); await BrowserTestUtils.removeTab(gBrowser.selectedTab);
}); });

View File

@@ -10,8 +10,8 @@ add_task(async function test_Glance_Prev_Tab() {
}); });
const tabToCheck = gBrowser.selectedTab; const tabToCheck = gBrowser.selectedTab;
gBrowser.selectedTab = glanceTab; gBrowser.selectedTab = glanceTab;
const next = gBrowser.tabContainer.findNextTab(glanceTab, { direction: -1 }); gBrowser.tabContainer.advanceSelectedTab(-1);
Assert.equal(next, tabToCheck, 'Previous glance tab should equal'); Assert.equal(gBrowser.selectedTab, tabToCheck, 'Previous glance tab should equal');
await BrowserTestUtils.removeTab(tabToCheck); await BrowserTestUtils.removeTab(tabToCheck);
}); });
}); });

View File

@@ -7,3 +7,4 @@ support-files = [
["browser_workspace_bookmarks.js"] ["browser_workspace_bookmarks.js"]
["browser_double_click_newtab.js"] ["browser_double_click_newtab.js"]
["browser_overflow_scrollbox.js"] ["browser_overflow_scrollbox.js"]
["browser_private_mode.js"]

View File

@@ -0,0 +1,21 @@
/* Any copyright is dedicated to the Public Domain.
https://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
add_task(async function testPrivateMode() {
await SpecialPowers.pushPrefEnv({
set: [['privacy.userContext.enabled', true]],
});
let privateWindow = await BrowserTestUtils.openNewBrowserWindow({
private: true,
});
await privateWindow.gZenWorkspaces.promiseInitialized;
ok(
privateWindow.document.documentElement.hasAttribute('zen-workspace-id'),
'Private window should have a zen-workspace-id attribute'
);
await BrowserTestUtils.closeWindow(privateWindow);
});

View File

@@ -42,7 +42,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
this._resolveInitialized = resolve; this._resolveInitialized = resolve;
}); });
async waitForPromises() { async #waitForPromises() {
if (this.privateWindowOrDisabled) { if (this.privateWindowOrDisabled) {
return; return;
} }
@@ -116,6 +116,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
window.addEventListener('resize', this.onWindowResize.bind(this)); window.addEventListener('resize', this.onWindowResize.bind(this));
this.addPopupListeners(); this.addPopupListeners();
await this.#waitForPromises();
await this._workspaces();
await this.afterLoadInit(); await this.afterLoadInit();
} }
@@ -294,7 +297,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
return; return;
} }
this._pinnedTabsResizeObserver = new ResizeObserver(this.onPinnedTabsResize.bind(this)); this._pinnedTabsResizeObserver = new ResizeObserver(this.onPinnedTabsResize.bind(this));
await this.waitForPromises();
await this._createDefaultWorkspaceIfNeeded(); await this._createDefaultWorkspaceIfNeeded();
} }
@@ -738,11 +740,12 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
get shouldHaveWorkspaces() { get shouldHaveWorkspaces() {
if (typeof this._shouldHaveWorkspaces === 'undefined') { if (typeof this._shouldHaveWorkspaces === 'undefined') {
let docElement = document.documentElement; let chromeFlags = docShell.treeOwner
this._shouldHaveWorkspaces = !( .QueryInterface(Ci.nsIInterfaceRequestor)
docElement.getAttribute('chromehidden').includes('toolbar') || .getInterface(Ci.nsIAppWindow).chromeFlags;
docElement.getAttribute('chromehidden').includes('menubar') this._shouldHaveWorkspaces =
); chromeFlags & Ci.nsIWebBrowserChrome.CHROME_TOOLBAR ||
chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MENUBAR;
return this._shouldHaveWorkspaces; return this._shouldHaveWorkspaces;
} }
return this._shouldHaveWorkspaces; return this._shouldHaveWorkspaces;
@@ -851,7 +854,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
await this.workspaceBookmarks(); await this.workspaceBookmarks();
await gZenPinnedTabManager.refreshPinnedTabs({ init: true }); await gZenPinnedTabManager.refreshPinnedTabs({ init: true });
await this.changeWorkspace(activeWorkspace, { onInit: true }); await this.changeWorkspace(activeWorkspace, { onInit: true });
await this._selectStartPage(); await this.#selectStartPage();
this._fixTabPositions(); this._fixTabPositions();
this._resolveInitialized(); this._resolveInitialized();
this._clearAnyZombieTabs(); // Dont call with await this._clearAnyZombieTabs(); // Dont call with await
@@ -868,7 +871,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this)); window.addEventListener('TabBrowserInserted', this.onTabBrowserInserted.bind(this));
} }
async _selectStartPage() { async #selectStartPage() {
if (gZenUIManager.testingEnabled) { if (gZenUIManager.testingEnabled) {
return; return;
} }
@@ -2017,7 +2020,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
) { ) {
delete this._alwaysAnimatePaddingTop; delete this._alwaysAnimatePaddingTop;
const essentialsHeight = essentialContainer.getBoundingClientRect().height; const essentialsHeight = essentialContainer.getBoundingClientRect().height;
if (!forAnimation && animateContainer) { if (!forAnimation && animateContainer && gZenUIManager.motion) {
gZenUIManager.motion.animate( gZenUIManager.motion.animate(
workspaceElement, workspaceElement,
{ {