Skip to content

[FEATURE] Add Extra Args option to browser settings#4402

Merged
Jack251970 merged 3 commits intoFlow-Launcher:devfrom
DavidGBrett:add-extra-args-to-browser-configuration
Apr 16, 2026
Merged

[FEATURE] Add Extra Args option to browser settings#4402
Jack251970 merged 3 commits intoFlow-Launcher:devfrom
DavidGBrett:add-extra-args-to-browser-configuration

Conversation

@DavidGBrett
Copy link
Copy Markdown
Contributor

@DavidGBrett DavidGBrett commented Apr 9, 2026

Summary

  • added new prop ExtraArgs to CustomBrowserViewModel
  • add new row in SelectBrowserWindow to edit this
  • Update OpenInBrowserWindow and OpenInBrowserTab to pass along these extra arguments

Should close #2653
Doesn't explicitly handle profiles but this should allow users to set that up themselves.

UI Change

image

Summary by cubic

Adds an Extra Args field to custom browser settings so users can pass command-line flags when opening URLs. Works for both new window and new tab, and logs now note when Extra Args were provided without recording their contents.

  • Summary of changes
    • Changed: OpenInBrowserWindow/OpenInBrowserTab accept optional extraArgs and pass them to ProcessStartInfo.Arguments; PublicAPIInstance.OpenUri forwards ExtraArgs; error logs omit ExtraArgs and add a notice when present; SelectBrowserWindow layout adjusted; minor code quality and typo fixes in SearchWeb.
    • Added: ExtraArgs to CustomBrowserViewModel (and its Copy()), TextBox binding in SelectBrowserWindow.xaml, and locale key defaultBrowser_extraArgs.
    • Removed: None.
    • Memory: Negligible (one extra string per browser config; one locale string).
    • Security: Low risk; args are passed directly to the process. Logging no longer prints ExtraArgs, reducing risk of leaking sensitive flags.
    • Tests: No unit tests added.

Written for commit faf8ab5. Summary will update on new commits.

- added new prop ExtraArgs to CustomBrowserViewModel
- add new row in SelectBrowserWindow to edit this
- Update OpenInBrowserWindow and OpenInBrowserTab to pass along these extra arguments
@prlabeler prlabeler bot added the enhancement New feature or request label Apr 9, 2026
@github-actions github-actions bot added this to the 2.2.0 milestone Apr 9, 2026
@DavidGBrett DavidGBrett changed the title Add Extra Args option to browser settings [FEATURE] Add Extra Args option to browser settings Apr 9, 2026
@DavidGBrett DavidGBrett marked this pull request as ready for review April 9, 2026 19:34
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 9, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970
APR 0 additions & 1 deletions
MAR
FEB 7 additions & 4 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 99%

Flow.Launcher/PublicAPIInstance.cs

Activity based on git-commit:

Jack251970
APR
MAR 2 additions & 2 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 96%

Flow.Launcher/SelectBrowserWindow.xaml

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 9, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Flow.Launcher/PublicAPIInstance.cs">

<violation number="1" location="Flow.Launcher/PublicAPIInstance.cs:467">
P2: Raw browser `ExtraArgs` are logged in exception messages, potentially exposing sensitive command-line data in persistent logs.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aca07715-bfc3-45a9-9276-d2dbe871320e

📥 Commits

Reviewing files that changed from the base of the PR and between 246910c and faf8ab5.

📒 Files selected for processing (2)
  • Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs
  • Flow.Launcher/PublicAPIInstance.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

📝 Walkthrough

Walkthrough

Adds an ExtraArgs string to custom browser profiles, exposes it in the Select Browser UI and localization, ensures it copies with the profile, and forwards the value through PublicAPI.OpenUri into SearchWeb.OpenInBrowserTab/OpenInBrowserWindow when launching browsers.

Changes

