MozillaZine

[Ext] Preserve Download Modification Timestamp 2013.05.11.19

Announce and Discuss the Latest Theme and Extension Releases.
Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted September 13th, 2010, 1:24 am

I understand that. But seeing as I only register 1 listener with the download manager service, and I never touch any of the UI code, I have no idea what I could be doing to cause this. And I really don't feel like tearing apart someone else's extension to see why it is failing.

As to why the exception is uncaught, it's because DMT is calling it outside of a try/catch block.
chrome://downloadmgr/content/downloadmgrOverlay.js
chrome://mozapps/content/downloads/downloads.js
Notice that dmtStartup calls Startup inside a try/catch block, but dmtShutdown calls Shutdown outside of one.

Also, I just tried Firefox 3.6.10pre (x86_64 Linux) on a shiny new profile with DMT 0.9.2 (checked "Close it when all downloads are finished") and PDMTS 2010.09.12.18. I saw no error.

I also filed Bug 595785 - Getting a download's nsIChannel appears unreliable.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted September 13th, 2010, 7:53 pm

Status update: added Bug 595785 to the list of known issues, and ways to work around it.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

squashr1979
 
Posts: 104
Joined: January 20th, 2009, 11:46 pm

Post Posted September 14th, 2010, 1:49 pm

It turns out I made bug 2 happen even without PDMTS installed. The key is the step to check "options->downloads->File/Window->Close it when all downloads are finished". If you then download a small file then window shutdown can come before the window startup completes (in some cases the startup isn't even called). The removeObserver call fails because the observer was never added. This turns out to not be a critical error, but it is fixed for the next release of DMT.
squashr1979, the developer of Download Manager Tweak for Firefox versions 3.0 and newer.

Grg68

User avatar
 
Posts: 30
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Post Posted January 21st, 2011, 7:09 pm

Hi Bluefang and everybody else,

My name is George.
I found your extension recently and i have to say that you gave me a partial, but good solution for this common
problem that all browsers have. Thank you for your good work. Partial solution, i mean that usually i manage my
downloads using a download manager which also does not preserves the timestamp, but now with PDMTS, if the
timestamp is important to me for some reason, i will use firefox's download manager.
I already have translated PDMTS in my native language (Greek) and following your instructions, i use it with
no issues. How can i submit to you the translation?

Thank you
Grg

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted January 21st, 2011, 9:14 pm

There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

DERoss
 
Posts: 25
Joined: August 20th, 2004, 5:15 pm
Location: California

Post Posted February 12th, 2011, 11:46 am

Is it still necessary to set browser.download.manager.scanWhenDone to "false"? This setting also appears to suppress anti-virus scanning of the newly downloaded file.

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted March 6th, 2011, 10:17 pm

Version 2011.03.07.00
* Added locales de, el, pt-BR, sr, sv-SE


https://addons.mozilla.org/firefox/addo ... /versions/

Nothing special. Just translations.

DERoss wrote:Is it still necessary to set browser.download.manager.scanWhenDone to "false"? This setting also appears to suppress anti-virus scanning of the newly downloaded file.

No. That was fixed in Version 2010.09.08.18.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted March 21st, 2011, 8:06 pm

Version 2011.03.21.22
* Added locales fr, zh-CN


https://addons.mozilla.org/firefox/addo ... /versions/
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Brolin Empey
 
Posts: 18
Joined: December 11th, 2005, 9:52 pm
Location: /home/brolin/

Post Posted March 27th, 2011, 10:41 pm

Bug 595785 – Getting a download's nsIChannel appears unreliable is finally fixed: the patch is included in Firefox v4.2a1pre, but reportedly not v4.0 final. I am currently using firefox-4.2a1pre.en-US.win32.zip from 2011-03-26 from http://ftp.mozilla.org/pub/mozilla.org/ ... a-central/ .

Bluefang: Please update the part of your original post containing the workarounds for bug 595785.

The next step is to get PDMTS included in the Firefox 4 base. The statistics for PDMTS on AMO today report the Average Daily Downloads count is 25, which is more than once per hour. This may seem insignificantly little compared to more popular extensions, but we can help promote PDMTS to increase its popularity and consequently improve our case for including PDMTS in the Firefox 4 base.

According to my archived comments on Bug 178506 – save original last-modified date on file downloads, I have been involved in fixing bug 178506 since 2008, even though I discovered this bug years earlier.

Many of the persons I have told about this bug do not understand why I care so much about it. If you find yourself in this situation, ask the apathetic persons why you can run (a Java port of) Quake II in Firefox 4 without requiring any extensions or plug-ins when an extension is still required simply to preserve the Last-Modified time of downloaded files. If they are still apathetic, ask them how to compare multiple copies of a file without comparing their contents when their Web browser changes the file’s Last-Modified time to the current time every time the file is downloaded.

I know I am probably preaching to the choir here, but my point is that, in approximately 3 years, I have actually acted to fix a bug which has frustrated me usually multiple times per week since before 2008 because I pay close attention to details such as file timestamps. I do not mean to brag since I know I did not actually fix the bug myself: I hired Michal Sciubidlo, Andrey Ivanov, and Grigory Mozhaev via oDesk.com to fix the bug. However, considering the bug was first publicly reported (at least to BMO) in 2002 and has existed since 1994, I doubt it would have been fixed by now if I had not acted to fix it instead of discussing it, watching it, and hoping someone else will fix it.

In total, I have paid 3 contractors 986.54 USD for 52 hours of work as of today. If you want to thank me without spending any money, please spread the word about PDMTS: encourage your contacts to install it so we can prove it should be included in the Firefox 4 base.

kliu0x52

User avatar
 
Posts: 569
Joined: October 18th, 2006, 2:23 pm
Location: .us

Post Posted March 30th, 2011, 4:34 pm

Great extension, Bluefang! This is one of those features that I've always wanted, and it was on my extension to-do list. I looked around AMO to see if someone had already made an extension, and that's when I found yours. So thanks; this saves me a lot of trouble! ;)

