I was fiddling around this recently and came up with this piece of solution, although I'm still working on a way to make these persist (maybe with a daemon of sorts?).
Google Chrome and friends and forks have this file called "Local State." I have no idea what exactly that file is responsible for as a whole, knowing there seems to be some sensitive data in there as well, but this block particularly got my interest;
{
browser: {
"enabled_labs_experiments": [
"enable-parallel-downloading@1",
"ozone-platform-hint@1",
"wayland-text-input-v3@1"
],
"first_run_finished": true,
"last_whats_new_version": 131
}
}
The .browser.enabled_labs_experiments
is the path you're looking for here. You can set the flags and their values according to the chrome://flags
page.
For example, in the block above, the following flags are set respectively;
Keep in mind that this is an array variable. For example, if you want to replicate the flags I have enabled here on Linux using jq
, (assuming your profile is stored in $HOME/.config/google-chrome
);
jq '.browser.enabled_labs_experiments = [ "enable-parallel-downloading@1", "ozone-platform-hint@1", "wayland-text-input-v3@1" ]' $HOME/.config/google-chrome/Local\ State > $HOME/.config/google-chrome/localstate.new
mv $HOME/.config/google-chrome/localstate.new $HOME/.config/google-chrome/Local\ State
The new "Local State" file will look drastically different than the original one you had before you launch Chrome. That's normal since it's a JSON file and jq
prettifies its output for better human readability. Once you launch Chrome, your new flags will be picked up and the "Local State" file will be modified by Chrome to be in the same format as before.
Other pieces here include;
.browser.first_run_finished
: Boolean variable to indicate whether the user completed the "OOBE" or not. If this is set to false, you'll be greeted with the OOBE again upon next launch, potentially overwriting your existing profile as well..browser.last_whats_new_version
: The last major version Chrome opened the "What's New" page. If this is smaller than the major version you have installed (E.g. set to "130" while you have "131.x"), the next launch will cause Chrome to open the "What's New" page in a new tab upon next launch and set this back to the version you have installed.Side note: I'm not a Google employee but a computer engineering student who fiddles around Linux and similar a lot.