Update 1 (05/26/2020 @ 01:30 AM ET): The flag that lets Google Chrome darken Google Search results is now live and working. Scroll to the bottom for more information. The article as published on May 14, 2020, is preserved below.
The introduction of a system-wide dark mode toggle in Android 10 has had a massive effect on the UI designs of many Android apps. A lot of Android apps have built-in dark themes now, and many of these apps also sync their dark theme with Android 10’s toggle. Google Chrome already does this for its toolbar and settings pages, but soon it’ll also darken Google Search results in sync with Android 10’s dark mode toggle.
Google first introduced dark mode support as a feature flag in Chrome browser version 74. They later introduced a dedicated “Themes” section in Chrome’s settings, and they also added a feature flag to render all web content using a dark theme. While it’s currently possible to display Google search results in a dark theme by using the #enable-force-dark feature flag, doing so may break the experience of many websites that haven’t been designed with darker background colors in mind. With the new #enable-android-dark-search feature flag that was just merged in the Chromium Gerrit, though, you’ll be able to show darkened search page results so long as Chrome’s dark mode is enabled. And since Chrome’s dark mode can be set to sync with the “system default” theme, that means the darkened search results can sync with Android 10’s system-wide dark mode toggle.
This feature is still a work-in-progress, though, as Google search results weren’t being darkened when I enabled the feature flag on a freshly built Chromium APK running on a Pixel 4 on Android 10. As 9to5Google pointed out last week when the commit first emerged, Google could have accomplished this goal through the “prefers-color-scheme” media CSS feature. However, that doesn’t seem to be the approach that Google is taking here.
In a related commit, Google details how the Chrome browser will show darkened search results when the user has Android 10’s dark mode enabled. The description states that “when the user is in night mode and visits Google search (homepage or results),” Google Chrome will “append an extra URL parameter to indicate that this user should get the darkened version of the website.” It seems that Chrome will append ?cs=1 to any Google Search URL if the user has dark mode enabled. Here’s an example of how this URL parameter darkens the Google Search results page:
The #enable-android-dark-search feature flag is currently available in the latest Chromium build but will eventually make its way over to Dev, Beta, and Stable releases. We’ll be tracking this feature as its development progresses.
Update: Google Chrome flag to darken Search results is now live
When we first published our article on May 14, 2020, the feature flag which darkened Google Search results within Chrome was not working, and we had to make use of a URL workaround to showcase what the feature would look like. Now, the flag is working on the latest Canary release, allowing Chrome to change the results UX in-line with Android 10’s dark mode settings synced across the system. To enable the feature on a recent Chrome Canary release, load up chrome://flags and set the “Show darkened search pages on Android” option to “enabled”.
Story Via: AndroidPolice