Background I need to upload large product inventory to indexeddb on client side so that I can perform some offline operations. They json file size could be as large as 50 MB. So I uploaded the json file to google firebase storage with the intention to fetch the storage file, read the json and add them to indexeddb.
Question
what is the best way to fetch and read the file from google storage ?
Here is my fetch code
var fileUrl ="https://firebasestorage.googleapis.com/v0/b/konstant-ccbcc.appspot.com/o/storeid.json?alt=media&token=8d56ba73-331e-452e-b0d4-e552264feee3"
function loadJSON() {
fetch(fileUrl)
.then(function(resp){
return resp.json()
})
.then(function(data){
console.log(data)
})
}
this is error I am getting
Fetch API cannot load URL scheme must be "http" or "https" for CORS request. Uncaught (in promise) TypeError: Failed to fetch at loadJSON