This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Add API for file uploads #1076
Labels
<engine-gecko>
Component: browser-engine-gecko
<engine-system>
Component: browser-engine-system (WebView)
🌟 feature
New functionality and improvements
🎭 Focus
Requirements for Focus/Klar
🚀 Rocket
Requirements for Firefox Rocket
For file uploads we get a callback from the engine to show a file chooser. This may require a system permission to read the external storage. I was wondering if we could handle this internally in the engine. However at least for the permission request and the intent result from the picker we'd need some help from the app, I guess.
For GeckoView take a look at Focus and
GeckoViewPrompt.onFilePrompt
:https://github.com/mozilla-mobile/focus-android/blob/master/app/src/main/java/org/mozilla/focus/gecko/GeckoViewPrompt.java#L716
And
GeckoViewPrompt.onFileCallbackResult()
:https://github.com/mozilla-mobile/focus-android/blob/master/app/src/main/java/org/mozilla/focus/gecko/GeckoViewPrompt.java#L770
The WebView APIs:
https://developer.android.com/reference/android/webkit/WebChromeClient#onShowFileChooser(android.webkit.WebView,%20android.webkit.ValueCallback%3Candroid.net.Uri[]%3E,%20android.webkit.WebChromeClient.FileChooserParams)
Both APIs require a callback. I'm not sure how we want to expose that. We do not really want to stuff a callback into
Session
.┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: