1fetch('https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg')
2 .then(res => res.blob()) // Gets the response and returns it as a blob
3 .then(blob => {
4 // Here's where you get access to the blob
5 // And you can use it for whatever you want
6 // Like calling ref().put(blob)
7
8 // Here, I use it to make an image appear on the page
9 let objectURL = URL.createObjectURL(blob);
10 let myImage = new Image();
11 myImage.src = objectURL;
12 document.getElementById('myImg').appendChild(myImage)
13});