articleBody
| -
Hi,
Recently I am making a very simple ajax post request in content-script, for example
Blockquote
var xhr = new XMLHttpRequest();
xhr.open(âPOSTâ, tokenUrl, true);
xhr.setRequestHeader(âContent-Typeâ, âapplication/x-www-form-urlencodedâ);
xhr.onreadystatechange = function() {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
console.log(âSuccessâ);
}
}
xhr.send(âa=1&b=2â);
please note that the tokenUrl is actually on the same domain as the current tabâs domain, so actually I am not doing any CORS.
However if I inspect the network, the Origin header is not set, I also tried on Chrome extension, the Origin header is set correctly.
Besides, if I directly use the same ajax on Firefox tabâs console, the Origin header is set correctly
So it seems Firefox content-script misses the Origin header, Is there any idea to add it?
Thank you very much
|