How to enable brotli compression on Android System Webview?

2.9k views Asked by At

I tested on Android Emulator with API level 30. I found that Chrome for Android supports brotli, however the Android System Webview doesn't support brotli by default.

For example, if I open the link https://stackoverflow.com on Chrome for Android, I can see following request header.

accept-encoding: gzip, deflate, br

If I open the same link on Webview Browser Tester, I will see following request header, which doesn't include br.

accept-encoding: gzip, deflate

I am using the WebView version: 83.0.4103.106. How to enable brotli support on Android System Webview?

1

There are 1 answers

1
genewwww On BEST ANSWER

https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/developer-ui.md, brotli is an experimental flag in the WebView settings, so you should enable this flag in your system setting