<input type=file webkitdirectory> doesn't work in Android WebView |
|||
Issue descriptionChrome Version: ToT OS: Android What happens? 'webkitdirecotry' attribute doesn't work. - if webkitdirecotry is specified, AwWebContentsDelegate::RunFileChooser() [1] is called with params.mode==FileChooserParams::Mode::kUploadFolder. - It sets mode_flags to kFileChooserModeOpenMultiple | kFileChooserModeOpenFolder, that is 3. - WebChromeClient.FileChooserParams is passed to an embedder with getMode()==3, that is MODE_SAVE, not MODE_OPEN_FOLDER(2) MODE_OPEN_FOLDER has @hide [2], and the AW implementation passes a wrong mode. How to fix it? You might think a straight-forward fix would be: - Sets mode_flags to 2, and - Expose MODE_OPEN_FOLDER. It's not enough. Javadoc for the current MODE_OPEN_FOLDER says "The implementation should enumerate all files selected by this operation." In order to support webkitdirectory attribute correctly, Blink needs a directory path which a user selected as well as enumerated files. So we need to do: - Change the callback so that it returns both of the selected directory and files, or - Change the semantics of MODE_OPEN_FOLDER so that the callback returns a single Uri representing the directory, and AW implementation enumerates descendant files. [1] https://cs.chromium.org/chromium/src/android_webview/browser/aw_web_contents_delegate.cc?type=cs&q=AwWebContentsDelegate::RunFileChooser&sq=package:chromium&g=0&l=91 [2] https://cs.chromium.org/chromium/src/third_party/android_tools/sdk/sources/android-25/android/webkit/WebChromeClient.java?type=cs&q=WebChromeClient+FileChooserParams&sq=package:chromium&g=0&l=439
,
Nov 14
,
Nov 14
We're standardizing webkitdirecotry now, and Edge, Firefox, and Safari support it. https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory This is just a missing web-platform feature which is available on everywhere except Android WebView.
,
Dec 13
|
|||
►
Sign in to add a comment |
|||
Comment 1 by paulmiller@chromium.org
, Nov 14