While WebView supports toggling arbitrary flags on debuggable devices, we also support toggling a curated set of experimental flags/features on production Android devices. We expose these features as part of WebView‘s on-device DevTools. This is similar to Chrome’s chrome://flags
tool.
The flag UI is part of “WebView DevTools,” an on-device tool that ships with device's WebView implementation. You can launch WebView DevTools by any of the following:
The best way to launch WebView DevTools is to download WebView Dev or WebView Canary. These channels will have a launcher icon which will launch WebView DevTools.
If you have adb installed, you can connect your Android device to launch DevTools:
adb shell am start -a "com.android.webview.SHOW_DEV_UI"
Newer versions of WebView shell have a menu option to launch WebView DevTools. If your copy of WebView shell doesn't have this option, you may need to rebuild it yourself.
Once you've launched WebView DevTools, tap the “Flags” option in the bottom navgation bar. You can scroll through the list to find your desired feature/flag (ex. “highlight-all-webviews”), tap the dropdown (look for “Default”), and tap “Enabled” in the dialog popup. You can enable (or disable) as many flags as you need.
Kill and restart WebView apps so they pick up the new flags.
When you're done, open the notification tray and tap the WebView DevTools notification to go back to the flag UI. Tap “Reset all to default” and kill and restart WebView apps to go back to the default behavior.
Like Chrome, WebView supports A/B experiments and feature rollouts through variations (AKA “field trials” or “Finch”). The flag UI can override the field trial config, either to enable an experimental feature to ensure your app works correctly, or to disable an experiment to determine if this is the root cause for a WebView behavior change breaking your app. Simply tap “Enabled” or “Disabled” in the UI; “Default” means WebView will pick up the random field trial experiment.
If you find an experiment is the root cause for app breakage, please file a bug, mention which experiment, and link to your app's Play Store page for our team to investigate.
You can also use the flag UI to download new field trial configs (“seeds”) more quickly, to verify the next seed will fix app breakage. Enable all of the following:
finch-seed-expiration-age=0
finch-seed-min-update-period=0
finch-seed-min-download-period=0
finch-seed-ignore-pending-download
Restart your app, kill it, and restart it a second time. Your app should be running with the latest WebView variations seed.
If you're intending to launch a feature in WebView or start a field trial (AKA Finch experiment), we highly encourage you to add to the list (ex. CL, CL).
Exposing your feature this way has several benefits: