From 827b89d4e8d2077c42d50976c644c3a23b1f2241 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Wed, 11 Feb 2026 22:52:32 +0100 Subject: [PATCH 1/3] feat: Added --blank-window command line argument, b=no-bug, c=common, workspaces --- .../BrowserContentHandler-sys-mjs.patch | 41 +++++++++++++++++++ src/zen/common/moz.build | 2 +- src/zen/sessionstore/moz.build | 2 +- src/zen/urlbar/moz.build | 2 +- src/zen/workspaces/ZenWorkspace.mjs | 4 ++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 src/browser/components/BrowserContentHandler-sys-mjs.patch diff --git a/src/browser/components/BrowserContentHandler-sys-mjs.patch b/src/browser/components/BrowserContentHandler-sys-mjs.patch new file mode 100644 index 000000000..d9565e0e9 --- /dev/null +++ b/src/browser/components/BrowserContentHandler-sys-mjs.patch @@ -0,0 +1,41 @@ +diff --git a/browser/components/BrowserContentHandler.sys.mjs b/browser/components/BrowserContentHandler.sys.mjs +index 57a37b5c0d1982ecfff8d94e05fea89895713a58..062dcb0d1de00982bd777c3dc5d62a88a304bc68 100644 +--- a/browser/components/BrowserContentHandler.sys.mjs ++++ b/browser/components/BrowserContentHandler.sys.mjs +@@ -601,6 +601,28 @@ nsBrowserContentHandler.prototype = { + } + } + ++ try { ++ let blankWindowParam = cmdLine.handleFlagWithParam("blank-window", false); ++ if (blankWindowParam !== null) { ++ let { uri, principal } = resolveURIInternal(cmdLine, blankWindowParam); ++ if (shouldLoadURI(uri)) { ++ let win = openBrowserWindow(cmdLine, principal, uri.spec); ++ win._zenStartupSyncFlag = 'unsynced'; ++ cmdLine.preventDefault = true; ++ } ++ } ++ } catch (e) { ++ if (e.result != Cr.NS_ERROR_INVALID_ARG) { ++ throw e; ++ } ++ if (cmdLine.handleFlag("blank-window", false)) { ++ let win = openBrowserWindow(cmdLine, null, null); ++ win._zenStartupSyncFlag = 'unsynced'; ++ cmdLine.preventDefault = true; ++ } ++ } ++ ++ + var searchParam = cmdLine.handleFlagWithParam("search", false); + if (searchParam) { + doSearch(searchParam, cmdLine); +@@ -670,6 +692,7 @@ nsBrowserContentHandler.prototype = { + " --new-window Open in a new window.\n" + + " --new-tab Open in a new tab.\n" + + " --private-window [] Open in a new private window.\n"; ++ info += " --blank-window [] Open the new blank window.\n"; + if (AppConstants.platform == "win") { + info += " --preferences Open Options dialog.\n"; + } else { diff --git a/src/zen/common/moz.build b/src/zen/common/moz.build index b4855aff4..8dc973b44 100644 --- a/src/zen/common/moz.build +++ b/src/zen/common/moz.build @@ -2,7 +2,7 @@ # 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/. -MOZ_SRC_FILES += [ +EXTRA_JS_MODULES += [ "sys/ZenActorsManager.sys.mjs", "sys/ZenCustomizableUI.sys.mjs", "sys/ZenUIMigration.sys.mjs", diff --git a/src/zen/sessionstore/moz.build b/src/zen/sessionstore/moz.build index 941ec0bc0..188f4c27c 100644 --- a/src/zen/sessionstore/moz.build +++ b/src/zen/sessionstore/moz.build @@ -2,7 +2,7 @@ # 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/. -MOZ_SRC_FILES += [ +EXTRA_JS_MODULES.zen += [ "ZenSessionManager.sys.mjs", "ZenWindowSync.sys.mjs", ] diff --git a/src/zen/urlbar/moz.build b/src/zen/urlbar/moz.build index abcc39ad6..f321a86bb 100644 --- a/src/zen/urlbar/moz.build +++ b/src/zen/urlbar/moz.build @@ -2,7 +2,7 @@ # 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/. -MOZ_SRC_FILES += [ +EXTRA_JS_MODULES += [ "ZenSiteDataPanel.sys.mjs", "ZenUBActionsProvider.sys.mjs", "ZenUBGlobalActions.sys.mjs", diff --git a/src/zen/workspaces/ZenWorkspace.mjs b/src/zen/workspaces/ZenWorkspace.mjs index 3208c4a42..80eaea9fa 100644 --- a/src/zen/workspaces/ZenWorkspace.mjs +++ b/src/zen/workspaces/ZenWorkspace.mjs @@ -144,6 +144,10 @@ export class nsZenWorkspace extends MozXULElement { this.pinnedTabsContainer.scrollbox = this.scrollbox; this.#initialPinnedElementChildrenCount = this.pinnedTabsContainer.children.length; + if (document.documentElement.hasAttribute("zen-unsynced-window")) { + this.indicator.removeAttribute("context"); + } + this.indicator .querySelector(".zen-workspaces-actions") .addEventListener("click", this.onActionsCommand.bind(this)); From aa4aae9e26a3d132a02a013d133e24127616ce36 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Wed, 11 Feb 2026 23:46:59 +0100 Subject: [PATCH 2/3] feat: Dont restore content to unsynced windows, b=no-bug, c=no-component --- .../sessionstore/SessionStore-sys-mjs.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch index 6284b2dc1..075d984f7 100644 --- a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch +++ b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs -index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab586f767a5e 100644 +index 2a055f0c5f34f0a2667f659185120c07d38f4e41..f52b8ddecf31e258ca33bbaf3483951d2b804210 100644 --- a/browser/components/sessionstore/SessionStore.sys.mjs +++ b/browser/components/sessionstore/SessionStore.sys.mjs @@ -127,6 +127,9 @@ const TAB_EVENTS = [ @@ -63,6 +63,15 @@ index 2a055f0c5f34f0a2667f659185120c07d38f4e41..2061ef7ac60371a563b4e4cd77ceab58 // perform additional initialization when the first window is loading if (lazy.RunState.isStopped) { +@@ -2088,7 +2097,7 @@ var SessionStoreInternal = { + // to disk to NOW() to enforce a full interval before the next write. + lazy.SessionSaver.updateLastSaveTime(); + +- if (isPrivateWindow || isTaskbarTab) { ++ if (isPrivateWindow || isTaskbarTab || aWindow.document.documentElement.hasAttribute("zen-unsynced-window")) { + this._log.debug( + "initializeWindow, the window is private or a web app. Saving SessionStartup.state for possibly restoring later" + ); @@ -2131,6 +2140,7 @@ var SessionStoreInternal = { null, "sessionstore-one-or-no-tab-restored" From 262209f5a3b1bb77970a3fa4daf9b1c59c739473 Mon Sep 17 00:00:00 2001 From: Andrey Vlasenko Date: Thu, 12 Feb 2026 00:55:53 +0200 Subject: [PATCH 3/3] feat: Add search option for URL-like input, p=#11998 Co-authored-by: mr. m <91018726+mr-cheffy@users.noreply.github.com> Co-authored-by: Mr. M --- .../urlbar/UrlbarMuxerStandard-sys-mjs.patch | 15 +++++-- ...barProviderHeuristicFallback-sys-mjs.patch | 42 +++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/browser/components/urlbar/UrlbarProviderHeuristicFallback-sys-mjs.patch diff --git a/src/browser/components/urlbar/UrlbarMuxerStandard-sys-mjs.patch b/src/browser/components/urlbar/UrlbarMuxerStandard-sys-mjs.patch index c40310518..5b44bb291 100644 --- a/src/browser/components/urlbar/UrlbarMuxerStandard-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarMuxerStandard-sys-mjs.patch @@ -1,8 +1,17 @@ diff --git a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs -index c12d875172650dddfe7de623a776149517c83302..66e923ed2c84e350dd7ba7a20e362666cec8f307 100644 +index c12d875172650dddfe7de623a776149517c83302..de24df54f510c44acda8c64584bf483a2cb5650a 100644 --- a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs +++ b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs -@@ -854,6 +854,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer { +@@ -849,11 +849,16 @@ class MuxerUnifiedComplete extends UrlbarMuxer { + result.providerName == "UrlbarProviderHeuristicFallback" && + state.context.heuristicResult?.providerName != + "UrlbarProviderHeuristicFallback" ++ && !( ++ result.type == UrlbarUtils.RESULT_TYPE.SEARCH && ++ state.context.heuristicResult?.type == UrlbarUtils.RESULT_TYPE.URL ++ ) + ) { + return false; } if (result.providerName == "UrlbarProviderTabToSearch") { @@ -10,7 +19,7 @@ index c12d875172650dddfe7de623a776149517c83302..66e923ed2c84e350dd7ba7a20e362666 // Discard the result if a tab-to-search result was added already. if (!state.canAddTabToSearch) { return false; -@@ -1500,7 +1501,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer { +@@ -1500,7 +1505,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer { usedLimits.maxResultCount++; } diff --git a/src/browser/components/urlbar/UrlbarProviderHeuristicFallback-sys-mjs.patch b/src/browser/components/urlbar/UrlbarProviderHeuristicFallback-sys-mjs.patch new file mode 100644 index 000000000..217392536 --- /dev/null +++ b/src/browser/components/urlbar/UrlbarProviderHeuristicFallback-sys-mjs.patch @@ -0,0 +1,42 @@ +diff --git a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs +index 7a60a871022df44c0d26745f0035fce988cc5f92..0b89f9b66573d4c5ffb67983d728bb593e5cb524 100644 +--- a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs ++++ b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs +@@ -75,22 +75,26 @@ export class UrlbarProviderHeuristicFallback extends UrlbarProvider { + // Since we can't tell if this is a real URL and whether the user wants + // to visit or search for it, we provide an alternative searchengine + // match if the string looks like an alphanumeric origin or an e-mail. +- let str = queryContext.searchString; +- if (!URL.canParse(str)) { +- if ( +- lazy.UrlbarPrefs.get("keyword.enabled") && +- (lazy.UrlUtils.looksLikeOrigin(str, { +- noIp: true, +- noPort: true, +- }) || +- lazy.UrlUtils.REGEXP_COMMON_EMAIL.test(str)) +- ) { ++ let trimmedSearchString = queryContext.trimmedSearchString; ++ let [searchCandidate] = UrlbarUtils.stripPrefixAndTrim( ++ trimmedSearchString, ++ { ++ trimSlash: true, ++ } ++ ); ++ if ( ++ lazy.UrlbarPrefs.get("keyword.enabled") && ++ (lazy.UrlUtils.looksLikeUrl(searchCandidate) || ++ lazy.UrlUtils.looksLikeOrigin(searchCandidate, { ++ allowPartialNumericalTLDs: true, ++ }) !== lazy.UrlUtils.LOOKS_LIKE_ORIGIN.NONE || ++ lazy.UrlUtils.REGEXP_COMMON_EMAIL.test(trimmedSearchString)) ++ ) { + let searchResult = await this._engineSearchResult({ queryContext }); + if (instance != this.queryInstance) { + return; + } + addCallback(this, searchResult); +- } + } + return; + }