Hi
I have an issue about open web view on mobile
So this the problem. How to add request header before launch open web view (iframe or In App Browser)?
The example is add header name (x-application token) and value (kazxcffafsdfsv)
Thanks for your reply
Hi Jonatan,
There is a javascript method to could help you. I pasted it below;
Greetings,
Vincent
source: https://stackoverflow.com/questions/17694807/how-to-set-custom-http-headers-when-changing-iframe-src
Rather than using a data URI, or setting the contents to a string, you can use URL.createObjectURL(), and set it as the src of the iframe.
URL.createObjectURL()
src
var xhr = new XMLHttpRequest(); xhr.open('GET', 'some.pdf'); xhr.onreadystatechange = handler; xhr.responseType = 'blob'; xhr.setRequestHeader('Authorization', 'Bearer ' + token); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { // this.response is a Blob, because we set responseType above var data_url = URL.createObjectURL(this.response); document.querySelector('#output-frame-id').src = data_url; } else { console.error('no pdf :('); } } }