Closed Bug 1975933 Opened 1 year ago Closed 11 months ago

Input with type `file` should prompt the user if they want to pick files from disk or open the camera

Categories

(Firefox for Android :: Media, defect)

defect

Tracking

()

VERIFIED FIXED
146 Branch
Webcompat Priority P1
Webcompat Score 8
Tracking Status
relnote-firefox --- 146+
firefox146 --- fixed

People

(Reporter: canalun, Assigned: saschanaz)

References

(Regressed 1 open bug, )

Details

(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [fxdroid][group4][webcompat:japan])

User Story

platform:android
impact:workflow-broken
configuration:general
affects:all
branch:release
diagnosis-team:japan
user-impact-score:800

Attachments

(4 files)

Environment (copy of "About Firefox")
140.0 (Build #2016097287), null
GV: 140.0-20250616215311
AS: 140.0
OS: Android 15

Step To Reproduce:

  • Access to https://pasha.rakuten.co.jp/receipt/campaign
  • Scroll down and click the button for preparing receipt photos
  • Log in to rakuten account
    • Click the same button again if redirected to the original page
  • Close the dialog about how to take a photo
  • Approve the browser to use camera

Actual Result:

  • Navigated to Android File Browsing.

Expected Result: (on Chrome)

  • The "Choose an action" menu is displayed.
  • You can choose to take a photo and camera launches.
Severity: -- → S2
User Story: (updated)
Webcompat Priority: --- → P1
Webcompat Score: --- → 8
Priority: -- → P1

(edit)
I used a VPN set to Japan and could reproduce the bug. I don't know yet why the behavior is different between Chrome and Fenix though.

Flags: needinfo?(i.am.kanaru.sato)

I can reproduce the same bug with the example at the bottom of this page:
https://imagekit.io/blog/how-to-upload-files-in-html/.

STR:

Expected result:

  • A prompt asking if user wants to get the picture from the camera or from disk (it's what Chrome does).

Actual result:

  • The file explorer is directly opened and user can select an existing file. The user has to take the picture before so that they can select in on disk when they click on the "Choose file" button.

I'm moving this to Fenix/Media as I think it belongs there.

Severity: S2 → S3
Component: Site Reports → Media
Priority: P1 → --
Product: Web Compatibility → Firefox for Android
Summary: pasha.rakuten.co.jp - camera does not launch on Firefox → Input with type `file` should prompt the user if they want to pick files from disk or open the camera

Note this is a fairly high-priority WebCompat bug affecting Japan (but also lots of other sites)

Do you think I should make it an S2 bug then?

Flags: needinfo?(rjesup)

The severity field for this bug is set to S3. However, this bug has a P1 WebCompat priority.
:titouan, could you consider increasing the severity of this web compatibility bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)
Flags: needinfo?(tthibaud)
Whiteboard: [fxdroid][group4]
Severity: S3 → S2
Flags: needinfo?(rjesup)

(replying to :titouan)
Sorry for late response. Thank you for triaging it :)

Flags: needinfo?(i.am.kanaru.sato)

Marking as confirmed based on comment 3.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Looks like only <input type=file multiple> is affected, <input type=file> without multiple properly gives the camera action.

Let's see comment #10 works...

Assignee: nobody → krosylight
Whiteboard: [fxdroid][group4] → [fxdroid][group4][webcompat:japan]
Attachment #9515428 - Attachment description: Bug 1975933 - Show all pickers for granted permissions and always ask for AV capture r=#android-reviewers → Bug 1975933 - Ask and show camera/microphone picker when accept attribute is empty r=#android-reviewers
See Also: → 1992270

Confirmed (it works)

Flags: needinfo?(krosylight)
Pushed by krosylight@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/dcf798ed06da https://hg.mozilla.org/integration/autoland/rev/983d43e4a9be Ask and show camera/microphone picker when accept attribute is empty r=android-reviewers,nalexander
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ab5bf2401717 https://hg.mozilla.org/integration/autoland/rev/0a5f04b5fb98 Revert "Bug 1975933 - Ask and show camera/microphone picker when accept attribute is empty r=android-reviewers,nalexander" for causing failures at handleFilePickerRequest.
Flags: needinfo?(krosylight)
Pushed by krosylight@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a8a62bb8a67d https://hg.mozilla.org/integration/autoland/rev/767db77466c6 Ask and show camera/microphone picker when accept attribute is empty r=android-reviewers,nalexander
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch

:saschanaz did you want to mention this in the 146 mobile release notes? Please nominate if so.

Flags: needinfo?(krosylight)

Release Note Request (optional, but appreciated)
[Why is this notable]: Changes file picking behavior on Android
[Affects Firefox for Android]: Only Android
[Suggested wording]: <input type=file> without a valid accept attribute will now show users extra options to pick camera or microphone pickers alongside of the general file picker.
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
Flags: needinfo?(krosylight)

Added to the 146 Nightly release notes for mobile with slightly adjusted wording
https://www.firefox.com/en-US/firefox/146.0a1/releasenotes/

Verified that the original site is fixed as shown in attachment 9522850 [details].

(It was a bit weird that you have to give Firefox access to the microphone up-front, however, as opposed to when you choose the video option but maybe that's just an Android thing.)

Status: RESOLVED → VERIFIED

(In reply to Brian Birtles (:birtles) from comment #25)

(It was a bit weird that you have to give Firefox access to the microphone up-front, however, as opposed to when you choose the video option but maybe that's just an Android thing.)

That doesn't sound like something I would expect. Would you mind opening a separate but for that microphone permission behavior, explaining how to reproduce it, and maybe attaching a video?

Flags: needinfo?(brian)
Attached video Screencast

This is what I mean by the microphone prompt. If Firefox doesn't already have the required permissions then these prompts will show up. Still worth filing a bug?

Flags: needinfo?(brian) → needinfo?(tthibaud)

Sorry for the delay.
Yes, I still think it's worth filing a bug at least to investigate, because I don't really see why we would need the mic permission to get pictures from the user's file manager.

Flags: needinfo?(tthibaud)

(In reply to Titouan Thibaud [:titouan] from comment #28)

Sorry for the delay.
Yes, I still think it's worth filing a bug at least to investigate, because I don't really see why we would need the mic permission to get pictures from the user's file manager.

I think we're showing a prompt which lets a user choose a picture/video from the gallery or to take a photo or video. Presumably the microphone permission is required in case the user chooses to take a video.

(In reply to Brian Birtles (:birtles) from comment #29)

I think we're showing a prompt which lets a user choose a picture/video from the gallery or to take a photo or video. Presumably the microphone permission is required in case the user chooses to take a video.

Sorry for the delay, yes the prompt is to show the button. Without the permission the button cannot be shown. (which is kinda confusing UX, but that's how it works...)

(To be clear the permission is for audio capture - so that the user can record something and attach it, than video)

Regressions: 2002689

(In reply to Brian Birtles (:birtles) from comment #25)

(It was a bit weird that you have to give Firefox access to the microphone up-front, however, as opposed to when you choose the video option but maybe that's just an Android thing.)

For this^ permission at least (the microphone): I get the same experience in Chrome. (The first time you tap the button in this bug's testcases, the browser prompts you for mic permission, regardless of whether the browser is Chrome or Firefox, if you haven't previously granted it permission.) I confirmed this in Chrome after resetting its permissions to get it to a clean-slate permissions setup, by toggling the permission to "allow" and then "deny" in the Android app-permissions UI.

However: for me at least, there's then a second permission prompt that I only get in Firefox, and my choice in that permissions-prompt seems to be irrelevant to the resulting experience, so I filed bug 2002689 on that.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: