[Ext] Preserve Download Modification Timestamp 2013.05.11.19

Announce and Discuss the Latest Theme and Extension Releases.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by Bluefang »

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...
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by Bluefang »

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: 109
Joined: January 20th, 2009, 11:46 pm
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by squashr1979 »

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.
User avatar
Grg68
Posts: 41
Joined: January 21st, 2011, 12:36 pm
Location: Greece, island of Crete, Chania

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by Grg68 »

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
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by Bluefang »

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: 35
Joined: August 20th, 2004, 5:15 pm
Location: California
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2010.09.1

Post by DERoss »

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.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.0

Post by Bluefang »

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...
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by Bluefang »

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/
Contact:

BMO bug 595785 is finally fixed

Post by Brolin Empey »

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.
User avatar
kliu0x52
Posts: 569
Joined: October 18th, 2006, 2:23 pm
Location: .us
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by kliu0x52 »

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: 35
Joined: August 20th, 2004, 5:15 pm
Location: California
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by DERoss »

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.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by Bluefang »

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: 133
Joined: October 4th, 2010, 6:04 pm

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by zzzzzzzzzz »

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/
Contact:

Works for me.

Post by Brolin Empey »

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] ~/
$
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: [Ext] Preserve Download Modification Timestamp 2011.03.2

Post by Bluefang »

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...
Post Reply