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