From 58ffcd13c8cd0cdbd25c7d85e04fc3ee815929e1 Mon Sep 17 00:00:00 2001 From: Slowlife Date: Sun, 8 Mar 2026 22:43:21 +0700 Subject: [PATCH 1/5] fix: allow all cross-origin loads for live folders, b=closes #12685, p=#12686 * fix: allow all cross-origin loads for live folders, b=closes #12685, c=folders * chore: undo style changes --- src/zen/live-folders/ZenLiveFolder.sys.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zen/live-folders/ZenLiveFolder.sys.mjs b/src/zen/live-folders/ZenLiveFolder.sys.mjs index 36d17d42f..8085b9a26 100644 --- a/src/zen/live-folders/ZenLiveFolder.sys.mjs +++ b/src/zen/live-folders/ZenLiveFolder.sys.mjs @@ -146,7 +146,8 @@ export class nsZenLiveFolderProvider { contentPolicyType: Ci.nsIContentPolicy.TYPE_SAVEAS_DOWNLOAD, loadingPrincipal: principal, securityFlags: - Ci.nsILoadInfo.SEC_REQUIRE_CORS_INHERITS_SEC_CONTEXT | Ci.nsILoadInfo.SEC_COOKIES_INCLUDE, + Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL | + Ci.nsILoadInfo.SEC_COOKIES_INCLUDE, triggeringPrincipal: principal, }).QueryInterface(Ci.nsIHttpChannel); From dac4575a91789971f4694cc97533462339412c26 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Mon, 9 Mar 2026 11:04:23 +0100 Subject: [PATCH 2/5] chore: Add `.DS_Store` to gitignore, p=#12695 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e31fcdecd..0239f5075 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ target/ locales/firefox-l10n/ !src/toolkit/themes/shared/design-system/dist/ +.DS_Store From 64fc35658da24a735cc53af1c6aae6cb4be0aecd Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:42:15 +0100 Subject: [PATCH 3/5] feat: Change selected tab when resetting pinned tab, p=#12696 --- src/zen/tabs/ZenPinnedTabManager.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 8bf52f019..ae994feb5 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -111,6 +111,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature { _onTabResetPinButton(event, tab) { event.stopPropagation(); this._resetTabToStoredState(tab); + gBrowser.selectedTab = tab; } get enabled() { From 665f5009258adee92643c40f8a65a42b2f23541b Mon Sep 17 00:00:00 2001 From: JustAdumbPrsn <73780892+JustAdumbPrsn@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:28:03 +0530 Subject: [PATCH 4/5] feat: Implement Zen Library data backend (#12701) --- src/zen/library/ZenLibrarySections.mjs | 169 +++++++++++++++++++++---- 1 file changed, 142 insertions(+), 27 deletions(-) diff --git a/src/zen/library/ZenLibrarySections.mjs b/src/zen/library/ZenLibrarySections.mjs index 2b6b56099..b33336a86 100644 --- a/src/zen/library/ZenLibrarySections.mjs +++ b/src/zen/library/ZenLibrarySections.mjs @@ -7,32 +7,38 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; let lazy = {}; +ChromeUtils.defineESModuleGetters(lazy, { + Downloads: "resource://gre/modules/Downloads.sys.mjs", + DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs", + DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", + PlacesQuery: "resource://gre/modules/PlacesQuery.sys.mjs", +}); + ChromeUtils.defineLazyGetter(lazy, "l10n", function () { - return new Localization( - ["browser/zen-library.ftl"], - true - ); + return new Localization(["browser/zen-library.ftl"], true); }); class LibrarySection extends MozLitElement { static largeContent = false; static get id() { - throw new Error("Unimplemented"); + throw new Error("LibrarySection subclass must define a static `id`."); } static get label() { - throw new Error("Unimplemented"); + throw new Error("LibrarySection subclass must define a static `label`."); } } class SearchSection extends LibrarySection { static properties = { searchTerm: { type: String }, + isEmpty: { type: Boolean }, }; connectedCallback() { this.searchTerm = ""; + this.isEmpty = false; super.connectedCallback(); } @@ -42,12 +48,15 @@ class SearchSection extends LibrarySection { } renderSearchResults() { - return html`${this.searchTerm}`; + return html``; } render() { return html` - + -
- ${this.renderSearchResults()} -
+
${this.renderSearchResults()}
`; } } +// History section +class ZenLibraryHistorySection extends SearchSection { + static id = "history"; + static label = "library-history-section-title"; + + #placesQuery = null; + #history = null; + + renderSearchResults() { + if (this.isEmpty) { + return html`
+ ${lazy.l10n.formatValueSync("library-history-empty")} +
`; + } + return html`${this.searchTerm}`; + } + + async connectedCallback() { + super.connectedCallback(); + try { + this.#placesQuery = new lazy.PlacesQuery(); + this.#history = await this.#placesQuery.getHistory(); + this.isEmpty = this.#history.size === 0; + this.#placesQuery.observeHistory((newHistory) => { + this.#history = newHistory; + this.isEmpty = this.#history.size === 0; + this.requestUpdate(); + }); + this.requestUpdate(); + } catch (ex) { + console.error("Zen Library: Failed to initialize history section.", ex); + } + } + + disconnectedCallback() { + super.disconnectedCallback(); + this.#placesQuery?.close(); + this.#placesQuery = null; + this.#history = null; + } +} + +// Downloads section +class ZenLibraryDownloadsSection extends SearchSection { + static id = "downloads"; + static label = "library-downloads-section-title"; + + #downloadList = null; + #downloads = []; + #downloadsView = null; + #batchLoading = false; + + renderSearchResults() { + if (this.isEmpty) { + return html`
+ ${lazy.l10n.formatValueSync("library-downloads-empty")} +
`; + } + return html`${this.searchTerm}`; + } + + async connectedCallback() { + super.connectedCallback(); + try { + this.#downloadList = await lazy.DownloadHistory.getList({ + type: lazy.Downloads.PUBLIC, + }); + this.#downloadsView = { + onDownloadAdded: (dl) => { + // During the initial batch replay addView fires onDownloadAdded for + // every existing download oldest-first, so we push to preserve order. + // After init, new downloads are unshifted to the front. + if (this.#batchLoading) { + this.#downloads.push(dl); + } else { + this.#downloads.unshift(dl); + this.isEmpty = false; + this.requestUpdate(); + } + }, + onDownloadBatchEnded: () => { + this.#batchLoading = false; + this.isEmpty = this.#downloads.length === 0; + this.requestUpdate(); + }, + onDownloadChanged: (dl) => { + this.requestUpdate(); + }, + onDownloadRemoved: (dl) => { + this.#downloads = this.#downloads.filter((d) => d !== dl); + this.isEmpty = this.#downloads.length === 0; + this.requestUpdate(); + }, + }; + this.#batchLoading = true; + this.#downloadList.addView(this.#downloadsView); + } catch (ex) { + console.error("Zen Library: Failed to initialize downloads section.", ex); + } + } + + disconnectedCallback() { + super.disconnectedCallback(); + if (this.#downloadList && this.#downloadsView) { + this.#downloadList.removeView(this.#downloadsView); + } + this.#downloadList = null; + this.#downloadsView = null; + this.#downloads = []; + } +} + +// Spaces section +class ZenLibrarySpacesSection extends LibrarySection { + static largeContent = true; + static id = "spaces"; + static label = "library-spaces-section-title"; +} + export const ZenLibrarySections = { - history: class extends SearchSection { - static id = "history"; - static label = "library-history-section-title"; - }, - downloads: class extends SearchSection { - static id = "downloads"; - static label = "library-downloads-section-title"; - }, - spaces: class extends LibrarySection { - static largeContent = true; - static id = "spaces"; - static label = "library-spaces-section-title"; - }, + history: ZenLibraryHistorySection, + downloads: ZenLibraryDownloadsSection, + spaces: ZenLibrarySpacesSection, }; -for (const section of Object.values(ZenLibrarySections)) { - customElements.define(`zen-library-section-${section.id}`, section) - ; +for (const Section of Object.values(ZenLibrarySections)) { + customElements.define(`zen-library-section-${Section.id}`, Section); } From 25c57403314814510364fd6c89dae22711bfa917 Mon Sep 17 00:00:00 2001 From: Ruben Fricke Date: Mon, 9 Mar 2026 18:04:08 +0100 Subject: [PATCH 5/5] fix: set zenDefaultUserContextId on live folder tabs, p=#12702 --- src/zen/live-folders/ZenLiveFoldersManager.sys.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs b/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs index ef7b515a1..7fe382914 100644 --- a/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs +++ b/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs @@ -407,6 +407,9 @@ class nsZenLiveFoldersManager { }); // createLazyBrowser can't be pinned by default this.window.gBrowser.pinTab(tab); + if (userContextId) { + tab.setAttribute("zenDefaultUserContextId", "true"); + } if (item.icon) { this.window.gBrowser.setIcon(tab, item.icon); if (tab.linkedBrowser) {