Gimli
Gimli

Reputation: 29

How to detect if dark dark mode is on in fb in-app browser?

For normal browsers we have query:

@media (prefers-color-scheme: dark) {

}

But this in not working for fb in-app browser, anyone knows a way to detect it there?

Upvotes: 1

Views: 227

Answers (1)

DenverCoder9
DenverCoder9

Reputation: 2559

Facebook's in-app browser uses a so-called WebView to render the content. On Android, WebViews can support prefers-color-scheme, but it looks like Facebook haven't set the DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING mode that would be necessary for this to work. If Facebook doesn't change this, the only solution is to use a proper browser.

Upvotes: 1

Related Questions