I am working on a Chrome extension where I would like to fetch a cross-origin image file. AFAIK, it is possible to fetch cross-origin resources in background.js with manifest 3. I have the following code in my manifest.json:
"host_permissions": ["<all_urls>"]
In background.js, I have the following code:
fetch(imageURL).then((response) => {
response.blob().then((blob) => {
console.log(blob);
});
});
blob seems to be coming in empty... I basically use the following to create the image:
URL.createObjectURL(blob);
However, I receive the following error:
Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.
I would be grateful for any guidance you might have. Thank you!
Doug