-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Feature Request
Modify the onShowFileChooser method within the SystemWebChromeClient class to implement corresponding folder selection or save functionality when the fileChooserParams parameter is set to MODE_OPEN_FOLDER or MODE_SAVE.
Motivation Behind Feature
In WebView versions 132 and above, resolve the errors where JavaScript's showDirectoryPicker and showSaveFilePicker methods result in "The user aborted a request" responses.
Feature Description
In WebView versions 132 and above, support has been introduced for the following new methods:
- showDirectoryPicker
- showSaveFilePicker
- showOpenFilePicker
I have observed thatshowOpenFilePickerworks correctly, butshowDirectoryPickerandshowSaveFilePickerreturn errors indicating "The user aborted a request".
Upon examining the source code, I found that theonShowFileChoosermethod within theSystemWebChromeClientclass can support these functionalities based on thefileChooserParamsparameter. However, Cordova currently lacks support for these features.
Are there any drawbacks? Will this break anything for existing users?
It is important to consider potential compatibility issues with existing applications. The implementation should be carefully tested to ensure it does not introduce regressions.
Alternatives or Workarounds
Proposed Solution:
Modify the onShowFileChooser method within the SystemWebChromeClient class so that it implements the appropriate folder selection or save operations when the fileChooserParams parameter indicates MODE_OPEN_FOLDER or MODE_SAVE.
However, I have not attempted this solution myself due to my limited expertise in this area.