Skip to content

Bug 2031652 - Enterprise: queue opening new window on remoting call of Felt#796

Open
lissyx wants to merge 1 commit intomozilla:enterprise-mainfrom
lissyx:enterprise-bug2031652_new_window_linux
Open

Bug 2031652 - Enterprise: queue opening new window on remoting call of Felt#796
lissyx wants to merge 1 commit intomozilla:enterprise-mainfrom
lissyx:enterprise-bug2031652_new_window_linux

Conversation

@lissyx
Copy link
Copy Markdown
Contributor

@lissyx lissyx commented Apr 27, 2026

Interacting from Linux' dock or others over DBus to open a new window launches "firefox" without any parameter. This results in Felt being shown instead of opening a new window. Check in browser's command line handler section of Felt, and if there is no URL list for a non initial launch (i.e. a remoted call) then pass over queueing a new window.

Description

Bugzilla: Bug-2031652


Testing

  • Added tests
  • Manual testing performed

Steps to verify changes:

  1. Download deb package from CI and install
  2. OR: mach build && mach package && .mach repackage deb --input obj-felt-dbg/dist/firefox-*.en-US.linux-x86_64.tar.bz2 --output obj-felt-dbg/dist/firefox-152.0a1.en-US.linux-x86_64.deb --arch x86_64 --build-number $(grep "BuildID" obj-felt-dbg/dist/bin/application.ini | cut -d'=' -f2 | tr -d '\n') --version $(grep "^Version=" obj-felt-dbg/dist/bin/application.ini | cut -d'=' -f2 | tr -d '\n') --templates ./browser/installer/linux/app/debian/ --release-product firefox --release-type nightly
  3. Launch, identify and get browser
  4. Right click on the dock icon, "new window"

Expected result:
A new window is opened

@lissyx lissyx self-assigned this Apr 27, 2026
@lissyx lissyx added bug Something isn't working branch:main PR that should be merged on enterprise-main branch labels Apr 27, 2026
@lissyx lissyx force-pushed the enterprise-bug2031652_new_window_linux branch 2 times, most recently from d690b89 to 704a9d7 Compare April 27, 2026 18:13
@lissyx lissyx marked this pull request as ready for review April 27, 2026 18:14
@lissyx lissyx requested review from gcp and removed request for gcp April 27, 2026 18:14
@lissyx
Copy link
Copy Markdown
Contributor Author

lissyx commented Apr 28, 2026

Looks to be badly broken on macOS, I'll investigate

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets Enterprise/Felt on Linux where dock “New Window” actions arrive via DBus without CLI parameters, causing Felt UI to appear instead of opening a new browser window. It attempts to ensure a “new window” intent is preserved across DBus remoting and handled correctly by browser command-line parsing, with accompanying enterprise tests.

Changes:

  • Add an Enterprise-only DBus remote-client adjustment to treat “no-arg” activations as a -new-window request.
  • Extend BrowserContentHandler to handle -new-window when the flag is present but has no parameter.
  • Update Felt enterprise tests to cover new-window/private-window invocations with and without URLs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
toolkit/components/remote/nsDBusRemoteClient.cpp Attempts to append -new-window when the remote command line has no args (Enterprise-only).
browser/components/BrowserContentHandler.sys.mjs Adds handling for -new-window with no param by catching NS_ERROR_INVALID_ARG.
browser/extensions/felt/api.js Changes how Felt opens new windows when no URL is provided (now forces about:home).
testing/enterprise/test_felt_browser_new_window_from_cli.py Expands CLI window-opening test coverage to include no-URL cases and private windows.
testing/enterprise/test_felt_browser_rapid_new_windows_from_cli.py Aligns CLI invocations with updated profile handling for rapid window creation.
Comments suppressed due to low confidence (2)

browser/extensions/felt/api.js:195

  • This change forces a non-empty URL ("about:home") and always passes an nsISupportsString args to BrowserWindowTracker.openWindow. That alters the default behavior when url is omitted: (1) it bypasses BrowserWindowTracker.openWindow's built-in private-window default that loads about:privatebrowsing when private: true and args is null, and (2) it overrides BrowserHandler.defaultArgs (homepage/newtab/about:blank depending on prefs) for non-private windows. To preserve expected semantics for “new window/private window with no URL”, keep args as null when no URL is provided (and only construct nsISupportsString when a URL is explicitly present).
        if (!url) {
          url = "about:home";
        }

        let args = Cc["@mozilla.org/supports-string;1"].createInstance(
          Ci.nsISupportsString
        );
        args.data = url;
        lazy.BrowserWindowTracker.openWindow({
          private: wantsPrivate,
          args,
        });

testing/enterprise/test_felt_browser_new_window_from_cli.py:158

  • In the no-URL case, _wait_for_window_with_url(url or "about:blank", is_private=True) expects the new private window to show about:blank, but Firefox typically loads about:privatebrowsing for a new private window when no URL is supplied. After fixing the Felt no-URL forwarding (i.e., don’t force a URL), update this assertion to expect about:privatebrowsing (or query the expected default from the browser handler) to avoid failures/flakiness.
        subprocess.check_call(args, shell=False)

        self._wait_for_window_count(initial_count + 1)
        self._wait_for_window_with_url(url or "about:blank", is_private=True)


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread toolkit/components/remote/nsDBusRemoteClient.cpp Outdated
Comment thread browser/components/BrowserContentHandler.sys.mjs Outdated
@lissyx lissyx force-pushed the enterprise-bug2031652_new_window_linux branch 2 times, most recently from dafd3e2 to c308fe2 Compare May 4, 2026 17:48
@lissyx lissyx changed the title Bug 2031652 - Enterprise: add new-window when dealing with dbus remote client Bug 2031652 - Enterprise: queue opening new window on remoting call of Felt May 4, 2026
@lissyx lissyx force-pushed the enterprise-bug2031652_new_window_linux branch from c308fe2 to 0366b2b Compare May 4, 2026 20:17
@lissyx lissyx requested a review from gcp May 4, 2026 20:17
…f Felt

Interacting from Linux' dock or others over DBus to open a new window
launches "firefox" without any parameter. This results in Felt being
shown instead of opening a new window. Check in browser's command line
handler section of Felt, and if there is no URL list for a **non initial
launch** (i.e. a remoted call) then pass over queueing a new window.
@lissyx lissyx force-pushed the enterprise-bug2031652_new_window_linux branch from 0366b2b to 572194a Compare May 6, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch:main PR that should be merged on enterprise-main branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants