fix: Fixed bookmarks being weird on private window, b=closes #8995, c=workspaces

This commit is contained in:
mr. m
2025-06-14 13:10:04 +02:00
parent 469604dd28
commit 7d51ae1f07

View File

@@ -115,6 +115,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
document.documentElement.setAttribute('zen-private-window', 'true');
}
this.popupOpenHandler = this._popupOpenHandler.bind(this);
window.addEventListener('resize', this.onWindowResize.bind(this));
this.addPopupListeners();
@@ -646,11 +648,22 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
document.documentElement.removeAttribute('swipe-gesture');
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
this.updateTabsContainers();
document.removeEventListener('popupshown', this.popupOpenHandler, { once: true });
},
true
);
}
_popupOpenHandler(event) {
// If a popup is opened, we should stop the swipe gesture
if (this._swipeState?.isGestureActive) {
document.documentElement.removeAttribute('swipe-gesture');
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
this.updateTabsContainers();
this._cancelSwipeAnimation();
}
}
_handleSwipeMayStart(event) {
if (this.privateWindowOrDisabled || this._inChangingWorkspace) return;
if (event.target.closest('#zen-sidebar-foot-buttons')) return;
@@ -669,6 +682,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (!this.workspaceEnabled) return;
document.documentElement.setAttribute('swipe-gesture', 'true');
document.addEventListener('popupshown', this.popupOpenHandler, { once: true });
event.preventDefault();
event.stopPropagation();
@@ -842,6 +856,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async workspaceBookmarks() {
if (this.privateWindowOrDisabled) {
this._workspaceBookmarksCache = {
bookmarks: [],
lastChangeTimestamp: 0,
};
return this._workspaceBookmarksCache;
}
if (this._workspaceBookmarksCache) {
return this._workspaceBookmarksCache;
}