0

I am currently creating a Chrome extension (which uses javascripts mainly) that allows users to scrape the images on a webpage and download them. I have finished the link scraping part, and the code will return an array like:

["http://example.com/image1.jpg","http://example.com/image2.jpg"]

But how do I download all of the links in ONE CLICK? I tried listing all photos on a new tab and let the users to Ctrl+S save the page. But this greatly affects the UI and I do not like it. I do not host webpage so server side script may not be working.. Any other solutions?

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
MK Yung
  • 4,344
  • 6
  • 30
  • 35
  • does this work" http://stackoverflow.com/questions/4845215/making-a-chrome-extension-download-a-file ? – Elvis D'Souza Jun 26 '12 at 15:46
  • I haven't tried it but looks like it only supports one download per time? For my extension the user may have up to 50 pictures. I don't want them to be prompted for 50 times... – MK Yung Jun 26 '12 at 16:23

1 Answers1

0

As far as I know, Chrome extensions technically can't save files to disk like Firefox.

The only way to do this is using NPAPI Unfortunately, extensions using npapi will most likely not be accepted by the Web Store due to security problems. Of course it'll be okay if you use it for yourself or host the extension on your website.

You can install and examize the code of the following extensions, maybe you can even use the provided npapi too:

Screen Capture (by Google) https://chrome.google.com/webstore/detail/cpngackimfmofbokmjmljamhdncknpmg

Chrome Toolbox (by Google) https://chrome.google.com/webstore/detail/fjccknnhdnkbanjilpjddjhmkghmachn

Awesome Screenshot: Capture & Annotate https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce

Download Asisstant (by Google) - got killed I guess.

kntx
  • 154
  • 1
  • 5