1

I need in Chrome extension these actions:

  • Download binary file to temp
  • Unzip it (it's clear .zip package)
  • Move files from unpacked directory, to directory of my extension
  • Delete temp files

I've been looking for similar what Firefox Scriptable XPCOM interfaces offer, https://developer.mozilla.org/en/XPCOM_Interface_Reference

Is there any simple way to do this, or I need to create the components myself in C/C++ and one of NPAPI, PPAPI, NSPR ?

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
  • 2
    I can't speak to the capabilities of a chrome extensions, but if you do need to use C++ you'll be looking at NPAPI; PPAPI was essentially discontinued (replaced by NaCl, which *might* be able to dow hat you want, but not sure) and NSPR is just a runtime/utility library. XPCOM support is also gone from plugins as of FF 3.6. Check out http://firebreath.org if you do decide you need to use C++; it'll speed things up a lot. – taxilian Jan 18 '12 at 18:00
  • The [FileSystem API](http://www.html5rocks.com/en/tutorials/file/filesystem/) might be enough in this case. – Georg Fritzsche Jan 19 '12 at 01:06
  • Have you seen this: http://code.google.com/chrome/extensions/npapi.html – Adam Ayres Jan 19 '12 at 05:10
  • @GeorgFritzsche can you please expand your comment to answer, and list out what parts of `Filesystem API` should I use for these actions? Thanks – Marek Sebera Jan 19 '12 at 16:50
  • @AdamAyres yep, I've seen it, but problem is I'm not very good in pure C/C++ and I need to support multiple platforms (osx,win,lnx) – Marek Sebera Jan 19 '12 at 16:51
  • @taxilian hmm, strange, I use XPCOM (but maybe JSCOM) on Firefox since Gecko 1.9.1 to 9 without problem, can you post some relevant info? Thanks – Marek Sebera Jan 19 '12 at 16:53
  • @MarekSebera perhaps you're using a technique with which I'm unfamiliar, then; I do know that with NPAPI plugins you can't use XPCOM anymore, but maybe there is a way to make a C++ extension using it. – taxilian Jan 19 '12 at 17:00
  • @Marek: If you can [get the data in JavaScript](http://stackoverflow.com/questions/4845215/making-a-chrome-extension-download-a-file) you can write it & read it back using the methods in the article. Not having walked through this myself i can only assume that that'll work. – Georg Fritzsche Jan 19 '12 at 17:55
  • Have you made any progress on this? I am working on an extension with a similar requirement, I managed to implement unzipping process entirely in javascript using a library, and it works... but man it is SLOW :( – Matthew Feb 22 '12 at 17:16
  • @Matthew nope, I've left the problem, have you done any progress? I'd be glad for appropriate answer. – Marek Sebera Oct 08 '13 at 07:57

0 Answers0