Bug 2031652 - Enterprise: queue opening new window on remoting call of Felt#796
Open
lissyx wants to merge 1 commit intomozilla:enterprise-mainfrom
Open
Bug 2031652 - Enterprise: queue opening new window on remoting call of Felt#796lissyx wants to merge 1 commit intomozilla:enterprise-mainfrom
lissyx wants to merge 1 commit intomozilla:enterprise-mainfrom
Conversation
d690b89 to
704a9d7
Compare
Contributor
Author
|
Looks to be badly broken on macOS, I'll investigate |
There was a problem hiding this comment.
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-windowrequest. - Extend
BrowserContentHandlerto handle-new-windowwhen 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
nsISupportsStringargstoBrowserWindowTracker.openWindow. That alters the default behavior whenurlis omitted: (1) it bypassesBrowserWindowTracker.openWindow's built-in private-window default that loadsabout:privatebrowsingwhenprivate: trueandargsis null, and (2) it overridesBrowserHandler.defaultArgs(homepage/newtab/about:blank depending on prefs) for non-private windows. To preserve expected semantics for “new window/private window with no URL”, keepargsasnullwhen no URL is provided (and only constructnsISupportsStringwhen 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 showabout:blank, but Firefox typically loadsabout:privatebrowsingfor 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 expectabout: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.
dafd3e2 to
c308fe2
Compare
c308fe2 to
0366b2b
Compare
…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.
0366b2b to
572194a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Steps to verify changes:
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 nightlyExpected result:
A new window is opened