nonameShijian opened a new issue, #1776:
URL: https://github.com/apache/cordova-android/issues/1776

   # 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
   <!-- Why should this feature be implemented? What problem does it solve? -->
   
   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
   <!--
   Describe your feature request in detail
   Please provide any code examples or screenshots of what this feature would 
look like
   Are there any drawbacks? Will this break anything for existing users?
   -->
   
   In WebView versions 132 and above, support has been introduced for the 
following new methods:
   - 
[showDirectoryPicker](https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker)
   - 
[showSaveFilePicker](https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker)
   - 
[showOpenFilePicker](https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker)
   
   I have observed that `showOpenFilePicker` works correctly, but 
`showDirectoryPicker` and `showSaveFilePicker` return errors indicating "The 
user aborted a request".
   
   Upon examining the source code, I found that the `onShowFileChooser` method 
within the `SystemWebChromeClient` class can support these functionalities 
based on the `fileChooserParams` parameter. 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
   <!--
   Describe alternatives or workarounds you are currently using
   Are there ways to do this with existing functionality?
   -->
   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to