Cohort / File(s) Summary
Browser Settings Model
Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs
Added public string ExtraArgs { get; set; } and included ExtraArgs in Copy().
Browser Launch Logic
Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs, Flow.Launcher/PublicAPIInstance.cs
Extended OpenInBrowserWindow/OpenInBrowserTab signatures with extraArgs; compose browserArguments to conditionally include extra args; PublicAPIInstance.OpenUri now forwards browserInfo.ExtraArgs and updates exception logging.
UI & Localization
Flow.Launcher/SelectBrowserWindow.xaml, Flow.Launcher/Languages/en.xaml
Added UI row and TextBox bound to ExtraArgs in SelectBrowserWindow; added defaultBrowser_extraArgs localization key.

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as SelectBrowserWindow
    participant VM as CustomBrowserViewModel
    participant API as PublicAPIInstance
    participant SW as SearchWeb

    User->>UI: Enter ExtraArgs
    UI->>VM: Bind/Save ExtraArgs
    VM->>VM: Copy() returns instance including ExtraArgs
    User->>API: Request OpenUri(url)
    API->>SW: OpenInBrowserTab/Window(url, browserPath, inPrivate, privateArg, extraArgs)
    SW->>SW: Build browserArguments: [privateArg] [extraArgs] url
    SW-->>API: Start process with browserPath + browserArguments
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • VictoriousRaptor
  • jjw24
  • onesounds
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature: adding an Extra Args option to browser settings, which directly reflects the primary changes across multiple files.
Description check ✅ Passed The description clearly summarizes the changes (ExtraArgs property, UI updates, method parameter additions) and explains the intent to address issue #2653 regarding browser profiles.
Linked Issues check ✅ Passed The PR successfully implements the core requirement from issue #2653: enabling users to pass command-line arguments (like --profile-directory) to open URLs in a specific browser profile.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the Extra Args feature: property addition, UI integration, method signature updates, and logging adjustments. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs (2)

55-55: Rename browserArguements to browserArguments.

