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 > [Accepted/Partially?] "Size" condition in filters

Pages : [1] Add a reply
User info [Accepted/Partially?] "Size" condition in filters
Mar 19 2010, 5:16 pm
Is it possible to add additional condition based on a size of files? So we can automatically download small files with Firefox and use download managers (with help of FlashGot) for big files.

Post #1
Mar 20 2010, 7:36 pm

ASF don't have access to the file size (at least with single click).
I don't know with right-click, maybe it could be done if Firefox already have the data before ASF is activated.

The file size is read by the download manager, after accepting the download.

I could check, but I don't think it can be done. Sorry.
Post #2
Mar 21 2010, 6:41 pm
> The file size is read by the download manager, after accepting the download.

I have noticed that Firefox starts to load a file immediatelly after link click. The file is downloading in background while I see Firefox window which asks me what to do with file. It seems Firefox just move temporal file to new location and continue to download. If you will wait and then click OK button you will see that some part of a file is already downloaded.
So I think addons can somehow access not only a file size but also http headers of the file (at least theoretically). But I am unsure.
Post #3
Mar 21 2010, 8:02 pm
I checked the file responsible for the download (which I think is nsHelperAppDlg.js), I didn't find any mention of the filesize.

The problem with ASF is that I can't (and don't know how to ?) read data from a download event, click event, or object information when clicking on a link or an image.

I Need to read that informations either from an already opened window or from a Firefox download script.

For the first one (single and automatic download) :
That's why I need the "what should Firefox do with this file" dialog. The data ASF use is provided by that window, and that window doesn't have any file size information.

For the second one (Right-click and menu download) :
I found the script responsible for right-click, I can replace it with mine at Firefox launch because the script is part of firefox main function, so I can replace it permanently.

I would like to do the same with single click, but the function is not permanent, so I can't replace it in memory.
It's called whenever the user start a download, it decides if the "what should" should appear or not.
I would need to replace it physically inside the Firefox installation folder (which is not accessible from add-ons installation), or find what is calling this file and function when the user click on a link.

The background starting download process is certainly the one calling this function, but I don't know which one it is.
Post #4
Aug 21 2011, 2:50 pm
Hello again

Recently I found an interesting extension - Show File Size2 ( It is very small and do what we need. Just look at ...xpi/chrome/content/dialog.js
It seems solution is simple ;-)
Post #5
Aug 22 2011, 2:53 pm
Thanks, I'll take a look.

I'm not working a lot on ASF at the moment though. Do not expect a new version soon.
I don't know where to start to update it to SQL database :o
Once in SQL I can add many more options per filters, maybe even the file size ;) (it will be easier to manager than the default about:config format).

I will have to re-code a lot of things I think.

I'm currently adding tri-states checkboxes.
I made it work, but I have difficulty with styling it as it's Operating System's Theme Dependant :/
I don't know how to specify an OS color info in CSS. Mozilla sources don't even style it manually, it's just set as "checkbox" and all seems to work automatically.
Post #6
Sep 9 2011, 9:04 am
I checked this add-on and it's easy to implement for the single click, thanks for the link :D

I'll ask the author if I can use his sources directly in ASF.

Though, the size is provided by Firefox download dialog, I don't know how to access it without the download dialog (eg. right-click, save-as..., etc.).

Either I'll make it partially implemented (but users will complaint that it doesn't work), either I'll not implement it at all :(

I have another feature (renaming the suggested file name using masks) I want to add but it only works with right-click, and not with the single-click.
Post #7
Edit / Delete
Pages : [1] Add a reply

Return to top