Downloading blob image

2

1

Some websites have something like this:

<img src="blob:foo" alt="bar">

The "Save Image As" function in Firefox doesn't let me save the image blob:foo. I can't download the image by using "Save Page As" either. How can I download the image?

Anonymous

Posted 2018-10-06T18:33:42.673

Reputation: 21

Some pages protect the source, you may need to give us specific references. Fairly random ref from a photography site I'm a member of... https://www.viewbug.com/contests/travel-photography-project/81413133 You can view it but you can't 'get ' it, quite intentionally.

– Tetsujin – 2018-10-06T18:49:44.203

there is no generic solution, you will have to provide a specific example – Albin – 2018-10-06T18:52:16.337

Of course there is a generic solution – miknik – 2018-10-06T19:09:52.703

@miknik So provide an answer ... – DavidPostill – 2018-10-06T19:16:00.013

@DavidPostill Give me a chance :) – miknik – 2018-10-06T19:18:42.263

The method used here should work for images as well.

– harrymc – 2018-10-06T19:27:37.310

Answers

2

You just need to create your own element using the image source of the image you want to download, so as a basic example:

var image = document.querySelector('img');       // Image you want to save
var saveImg = document.createElement('a');       // New link we use to save it with
saveImg.href = image.src                         // Assign image src to our link target
saveImg.download = "imagename.jpg";              // set filename for download
saveImg.innerHTML = "Click to save image";       // Set link text
document.body.appendChild(saveImg);              // Add link to page

Now click the link and the image will download

miknik

Posted 2018-10-06T18:33:42.673

Reputation: 121

That works perfectly, just copy and paste. Thank you – Luiz Cordeiro – 2019-08-16T13:22:55.293

1

If you open the Developer Tools of the browser, for example, F12 in Chrome. Switch to the Network view, check "Preserve log" and "Disable cache" and reload the page.

Find the resource of interest, if it helps you can filter to the type, e.g. Img, Media, etc. After clicking the resource you can click the Preview tab and save the resource from there.

Otherwise, I'm sure a tool such as Chrome Cache View - https://www.nirsoft.net/utils/chrome_cache_view.html would be able to help.

HelpingHand

Posted 2018-10-06T18:33:42.673

Reputation: 1 435