Minor naming typo; worth cleaning up to satisfy lint/spell checks and improve readability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs` at line 55, The local
variable browserArguements has a spelling typo; rename it to browserArguments
everywhere it's declared and referenced (e.g., the declaration in SearchWeb.cs
and any usages in methods that build the browser command string) to fix
lint/spelling checks and improve readability, ensuring you update all
occurrences and preserve the existing logic (including the iexplore.exe
conditional).

55-58: Consider centralizing browser-argument composition.

The same privateArg + extraArgs + url concatenation now exists in two methods. A small shared helper would keep ordering/spacing behavior consistent over time.

Also applies to: 105-107

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs` around lines 55 - 58, The
browser argument string construction for the SearchWeb class is duplicated (see
the browserArguements concatenation that uses browserExecutableName,
inPrivate/privateArg, extraArgs and url); extract this logic into a single
helper method (e.g., BuildBrowserArguments or ComposeBrowserArguments) that
accepts browserExecutableName, inPrivate, privateArg, extraArgs and url and
returns the correctly ordered/spaced argument string, then replace both
duplicate concatenations (lines around browserArguements and the similar block
at 105-107) with calls to that helper to ensure consistent ordering and spacing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Line 467: The LogException call is logging raw browserInfo.PrivateArg and
browserInfo.ExtraArgs which can leak sensitive user-provided arguments; update
the LogException invocation in PublicAPIInstance.cs (the line that calls
LogException(ClassName, $"Failed to open URL in browser {tabOrWindow}: {path},
{inPrivate ?? browserInfo.EnablePrivate}, {browserInfo.PrivateArg},
{browserInfo.ExtraArgs}", e)) to redact those values—replace them with either
booleans indicating presence (e.g., PrivateArg != null, ExtraArgs != null) or a
fixed redacted string like "[REDACTED]" while keeping tabOrWindow, path,
inPrivate (or browserInfo.EnablePrivate) and the exception variable e unchanged.

---

Nitpick comments:
In `@Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs`:
- Line 55: The local variable browserArguements has a spelling typo; rename it
to browserArguments everywhere it's declared and referenced (e.g., the
declaration in SearchWeb.cs and any usages in methods that build the browser
command string) to fix lint/spelling checks and improve readability, ensuring
you update all occurrences and preserve the existing logic (including the
iexplore.exe conditional).
- Around line 55-58: The browser argument string construction for the SearchWeb
class is duplicated (see the browserArguements concatenation that uses
browserExecutableName, inPrivate/privateArg, extraArgs and url); extract this
logic into a single helper method (e.g., BuildBrowserArguments or
ComposeBrowserArguments) that accepts browserExecutableName, inPrivate,
privateArg, extraArgs and url and returns the correctly ordered/spaced argument
string, then replace both duplicate concatenations (lines around
browserArguements and the similar block at 105-107) with calls to that helper to
ensure consistent ordering and spacing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b126954-3b24-495f-9420-a5d7d5794693

📥 Commits

Reviewing files that changed from the base of the PR and between 3e320d5 and a2cd48f.

📒 Files selected for processing (5)
  • Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs
  • Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/PublicAPIInstance.cs
  • Flow.Launcher/SelectBrowserWindow.xaml

Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
@DavidGBrett DavidGBrett marked this pull request as draft April 9, 2026 20:43
@DavidGBrett DavidGBrett marked this pull request as ready for review April 10, 2026 12:01
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

@coderabbitai coderabbitai bot removed the enhancement New feature or request label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
Flow.Launcher/PublicAPIInstance.cs (1)

467-471: ⚠️ Potential issue | 🟠 Major

Redact PrivateArg in logs too (raw arg still exposed).

Line 471 still logs browserInfo.PrivateArg verbatim. That can leak sensitive user-provided flags/paths in logs.

🔒 Suggested fix
-                    string includesExtraArgs = string.IsNullOrWhiteSpace(browserInfo.ExtraArgs) 
-                        ? "" 
-                        : ", [including omitted Extra Args]";
-                        
-                    LogException(ClassName, $"Failed to open URL in browser {tabOrWindow}: {path}, {inPrivate ?? browserInfo.EnablePrivate}, {browserInfo.PrivateArg}{includesExtraArgs}", e);
+                    var hasPrivateArg = !string.IsNullOrWhiteSpace(browserInfo.PrivateArg);
+                    var hasExtraArgs = !string.IsNullOrWhiteSpace(browserInfo.ExtraArgs);
+                    LogException(
+                        ClassName,
+                        $"Failed to open URL in browser {tabOrWindow}: path={path}, inPrivate={inPrivate ?? browserInfo.EnablePrivate}, hasPrivateArg={hasPrivateArg}, hasExtraArgs={hasExtraArgs}",
+                        e
+                    );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/PublicAPIInstance.cs` around lines 467 - 471, The log call
inside the failed-open-browser block is leaking browserInfo.PrivateArg; update
the LogException invocation in the same method (the block that builds
includesExtraArgs) to avoid logging the raw PrivateArg value—replace
browserInfo.PrivateArg with a redacted indicator (e.g., "[REDACTED_PRIVATE_ARG]"
or a boolean/presence marker) or omit it entirely, keeping the rest of the
message format and symbols (ClassName, tabOrWindow, path,
inPrivate/browserInfo.EnablePrivate, includesExtraArgs) unchanged so
LogException still provides context without exposing sensitive flags.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 467-471: The log call inside the failed-open-browser block is
leaking browserInfo.PrivateArg; update the LogException invocation in the same
method (the block that builds includesExtraArgs) to avoid logging the raw
PrivateArg value—replace browserInfo.PrivateArg with a redacted indicator (e.g.,
"[REDACTED_PRIVATE_ARG]" or a boolean/presence marker) or omit it entirely,
keeping the rest of the message format and symbols (ClassName, tabOrWindow,
path, inPrivate/browserInfo.EnablePrivate, includesExtraArgs) unchanged so
LogException still provides context without exposing sensitive flags.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24b14ce7-2a3e-4b34-8052-3727083a7e0e

📥 Commits

Reviewing files that changed from the base of the PR and between a2cd48f and 246910c.

📒 Files selected for processing (1)
  • Flow.Launcher/PublicAPIInstance.cs

@Jack251970 Jack251970 added the enhancement New feature or request label Apr 16, 2026
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your contribution!

@Jack251970 Jack251970 enabled auto-merge April 16, 2026 07:48
@Jack251970 Jack251970 merged commit d0d41c6 into Flow-Launcher:dev Apr 16, 2026
3 checks passed
@DavidGBrett DavidGBrett deleted the add-extra-args-to-browser-configuration branch April 16, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web searches to use specific profiles

3 participants