feat: Added --blank-window command line argument, b=no-bug, c=common, workspaces

This commit is contained in:
Mr. M
2026-02-11 22:52:32 +01:00
parent a1e7af81cc
commit 827b89d4e8
5 changed files with 48 additions and 3 deletions

View File

@@ -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 <url> Open <url> in a new window.\n" +
" --new-tab <url> Open <url> in a new tab.\n" +
" --private-window [<url>] Open <url> in a new private window.\n";
+ info += " --blank-window [<url>] Open the new blank window.\n";
if (AppConstants.platform == "win") {
info += " --preferences Open Options dialog.\n";
} else {

View File

@@ -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",

View File

@@ -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",
]

View File

@@ -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",

View File

@@ -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));