I am working on a safari extension and while using fetch to make a call to an api with the code below:
async function getSomething() {
try {
const response = await fetch("https:// www.xyz.com/abcs/", { # dont mind the space in the URL i created it to be able to post this question
method: "GET",
headers: {
"Content-Type": "application/json",
},
mode: "no-cors"
})
if (!response.ok) {
# something is wrong here
}
} catch (error) {
alert(error)
}
}
I am getting TypeError: Load failed from error above. not sure why and how this is possible because the same code work on chrome extension.
I looked all over the internet and not able to find why would this happen? Does safari require an extra permissions to make webRequest or am i missing something?