Closed Bug 1887878 Opened 1 year ago Closed 5 months ago

Add support for webkitdirectory with <input type="file" />.

Categories

(Firefox for Android :: Browser Engine, enhancement)

Firefox 123
All
Android
enhancement

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: danielhunterjacobs, Assigned: m_kato)

References

Details

(Keywords: dev-doc-complete, webcompat:platform-bug, Whiteboard: [fxdroid][group1])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Android 14; Mobile; rv:123.0) Gecko/123.0 Firefox/123.0

Steps to reproduce:

Go to https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory#result on Firefox on Android and try to select a directory.

Actual results:

I could only select individual files.

Expected results:

I should have been able to upload the full content of a directory.

This was once https://bugzilla.mozilla.org/show_bug.cgi?id=1426349, but that bug was sent to the Firefox for Android graveyard. https://bugzilla.mozilla.org/show_bug.cgi?id=1426349#c10 said to submit this issue to https://github.com/mozilla-mobile/fenix/, but that's a public archive replaced by https://github.com/mozilla-mobile/firefox-android, and https://github.com/mozilla-mobile/firefox-android/issues/5900 says "All the issues related to Fenix, Focus, Android Components, as well as GeckoView, will remain on Bugzilla."

The severity field is not set for this bug.
:bclark, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(brclark)

The Bugbug bot thinks this bug should belong to the 'Fenix::Browser Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Browser Engine
Severity: -- → N/A
Type: defect → enhancement
Summary: <input type="file" webkitdirectory> doesn't work. → Add suport for webkitdirectory with <input type="file" />.
Depends on: 1674428

This is now basically a parity:safari and parity:chrome issue, as https://issues.chromium.org/issues/40248532 has been marked fixed (fixed by code changes in https://issues.chromium.org/issues/40101963), as has https://bugs.webkit.org/show_bug.cgi?id=271705 (fixed by https://github.com/WebKit/WebKit/pull/34675).

Of note is that <input type="file" webkitdirectory> crashes Chrome unconditionally when selecting a folder, but that is being fixed by https://chromium-review.googlesource.com/c/chromium/src/+/5982392.

Summary: Add suport for webkitdirectory with <input type="file" />. → Add support for webkitdirectory with <input type="file" />.
Assignee: nobody → m_kato
Blocks: 1909892
Whiteboard: [fxdroid][group1]

I have implemented folder picker API by bug 1674428. This is
implementation for android components.

The folder picker API is two prompts.

The one is conform prompt. The title and body text is from old Fennec's
resources.

The other is folder picker prompt. This shows document tree intent
(ACTION_OPEN_DOCUMENT_TREE).

Attachment #9479026 - Attachment description: Bug 1887878 - Part 1. Turn on webkitdir on Android. r=#dom-core!,#geckoview-reviewers! → Bug 1887878 - Part 1. Turn on webkitdirectory on Android. r=#dom-core!,#geckoview-reviewers!
Keywords: dev-doc-needed

Hey :owlish,

It looks like this bug is a geckoview bug - perhaps something for gecko-reviewers?

Flags: needinfo?(bugzeeeeee)

Hi Segun, the patch in question is not GV part of it, it is the front end.

Flags: needinfo?(bugzeeeeee)

m_kato - can you contact the Content Design Team for review of the string in the patch, per flod's comment on the patch? Thanks!! Looking forward to this landing and knocking out the highest current siteline webcompat bug!

Flags: needinfo?(m_kato)

(In reply to Randell Jesup [:jesup] (needinfo me) from comment #10)

m_kato - can you contact the Content Design Team for review of the string in the patch, per flod's comment on the patch? Thanks!! Looking forward to this landing and knocking out the highest current siteline webcompat bug!

Yes, filed for them

Flags: needinfo?(m_kato)
Flags: needinfo?(brclark)
Flags: needinfo?(jmuizelaar)

We are turning on webkitEntries prefs, so we should pass the
webkitEntries tests.

Out of curiosity, what is this waiting on? The nit in https://phabricator.services.mozilla.com/D245522#inline-1377545?

Flags: needinfo?(m_kato)

(In reply to Randell Jesup [:jesup] (needinfo me) from comment #14)

See comment 13

Content team have sent a feedback for this at last weekend. So I have to update this fix.

Flags: needinfo?(m_kato)

The requested changes to strings have been made and reviewed but we need to wait for the code freeze to finish before landing.

We've already waited for 2 months for this. I've queued it for landing we can always back it out before the soft freeze ends if we still think it's too risky to let ride.

Flags: needinfo?(jmuizelaar)
Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Depends on: 1973250

MDN docs work for this can be tracked in https://github.com/mdn/content/issues/40024

After testing this on Android Firefox with https://codepen.io/danieljacobs/pen/VwodKYg, it looks like this did not include functionality for webkitRelativePath for files chosen for a directory, as all files selected from a folder have a webkitRelativePath of the empty string. This works on every desktop browser and Chrome on Android.

Note that for implementation of webkitRelativePath, you may need to do as was done in https://issues.chromium.org/issues/377716464 and pipe the path to the file name through the file enumeration code, as Android uses Content-URIs for paths by default.

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

Attachment

General

Created:
Updated:
Size: