Closed Bug 566564 Opened 10 years ago Closed 9 years ago

"Open" should be disabled for downloaded files with unknown extension.


(Firefox for Android Graveyard :: General, defect)

Not set



Tracking Status
fennec 2.0b3+ ---


(Reporter: ahoza, Assigned: azakai)



(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (X11; U; Linux armv7l; Nokia N900; en-US; rv: Gecko/20100517 Namoroka/3.6.5pre Fennec/1.1b2pre 

"Open" does nothing when selecting it for a downloaded file with .zip or tar.bz2 extension. 

Reproducible: Always

Steps to Reproduce:
1. Download a .zip/tar.bz2 file from
2.Slide page to the left.
3. Click on the preferences (gear) icon.
4.Click on the download (downarrow) icon.
5.Click on "Open".

Actual Results:  
Nothing happens.

Expected Results:  
Either button is disabled, or a list of installed applications that could open the file /appropriate message saying that there are no applications installed that could open the file, is displayed.
Ever confirmed: true
I cano confirm this on build:

Mozilla/5.0 (X11; U; Linux armv71; Nokia N900; en-US; rv:1.9.3a5pre) Gecko/20100527 Namoroka/3.7a5pre Fennec/2.0a1pre
Must be something in the platform. We already try to disable the "Open" button is the file does not have a handler:
(In reply to comment #2)
> Must be something in the platform. We already try to disable the "Open" button
> is the file does not have a handler:

Is this still true? I'm seeing mar files on my Linux build with an open option that does nothing.
Yeah, its still true. I went to my n900 and downloaded a .dmg file and tried to open it.
tracking-fennec: --- → ? will need to be updated once this bug is resolved
Flags: in-litmus?(mozaakash)
Assignee: nobody → mark.finkle
tracking-fennec: ? → 2.0b3+
OS: All → Linux
Hardware: All → ARM
Assignee: mark.finkle → doug.turner
OS: Linux → Maemo
Assignee: doug.turner → azakai

1. We open files using nsiLocalFile.Launch. That calls OS level stuff, basically it's the same as doubleclicking the file on windows, running |gnome-open| on GNOME, etc.

2. There is no feedback from Launch() about whether it succeeded or not. Optimally we would like something like 'CanLaunch', I guess, on that interface.

3. We can try to disable the 'Open' button if the file doesn't match any familiar mimetype, but the danger is that the file might be launchable despite not having a familiar mimetype - Launch may succeed where mimetype discovery fails.


The best solution for now might be something in Maemo or Qt, for example having the OS launcher display a visual warning if a file is not openable. On a related note it seems this bug doesn't appear in Android only because when you open a file with no launcher, it tries to launch it in the native browser - so at least something happens and the user gets feedback.
Attached patch patchSplinter Review
Patch tests the mimetype, if none exists, then the |Open| button is disabled.

The risk still exists, as mentioned in the previous comment, that Launch() and the mimetype do not agree between them.
Attachment #490768 - Flags: review?(mark.finkle)
Comment on attachment 490768 [details] [diff] [review]

Nice catch. We are at least better off than before. If we run into situations where the mimeType and Launch() don't agree, we can look at implementing something additional.
Attachment #490768 - Flags: review?(mark.finkle) → review+
Closed: 9 years ago
Resolution: --- → FIXED
verified FIXED on build:

Mozilla/5.0 (Maemo; Linux armv71; rv:2.0b8pre) Gecko/20101116 Namoroka/4.0b8pre Fennec/4.0b3pre
Flags: in-litmus?(mozaakash) → in-litmus+
You need to log in before you can comment on or make changes to this bug.