Hacker News new | past | comments | ask | show | jobs | submit login
Chromium has over 1600 command-line switches (peter.sh)
57 points by ysabri 5 months ago | hide | past | favorite | 42 comments



We're talking about the company that had to contribute arbitrary-length command lines to the Linux kernel, and whose flags library supports reading the flags from a file, in case your appetite for flags is insatiable.

https://github.com/torvalds/linux/commit/b6a2fea39318e43fee8...


Lots of flag libraries support @argfiles, it's useful for Windows amongst other places.

The real fun story about Google and flags is from the days when their flags library supported flags being passed in gzipped base64 form ... via a flag. I think the reason was there was a server that could take the whole configuration in the form of a flag, but it had got too large for Linux at some point and they didn't want to load the config from a file because there was better support for canaried/partial rollouts of flag changes than data file changes. Or something like that.


It's actually even more. --enable-features takes a list of features, and --force-fieldtrials takes a list of field trials. And each argument of --enable-features can itself have "sub-features", so you can have syntax like --enable-features=CoolFeature:Widget/1/Bells/cow*

I don't know if the syntax for all of this is actually documented anywhere, but anything in chrome://flags seems to be plumbed through via --enable-features. You can see the syntax in chrome://versions?show-cmd-variations.

It would be cool if someone updated the autogen table to also include the list of available features and field trials.


I didn't know that's where the feature flags lived. I imagine documenting them is tough because it'll heavily depend on the version since they graduate to become standard features over time.


`--birch-is-evening`

> sets the birch ranker to assume it is evening for birch chip ranking purposes.

i begin to suspect there might be a better way of organizing all this functionality


I've been nerd sniped and am trawling through the code trying to understand what this means.

Apparently there is something called a "Birch Bar" which I've never heard of, it seems to be related to calendar events... which, is weird as I have never seen a native calendar in chrome.

https://sourcegraph.com/github.com/chromium/chromium/-/blob/...


I think that's part of the ChromeOS window manager. Note that the file you posted is in the "ash" namespace.

> Ash is the “Aura Shell”, the window manager and system UI for Chrome OS.

https://chromium.googlesource.com/chromium/src.git/+/refs/he...

I'd guess someone at Google decided to use tree-related codenames for ash components :)


https://chromium.googlesource.com/chromium/src.git/+/lkgr/as...

    “Shelf party” was an Easter-egg feature that made shelf icons fly around the screen. It did not launch and was removed in June 2023.
Now I want to see if I can find a May 2023 build of chromium with a --enable-shelf-party flag.


That’s when `—organize-functionality` gets added


Google pivoting to the mulch business?


It made me chuckle that the comment in "--accept-lang" states "When commenting your switch, please use the same voice as surrounding comments", and the very next flag breaks that rule.


My favorite is the one that disables CORS... makes it easy to write local clients/tools that can get data from anywhere:

--disable-web-security


I also found this extension to be useful and more configurable: https://chromewebstore.google.com/detail/allow-cors-access-c...


do you or anyone else happen to know an extension that allows getUserMedia to work without https? i just need a photo from a webcam (a la <input file capture> that opens a camera on a smartphone) for a local network webapp. configuring https just for this is fickle.


it should work over http in the special case of localhost. try port forwarding localhost:80 to the webapp.


Love it! Thank you.


Weren't we able to have custom frontends for facebook at some time?


I've tested 300+ of them for the purpose of reducing browser fingerprintability while building ArchiveBox's puppeteer support. It was quite a journey!

Lots of subtle GPU rendering stuff that can easily give away a headless browser, or that differs between OS's in ways that can be used to detect when a browser doesn't match the expected behavior for the OS it reports to be running on.

Some of my favorite lesser-known ones:

'--install-autogenerated-theme=169,32,85', '--allow-legacy-extension-manifests', '--no-pings', '--no-first-run', '--no-default-browser-check', '--suppress-message-center-popups', '--ash-no-nudges', '--disable-infobars', '--use-mock-keychain', '--disable-cookie-encryption', '--js-flags=--random-seed=1157259159',


I wonder if there is a reference behind '--ash-no-nudges', I tried looking but found nothing.


ash is common abbreviation from "Aura shell"; read it like Gtk/Qt. Nudges is also a common term recently - see https://medium.com/@helloannapo/behavioural-design-basics-co...


--false Value indicating whether flag from command line switch is false.

So I can have fun with --false=true --true=false?


Wait, what? I missed this one, what does it actually do haha


This could be a good thing. Too many applications are overly opinionated, make decisions on behalf of the user (without the ability to override), minimize user choice, don't respect the user's configuration, and in general, do things their way rather than the user's way. More switches is often better.


I've actually made it a design principle that whenever two or more choices seem to present themselves and I have to decide whether to do it the one or the other way, provided it's not too difficult to implement both, I do that and then I have the much lesser burden of deciding on the most reasonable default. This is also the result of decades-long frustrations with app behavior that is artificially restricted


I agree; it also makes using Chromium for all sorts of automation a lot easier. I found these because I wanted to automate generating PDFs of a report page.


I'd like to think `--all` just turns them all on at once.


I remember doing this expansion when I worked there: every module you include has its own set of command flags, and none get suppressed when you include them, so you end up with colossal unions like this. It's not as though any one team said, "Hey, let's have 1600 flags!"


But, apparently, no one has said "Hey, let's not have 1600 flags", either.


My candidate for Hardest Thing in Tech:

Getting rid of anything that's already out there. Someone, somewhere, is using it.

Google's apparently mastered that art, at least.


I had to use some odd Chrome command line arguments to keep a particular fragile kiosk-mode-like use of a prototype working long enough.

It worked for our purposes, but we feared an update might break it. I went to some effort to prevent updates outside our control.

(The command line arguments can be removed over time. Also, the behavior/correctness can change over time. I wouldn't expect all combinations of arguments to be tested in all future releases.)


Many seems the old joke from Monty Python's about "makeSnafucated" method documented as "/* make snafucated */"...


Former chromium dev here - I wouldn't be surprised if many of these are deprecated and just need to be cleaned up (removed from the codebase).


How many if you had to estimate?

While testing, I noticed that some flags do nothing or contradict each other, but I wasn't sure if I was correctly using/understanding the flags.


I wonder if services like Gmail have hundreds of feature flags at any given point.


They do: Borg (Google's internal orchestration system) is very, very flag-driven and it's commonplace for services to have hundreds or thousands. That's presumably how Chromium ended up the same way.


Yes, everything internally has many flags (hundreds or thousands), so much so that they raise the command line size limit (ARG_MAX) in the kernel. I think it was around 2GB when I left. The internal frameworks really encourage using flags too, there's a @Flag decorator for Java that's sprinkled all over the code and sometimes nested extremely deeply down chains of classes that promote this behavior (abseil, (https://abseil.io/docs/cpp/guides/flags) has macros for this too).


Any insight into what —? could be?


It links to https://source.chromium.org/chromium/chromium/src/+/main:ui/... and so does --vulkan and --metal and similar ones.

In the code they have

  const char kANGLEImplementationMetalName[] = "metal";
  const char kANGLEImplementationNoneName[] = "";
So either they intentionally made -- be the none one, or they unintentionally ended up having it be that because the argument names are extracted from the strings and someone put an empty string for the none one.

It seems weird that it would be intentional though so my guess it was by accident. (For example separate people made the arg parsing thing from the person that put an empty string there.) I say it seems weird because conventionally many cli utilities use -- to mean end of arguments. For example so that an argument that is the name of a file can start with dash dash followed by something without being interpreted as a flag. And also so that a command that executes another can separate its own arts from the args of the command it is executing. Things like that.


this is because it's also how Google works internally - every binary has a trillion flags so everything is binary-start configurable.


amazing stuff. I love feature toggles


This is amazing. My kind of program


All this and yet input methods still don't work on Wayland




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: