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
Also remember you may need to pass the response to next .then() after res.headers.get() if you parse it. I keep forgetting about that...
var link
const loop = () => {
fetch(options)
.then(res => {
link = res.headers.get('link')
return res.json()
})
.then(body => {
for (let e of body.stuff) console.log(e)
if (link) setTimeout(loop, 100)
})
.catch(e => {
throw Error(e)
})
}
loop()