firebase.json file:
{
"hosting": {
"public": "public",
"cleanUrls": true,
"headers": [
{
"source": "**",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
]
}
}
I Thought this would have fixed the issue but from my main page index.html, but when i use the code, it still blocked do to cores policy and i dont have the budget to get firebase functions right now but i got the firebase.json code from another post but it didnt help:
function download_file(val, filename) {
var storage = firebase.storage();
storage.ref(val).getDownloadURL().then(function(url) {
// `url` is the download URL for 'images/stars.jpg'
alert(url, filename)
// This can be downloaded directly:
var xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = (event) => {
var blob = xhr.response;
};
xhr.open('GET', url);
xhr.send();
}).catch(function(error) {
console.log(error)
});
}
PLEASE dont close this post, instead ill mark it fixed, i dont wanna get banned from it so please... I Got My Code From Here: LINK[Stack Overflow Post][1]
[1]: Access-Control-Allow-Origin added to firebase.json but missing from the file response header But its not working...