Is there any javascript code to access the custom header after setting it in OpenInWebView?
you can access the custom HTTP headers only at the point you make the request, not after.
When you use OpenInWebView with Custom Headers, those headers are sent only with that navigation request.
Browsers and WebViews don’t expose a “getRequestHeaders” API for a loaded page due to security restrictions (CORS, privacy).
Once the page is loaded, you cannot read back the headers you sent — they’re not available to JavaScript in the page.
thanks for your reply. may i know then what is the best practice/method to pass tokens over to webviews?
Currently I have succeeded in passing token by postmessage using iframe. But this may not be ideal user experience. I am trying to embed a chatbot agent in mobile.