I am trying to do the below
fetch("https://www.google.com/search?q=trees&tbm=isch&sxsrf=ALiCzsYCq08DI1a2kANT5mYBvDyYi7keWw%3A1671527330860&source=hp&biw=2025&bih=1279&ei=onuhY7uXMcaA0PEP6t2GuAo&iflsig=AJiK0e8AAAAAY6GJshVTus5cslLxfh_vqy0n5ro5Half&ved=0ahUKEwi78KPG7If8AhVGADQIHequAacQ4dUDCAc&uact=5&oq=trees&gs_lcp=CgNpbWcQAzIICAAQgAQQsQMyCAgAEIAEELEDMggIABCABBCxAzIFCAAQgAQyBQgAEIAEMggIABCABBCxAzIICAAQgAQQsQMyCAgAEIAEELEDMgUIABCABDIFCAAQgAQ6BAgjECc6CAgAELEDEIMBOgsIABCABBCxAxCDAToHCCMQ6gIQJzoFCAAQsQNQAFibFmD8FmgDcAB4AIABN4gBkAOSAQE4mAEAoAEBqgELZ3dzLXdpei1pbWewAQo&sclient=img", {
})
.then(response => {
console.log(response)
})
but this is giving me errors
Access to fetch at 'URL' from origin 'chrome-extension://...' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I have tried using headers with 'Access-Control-Allow-Origin' but this still return the same error. I have also tried using 'no-cors'. This works but then there is no body returned and I need the HTML for parcing.
I also have the below but it did not fix the issue.
"host_permissions": [
"https://www.website.com/*"
],