I\'m in a Google Chrome extension with permissions for \"*://*/*\" and I\'m trying to make the switch from XMLHttpRequest to the Fetch API.
The extensio
From MDN
You can also get all the headers by accessing the entries Iterator.
// Display the key/value pairs
for (var pair of res.headers.entries()) {
console.log(pair[0]+ ': '+ pair[1]);
}
Also, keep in mind this part:
For security reasons, some headers can only be controlled by the user agent. These headers include the forbidden header names and forbidden response header names.