I'm trying to start simple and just fetch a page within a function from a Chrome extension. I think I have the extension correct as it executes my code. My problem is I'm getting the error:
ReferenceError: reponse is not defined
Here is my code:
function requests(url) {
fetch(url,{mode: "no-cors"})
.then(response => {
if (!response.ok) {
throw new Error(`Request failed with status ${reponse.status}`)
}
return response.json()
})
.then(data => {
console.log(data.count)
console.log(data.products)
})
.catch(error => console.log(error))
}
Can someone help me get started on this? TIA.