如何在 Android System Webview 上启用 brotli 压缩?

How to enable brotli compression on Android System Webview?

我在 Android 模拟器上测试了 API 级别 30。我发现 Chrome for Android 支持 brotli,但是 Android System Webview 不默认不支持brotli

例如,如果我在 Chrome 上为 Android 打开 link https://whosebug.com,我可以看到以下请求 header.

accept-encoding: gzip, deflate, br

如果我在 Webview Browser Tester 上打开相同的 link,我将看到以下请求 header,其中不包括 br.

accept-encoding: gzip, deflate

我使用的WebView版本:83.0.4103.106。如何在 Android System Webview 上启用 brotli 支持?

https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/developer-ui.md, brotli 是 WebView 设置中的实验性标志,因此您应该在系统设置中启用此标志