Closed Bug 442560 Opened 16 years ago Closed 16 years ago

Download manager Clear List doesn't work if xul is shown in tab/sidebar

Categories

(Toolkit :: Downloads API, defect)

1.9.0 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: stevee, Unassigned)

References

()

Details

(Keywords: regression)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1pre) Gecko/2008062812 GranParadiso/3.0.1pre ID:2008062812

1. New profile, start Firefox
2. In address bar, load chrome://mozapps/content/downloads/downloads.xul
3. Download a file, eg: New tab, www.mozilla.org, right click on an image, Save As
4. Switch to the downloads.xul tab
5. Click 'Clear List' button

Expected:
- Downloads list is cleared, even tho we have the Download Manager UI loaded in a tab

Actual:
- Nothing happens. But if you close the downloads.xul tab and then reload chrome://mozapps/content/downloads/downloads.xul the list is empty.

Nothing is shown in the error console.

Loading downloads.xul in a tab in Firefox 2 works as expected, all buttons, etc, are clickable.

[I am attempting to rewrite the Download Manager Tweak extension for Firefox 3 and one of its options is to load the Download Manager in a tab or the sidebar.. but when I do this and click the Clear List button nothing happens. Also, if I call cancelDownload() on an active download, and then retryDownload(), the UI gets a duplicate download item that is in a strange state and behaves oddly. Is there some window-only code that's barfing when I load the DLM UI into a tab or sidebar and then try and do something that should effect the UI? ]
There's nothing that I see by looking it over.  I'm assuming there are no errors or anything in the console, right?
When I first load chrome://mozapps/content/downloads/downloads.xul in a tab, I get:
  Error: window.arguments is undefined
  Source file: chrome://mozapps/content/downloads/downloads.js
  Line: 411

When I close the tab that contains downloads.xul, I get:
  Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]
  Source file: chrome://mozapps/content/downloads/downloads.js
  Line: 443
Ah.  I didn't look in the Startup method.

So, we have to check why we are opening the download manager so we can properly handle the auto remove and close preferences.  So, this bug is WONTFIX.

For you to do what you want, you'll probably just want to copy downloads.js and downloads.xul, and implement your own version of nsIDownloadManagerUI which will open it in a new tab (it will also always open how you want it to then, since all calling code to open the DM goes through that call path).
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
Product: Firefox → Toolkit
(In reply to comment #0)
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1pre) Gecko/2008062812
> GranParadiso/3.0.1pre ID:2008062812
> 
> 1. New profile, start Firefox
> 2. In address bar, load chrome://mozapps/content/downloads/downloads.xul
> 3. Download a file, eg: New tab, www.mozilla.org, right click on an image, Save
> As
> 4. Switch to the downloads.xul tab
> 5. Click 'Clear List' button
> 
> Expected:
> - Downloads list is cleared, even tho we have the Download Manager UI loaded in
> a tab
> 
> Actual:
> - Nothing happens. But if you close the downloads.xul tab and then reload
> chrome://mozapps/content/downloads/downloads.xul the list is empty.
> 
> Nothing is shown in the error console.
> 
> Loading downloads.xul in a tab in Firefox 2 works as expected, all buttons,
> etc, are clickable.
> 
> [I am attempting to rewrite the Download Manager Tweak extension for Firefox 3
> and one of its options is to load the Download Manager in a tab or the
> sidebar.. but when I do this and click the Clear List button nothing happens.
> Also, if I call cancelDownload() on an active download, and then
> retryDownload(), the UI gets a duplicate download item that is in a strange
> state and behaves oddly. Is there some window-only code that's barfing when I
> load the DLM UI into a tab or sidebar and then try and do something that should
> effect the UI? ]
> 

I have a similar behaviour in a different situation:
1) Version: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
2) Download Statusbar installed (configured to bring up Downloads dialog when exiting Firefox while a download is still in progress)
3) Download in progress
4) Exit firefox (Donwloads dialog appears with download uninterrupted)
5) Clicking 'Clear List' has no apparent effect: does not gray out after first-click, but finished downloads are still listed (I have no cancelled downloads)
6) When restarting Firefox and checking the downloads list, it only has the last downloaded file, as it should.

I guess the issue is a refreshing of the display, because the "hidden" work is done (actually clearing the list).

I don't know if it is related, but I saw that the result is the same as reported here, and was concerned submitting a new bug report would be a dupe :-P
You need to log in before you can comment on or make changes to this bug.