Android- EXTRA_HEADERS is not reflecting in updated Chrome version greater than 83

后端 未结 2 1539
谎友^
谎友^ 2020-12-22 01:16

Earlier the EXTRA_HEADERS passed to the customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers), was working fine. After Chrome updated to 83, it stopped passing th

相关标签:
2条回答
  • 2020-12-22 02:08

    I'd like to elaborate a bit on the accepted answer. The Chrome 83 indeed removed the possibility to add custom headers, yet Chrome 86 reverted this functionality under certain strict conditions. See https://developers.google.com/web/android/custom-tabs/headers. Just follow an example from https://github.com/GoogleChrome/android-browser-helper/tree/master/demos/custom-tabs-headers.

    TD;DR - you must own both app and website for making it work as the changes in app and The Digital Asset Links protocol file (website address (...)/.well-known/assetlinks.json) are needed.

    Be sure to follow the tutorial and example precisely. In my case I stumbled with the one detail - CustomTabsIntent Builder needs a CustomTabsSession object set up.

    Code changes in Chromium project indroducing a change can be found here: https://chromium-review.googlesource.com/c/chromium/src/+/2311582

    0 讨论(0)
  • 2020-12-22 02:14

    Adding custom headers was removed due to being a vulnerability. CORS safe-listed request headers are still supported. You can read more about this change here: http://crbug.com/873178

    0 讨论(0)
提交回复
热议问题