Anyway, about the channel bug that's been discussed in this thread: I see that the bug had landed for the next version of Firefox, but that unfortunately doesn't help users who are not on nightlies. However, you can easily work around this by observing "http-on-examine-response". That always fires reliably, and you can use that to get the timestamp for requests made through HTTP. Obviously, it won't help with the other protocols, but HTTP accounts for the vast majority of cases anyway. I have a tiny barebones extension that uses http-on-examine-response, if you need a sample.

Edit: I just found and read bug #178506. Wow, what a long and sordid history! It's sad that it was killed by whiners who liked the wrong behavior. But one has to admit, shoving it in their face so abruptly was not the best tactic.
My addons: NoRedirect | QuickDrag | URL Flipper | TabSubmit
Developers: Make sure to test your addons for RTL compatibility!

DERoss
 
Posts: 25
Joined: August 20th, 2004, 5:15 pm
Location: California

Post Posted June 19th, 2011, 1:50 pm

I really like this extension. However, the Add-ons Manager indicates Preserve Download Modification Timestamp 2011.03.21.22 is not compatible with SeaMonkey 2.1.

Actually, this version works quite well with SeaMonkey 2.1. But first, I had to modify maxVersion in file install.rdf. I suggest a new version of Preserve Download Modification Timestamp is needed where that tweak is not necessary.

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted June 19th, 2011, 3:27 pm

It should have been compatible with 2.1.*, but I bumped the max versions to support the latest Firefox and SeaMonkey nightly builds.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

zzzzzzzzzz
 
Posts: 126
Joined: October 4th, 2010, 6:04 pm

Post Posted August 24th, 2011, 2:30 pm

Bluefang,

The "Preserve Download Modification Timestamp 2011.03.21.22" extension does not always function as expected; file dates from the server are not always retained in the downloaded file.

I found a file that can be downloaded that consistently shows the wrong file date when downloaded with Mozilla Firefox 6.0. When the file is downloaded using MiniDM V.13.2, the downloaded file's date is correct.

I provide a procedure below to reproduce the issue:

For the procedure, the following software is used:
  • Microsoft Windows XP Professional with Service Pack 2
  • Mozilla Firefox 6.0
  • Preserve Download Modification Timestamp 2011.03.21.22 extension
  • Status-4-Evar 2011.07.20.21 extension
  • Padlock 0.5.0 extension (link to extension page)

Procedure to reproduce the problem:
  1. In the Run dialog box, type or paste "FIREFOX http://www.softmaker.net/down/ofw08charity.exe" and click the "OK" button.
  2. Click the "Save File" button to save the file.
  3. Examine file date of downloaded file after download has completed.

The total size of the "ofw08charity.exe" file should be 61,731,607 bytes; the file date of the of the "ofw08charity.exe" file should be "Wednesday, August 25, 2010, 9:05:11 AM", but may reference the creation time as the file date instead.

Brolin Empey
 
Posts: 18
Joined: December 11th, 2005, 9:52 pm
Location: /home/brolin/

Post Posted August 24th, 2011, 3:27 pm

Works for me with Mozilla Firefox v5.0 + PDMTS 2011.03.21.22 on Windows 7 Professional Service Pack 1 IA-32.

The Last-Modified HTTP response header appears correct:
Code: Select all
[brolin@brolin-V13] [0] [1] ~/
$ nc www.softmaker.net 80
HEAD /down/ofw08charity.exe HTTP/1.1
Host: www.softmaker.net

HTTP/1.1 200 OK
Date: Wed, 24 Aug 2011 22:03:27 GMT
Server: Apache/2.2.4 (Linux/SUSE)
Last-Modified: Wed, 25 Aug 2010 14:05:11 GMT
ETag: "2a38002-3adf317-5eadb3c0"
Accept-Ranges: bytes
Content-Length: 61731607
Content-Type: application/x-ms-dos-executable

[brolin@brolin-V13] [0] [2] ~/
$

Bluefang

User avatar
 
Posts: 7846
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 24th, 2011, 3:51 pm

In the PDMTS options, set the log verbosity to "3 - Debug". Open the error console (Tools -> Web Developer -> Error Console / Firefox -> Web Developer -> Error Console / CTRL+SHIFT+J), and then download the file. You should see something similar to the following messages:

PDMTS: Download status changed - 5
/tmp/ofw08charity.exe
----------
PDMTS: Network status changed - 0x50001 (ERR: 0)
http://www.softmaker.net/down/ofw08charity.exe
----------
PDMTS: File downloading via HTTP://
/tmp/ofw08charity.exe
----------
PDMTS: Download status changed - 0
/tmp/ofw08charity.exe
----------
PDMTS: Download status changed - 1
/tmp/ofw08charity.exe
----------
PDMTS: Download finished, updating timestamp
/tmp/ofw08charity.exe
----------
PDMTS: Last modified time now Wed, 25 Aug 2010 14:05:11 GMT
/tmp/ofw08charity.exe
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest