Fwd: Intent to Add: --focus command-line flag for browser content focusing

69 views
Skip to first unread message

Yoav Weiss (@Shopify)

unread,
Aug 22, 2025, 1:48:02 AMAug 22
to flags-dev, Elly, hel...@januschka.com


---------- Forwarded message ---------
From: Helmut Januschka <hel...@januschka.com>
Date: Thu, Aug 21, 2025 at 11:15 PM
Subject: Intent to Add: --focus command-line flag for browser content focusing
To: yoav...@chromium.org <yoav...@chromium.org>, flag...@chromium.org <flag...@chromium.org>, Elly <elly...@chromium.org>


Hi Team,

 

I'd like to propose a new command-line flag for chrome: `--focus`. I'm writing to ask for guidance on next steps and to get feedback from the community.

 

Summary:

  The --focus flag would allow Chrome users to search and focus existing browser tabs/windows before creating new ones, reducing tab duplication and improving personal scripting workflows.

 

Background

  CL: http://crrev.com/c/6850334  (feature + tests)
  Issue: http://crbug.com/439499872 (includes more flag details)
  

Flag Details
  - Flag: --focus=<selector>[,<selector>...]
  - Optional: --focus-result-file=<path> for automation feedback
  - Behavior: Searches existing tabs/apps using URL patterns or app IDs, focuses most recently used match, optionally opens fallback URL if no matches found

 

 

Key Features
  - Suffix wildcard matching (https://github.com/*)
  - PWA targeting (app:gmail-app-id)
  - Most Recently Used (MRU) selection for multiple matches
  - Optional JSON result file for programmatic use
  - Cross-platform desktop support (Windows, Mac, Linux, ChromeOS)

 

Use Cases
  - Desktop launchers focusing existing content instead of creating duplicates
  - Development workflows returning to most recently used repository/document
  - Automation scripts that need deterministic tab focusing behavior

 

Example Usage

  - Focus most recent GitHub tab or do nothing
    chrome --focus="https://github.com/*"

  - Focus Gmail app or most recent Gmail tab, with fallback
    chrome --focus="app:gmail-id,https://mail.google.com/*" https://mail.google.com

  - With result file for automation
    chrome --focus="https://meet.google.com/*" --focus-result-file=/tmp/result.json

 

Implementation Status

  - Core functionality implemented
  - Unit and browser test coverage

 

 

Questions for Discussion

  - What are the next steps needed to get this feature reviewed and potentially landed?
  - Are there any concerns about the flag syntax or behavior?
  - What additional approvals or design reviews might be needed?

 

The implementation is ready for review and I'm looking for guidance on the Chrome process for landing new command-line flags.

 

Thanks,
hjanuschka

Avi Drissman

unread,
Aug 26, 2025, 11:33:34 AM (10 days ago) Aug 26
to Yoav Weiss (@Shopify), Nico Weber, Rick Byers, flags-dev, Elly
- Helmut (for now)
+ ATLs

Hi! Thanks for bringing in the Flags Team.

The Flags Team owns chrome://flags, not command-line flags, so this isn't our area. However, as a senior member of the Chrome team, I have an opinion.

Command-line flags are discouraged because they are unowned and because they're one-off with no supporting machinery so they're a free-for-all. The most infamous example of this is --kiosk, where it completely changes how Chromium works, is entirely unowned, and when we've floated the idea of removing it, everyone outside of Google screams bloody murder because it is load-bearing for them.

This proposal is to add an improvement to how Chromium opens tabs from the command line. This is also entirely unowned code, though far, far less problematic than --kiosk because it's a one-time triggered action rather than an ongoing alteration of how Chromium operates. On one hand, I find it delightful that this new feature has more testing than most new features nowadays. But on the other hand, I worry about that being more unowned code in an area of the codebase that already has little to no ownership.

I believe that the proposed change does actually fix an actual issue for people who use Chromium heavily from the command line. But it shines a spotlight on an ownership issue we have. Helmut has been contributing to Chromium for a while now (is he an actual contributor?) and if we're willing to deputize him to be a real owner here that could be a way forward. But can he be a real OWNER? This is starting to hit policy questions. +ATLs for their thoughts.

Avi

--
You received this message because you are subscribed to the Google Groups "flags-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flags-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/flags-dev/CAOmohSLBdjdYbFcHr8HxEZpTFKpVJJMRXamBzN%2Bmjp4rYWHiww%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages