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)
Tracking
()
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.
Updated•1 year ago
|
Comment 1•1 year ago
•
|
||
(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.
Comment 2•1 year ago
|
||
Comment 3•1 year ago
|
||
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:
- Open the attached HTML file.
- Click on "Choose file"
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.
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Note this is a fairly high-priority WebCompat bug affecting Japan (but also lots of other sites)
Comment 6•1 year ago
|
||
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.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
| Reporter | ||
Comment 7•1 year ago
|
||
(replying to :titouan)
Sorry for late response. Thank you for triaging it :)
Updated•1 year ago
|
Comment 8•1 year ago
|
||
Marking as confirmed based on comment 3.
| Assignee | ||
Comment 9•1 year ago
•
|
||
Looks like only <input type=file multiple> is affected, <input type=file> without multiple properly gives the camera action.
| Assignee | ||
Comment 10•1 year ago
•
|
||
Actually no, this is because we only show camera when type attribute is given with media mime type, while Chrome shows camera (and sound recorder) when type is not given too.
Edit: And I think the relevant code is here: https://searchfox.org/firefox-main/rev/995b0c65366602cbb70a65131f9a848c82a8d19d/mobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/file/FilePicker.kt#151-189
where MimeType.values are: https://searchfox.org/firefox-main/rev/995b0c65366602cbb70a65131f9a848c82a8d19d/mobile/android/android-components/components/feature/prompts/src/main/java/mozilla/components/feature/prompts/file/MimeType.kt#155
Updated•1 year ago
|
| Assignee | ||
Comment 12•11 months ago
|
||
This matches Chrome behavior.
Updated•11 months ago
|
| Assignee | ||
Comment 13•11 months ago
|
||
Comment 15•11 months ago
|
||
Comment 16•11 months ago
|
||
Comment 17•11 months ago
|
||
Backed out for causing failures at handleFilePickerRequest.
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/0a5f04b5fb98de0d36671a368e58081a15fcd050
Failure log: https://treeherder.mozilla.org/logviewer?job_id=530840957&repo=autoland&task=HlDd0vpgR4eCGIgYiB3XeA.0&lineNumber=5654
| Assignee | ||
Updated•11 months ago
|
Comment 19•11 months ago
|
||
Comment 20•11 months ago
|
||
| bugherder | ||
Comment 21•11 months ago
|
||
:saschanaz did you want to mention this in the 146 mobile release notes? Please nominate if so.
| Assignee | ||
Comment 22•11 months ago
|
||
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)]:
Comment 23•11 months ago
|
||
Added to the 146 Nightly release notes for mobile with slightly adjusted wording
https://www.firefox.com/en-US/firefox/146.0a1/releasenotes/
Comment 24•10 months ago
|
||
Comment 25•10 months ago
|
||
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.)
Comment 26•10 months ago
|
||
(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?
Comment 27•10 months ago
|
||
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?
Comment 28•10 months ago
|
||
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.
Comment 29•10 months ago
|
||
(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.
| Assignee | ||
Comment 30•10 months ago
|
||
(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...)
| Assignee | ||
Comment 31•10 months ago
|
||
(To be clear the permission is for audio capture - so that the user can record something and attach it, than video)
Comment 32•9 months ago
|
||
(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.
Description
•