Chrome://flags is a powerful tool for developers and advanced users to experiment with experimental features in the Chrome and Chromium browsers. One common question that arises when using chrome://flags is: What determines the 'Default' value for each flag? This article dives deep into the mechanics behind these default settings and how they differ between Chromium and official Chrome builds.
The 'Default' value in chrome://flags isn't always straightforward. Here's a breakdown of the factors that decide what the 'Default' setting will be:
Field trials play a significant role in determining the final 'Default' value. As Peter Kasting from the Chromium team explains, the field trial code can toggle a flag's state, meaning the value you see as 'Default' might change depending on which field trial your build falls into. Selecting 'Enabled' or 'Disabled' forces that value, preventing field trials from changing it.
A key point raised in the discussion is the difference in default values between Chrome and Chromium. For example, the 'Experimental QUIC protocol' might be enabled by default in Chrome but disabled in Chromium. This is because official Chrome builds use the VariationsService to fetch field trial configurations from Google's servers. This service allows Google to remotely configure and adjust features for different user groups.
The Chromium team discussion reveals a crucial limitation: developer builds generally cannot perfectly replicate the behavior of official Chrome builds unless they also fetch field trial configurations from the server. This is because official Chrome builds rely on the VariationsService to manage feature configurations through field trials.
While you can adjust flags in your local browser instance, changing the actual default value within a Chromium build is more complex. Here's what the experts suggest:
ENABLE_DISABLE_VALUE_TYPE
, SINGLE_VALUE_TYPE
) in files like about_flags.cc
.Feature
API (e.g., kCrossOriginMediaPlaybackRequiresUserGesture
). Overriding these features might be necessary to change the default behavior.Important Note: Modifying Chromium's source code requires a deep understanding of the codebase and can have unintended consequences. Always proceed with caution and thoroughly test your changes.
By understanding these factors, developers can better interpret the behavior of chrome://flags and make informed decisions about enabling or disabling experimental features in their Chromium-based browsers.