Presentation Screenshots Download Support Development Forum    

Welcome to the Community Forum.

Here you can discuss with other users or with the author, suggest new features, report bugs, ask for filters creation or correction, etc. Select the forum you wish to read or post below :

Forum > Wishlist, Feature request > unzip downloaded file

Pages : [1] Add a reply
User info unzip downloaded file
Aug 10 2011, 7:25 pm
Would be nice to have this feature:

Once file is downloaded, automatically decompress the file if it is an archive. Could use the command-line 7zip decompressor which is open-source.
Post #1
Aug 19 2011, 9:50 am

ASF doesn't work after you have downloaded the file.
ASF is used to change the path that Firefox will use to save the downloaded file.

Once you accept to download the file, ASF has already finished his job (changing the save path automatically before Firefox start downloading) and don't have access to the saved file.

Post #2
Dec 8 2011, 1:10 am
I would like to have a similar function, to download a document, while still opening it.

Could it by any change be possible to add support for launch of a little user-set command-line script, that have the file path as a parameter, quite similar to nppExec, if you know that? If possible, this could be much more powerful than already. I see this as an optional extra column in the filter box.

But this add-on is extremely useful anyway, just what I was looking for. I am very glad I found it. Also, I automatically like things that are open source. Thanks for making it!
Post #3
Dec 8 2011, 12:14 pm

Like I said in the previous post, ASF is doing its magic and fully complete it long before the user accept the save dialog to send the file into the download Manager.
Unlike other save managers (downloadSort, video download helper, DownThemall, etc.) ASF is not saving the file using its own stream downloading script, it only changes the "last used path" in Firefox's settings and let Firefox save the file using its default behavior without interfering.

ASF don't have any listener in the Download Manager to trigger an action when the download is completed.
Maybe it is possible to add it, but currently it's not designed to interact with the downloaded file.

I don't know if I can do it (I didn't check this part of Firefox yet).

I'm happy when other users find it useful too :)
I try to make it always better (but I'm working slow on improving it, sorry).

I'm not very good at programming it, and I'm often tweaking the existing functions, reading and replacing existing values, instead of using the correct API functions from Firefox (because I don't know them).

Providing a browsable source, I hope that someone can help and improve it to develop this add-on faster (They could always use it to create another add-on, but I hope other developers would use the sources to improve the existing one).
I had three other add-on developers helping me already :D

Post #4
Dec 9 2011, 10:35 pm
Thanks for the good answer!

This was also just an idea I came up with, and though it could make this handy plug-in even better. After thinking a little more about it, it also hit me that such a script will have to run after the download is complete, not just after the download is started, which, like you said, would have to have to use some kind of listener.

I would really like to see if I am able to understand some parts of the source code. I have never worked with plug-ins (only Java), so it do could be interesting topic to investigate. But I chronically have interesting things, that I would like to spend my time on. It wouldn't surprise me if I never got anything done. Even if I understand the main parts of it, I don't know if I am able to help.

PS.: What defines these icons, since mine differs?
Post #5
Dec 10 2011, 10:47 am

Thank for your interest in the sources.

All is written in javascript (Ecma script), so it's object oriented code, and it's using specific Firefox API to interact with the application.

The current sources were written for Firefox 1.5, and there are now a lot of new and updated functions I could use which are not compatible with older Firefox version, so I have to remove old compatibility to improve the code. It will be more readable and should be easier to understand after that update.

A little technical detail:
ASF is inserted in the download function of Firefox, and is triggered before the stream saving is initialized.
With right-click and menus, this script is loaded at Firefox start and is always in memory so I'm initializing ASF by rewriting the save function in memory by adding my functions.

But for Single click, I don't have access to that download script at all, it's not in memory until the user click on a link.
The script files are in two different places in Firefox source's folders, so I'm forced to use the save dialog to get the downloaded file informations, that's why the users have to choose "always ask" for all Myme type they want to filter.
I wish I could bypass this restriction.

It works like this:
- User click on a link
- The save dialog opens, and there's a listener on it that trigger ASF once the save dialog is fully processed and all Firefox scripts finished their work and unloaded from memory. (I don't have access to the scripts)
- ASF read the file's informations from that save window (file name, host name, link to the file)
- ASF store the last saved path into memory for later use (I'll add a way to set it back if the user cancel the download)
- ASF check the current download's data against the filters one by one, the matching filters are stored in an array
- If the user decided to show the list of matching filter, display them
- Set the "last save path" to the first matching filter's path.
- ASF is done.
The user can now choose to save the current file, Firefox will then launch his own downloading script which read the "Last saved path" setting to determine where to save the file.

Since Firefox 7.0.1, the "Last saved path" is stored on a site-by-site basis, so ASF is checking the current "Tab's URL" to determine the current "site's URL's Last saved path" to replace.
ASF 1.0.3 has a bug in this process as it's checking the TAB's url, while Firefox is sending the real page's URL (for example if the page is an iframe in a different website's URL).

I should place this information in the website's development>Technical menu instead of the forum, it would be easier to find for everyone.

About the Avatar icon, it's based on your username.
Post #6
Jun 9 2015, 10:35 am
Would it be possible to output the full filename with path to a log file, when ASF handles the saving of a file?

Then I could script something to monitor that log file and perform actions on the downloaded files, like unpack, rename, whatever...

It would also be quite simple to make the script wait for the file download to finish before touching the file.
Post #7
Edit / Delete
Pages : [1] Add a reply

Return to top