Closed Bug 573982 Opened 10 years ago Closed 9 years ago

make 'open' the default action for click on links/documents

Categories

(Firefox for Android Graveyard :: General, defect)

All
Linux
defect
Not set

Tracking

(fennec2.0b1+)

VERIFIED FIXED
Tracking Status
fennec 2.0b1+ ---

People

(Reporter: wolfiR, Assigned: wesj)

References

Details

Attachments

(1 file, 2 obsolete files)

I'm proposing to make 'open' the default action for clicking on links to files/documents which can be opened by an installed application (pdf, mp3, etc) instead of showing the prompt what to do each time.
This might be controlled through a pref.

To still be able to just save files/link targets, an entry to the context menu should be added.
This makes sense, I think.  It de-emphasizes "saving" and file systems, which makes sense on mobile devices.
Setting flags and assignee
Assignee: nobody → wjohnston
tracking-fennec: --- → 2.0b1+
Attached patch Open by default (obsolete) — Splinter Review
This implements most of what is possible from the flow chart. We actually default to "save", but will open the file (using file.launch()) automatically if

1.) The download happens with a second (controlled with a pref)
2.) The download complete notification is clicked.

We can't detect if an app can handle a url or not (can we?), so that's left to a follow up.
Attachment #470588 - Flags: review?(mark.finkle)
I think we can simplify the design a bit. Let's try to remove the dialog completely.

1. A user taps a link to a file
  a. If we think we can open the file because a handler exists, we open the file and display a notification so the user knows we are doing something.
  b. If we can't open the file, we just save it and the normal file download notifications kick in
2. A user can force a download using the context menu "Save Link As" and the normal download notifications kick in

Let's not use any preferences and the download.js shouldn't need any modifications. I think.
Attached patch Simplify (obsolete) — Splinter Review
New simpler spec.
Attachment #470588 - Attachment is obsolete: true
Attachment #470851 - Flags: review?(mark.finkle)
Attachment #470588 - Flags: review?(mark.finkle)
Attachment #470851 - Flags: review?(mark.finkle)
Sorry 'bout that. I keep trying to kill off whitespace.
Attachment #470851 - Attachment is obsolete: true
Attachment #470853 - Flags: review?(mark.finkle)
Comment on attachment 470853 [details] [diff] [review]
Fix with whitespace

> -    // Check to see if we can open this file or not
>     if (aLauncher.MIMEInfo.hasDefaultHandler) {

Let's keep that comment, or one like it.

r+, I can add the comment on checkin. Nice patch. Removes more code than it adds!
Attachment #470853 - Flags: review?(mark.finkle) → review+
pushed:
http://hg.mozilla.org/mobile-browser/rev/52227dfa5084
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
verified FIXED on builds:
Mozilla/5.0 (X11; U; Linux armv71; Nokia N900; en-US; rv:2.0b6pre) Gecko/20100907 Namoroka/4.0b6pre Fennec/2.0b1pre

and

Mozilla/5.0 (Android; Linux armv71; Nokia N900; en-US; rv:2.0b6pre) Gecko/20100907 Namoroka/4.0b6pre Fennec/2.0b1pre
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Flags: in-litmus?
Assignee: wjohnston → nhirata.bugzilla
Assignee: nhirata.bugzilla → wjohnston
Flags: in-litmus? → in-litmus?(nhirata.bugzilla)
litmus test cases : 12936, 12938 created
Flags: in-litmus?(nhirata.bugzilla) → in-litmus+
Depends on: 690252
You need to log in before you can comment on or make changes to this bug.