Image copy/cut/paste support |
|||||||
Issue descriptionThe LG email app uses WebView compose primarily to support injected images inline with the text. This mostly works, but one problem is that copy/paste don't understand images. This has led LG to reinvent copy/paste using a complicated JS/Java/IME shim which also tends to cause bugs. This bug is to track adding image copy/paste to WebView.
,
Sep 7 2016
Hmm, the mention of "LG proprietary ClipTray" makes me wonder if this it's possible for us to support this with official public APIs? We would not consider doing this if it requires private APIs.
,
Sep 7 2016
,
Sep 7 2016
I have the same problem with drag and drop images and other files: we need support from Android platform. https://developer.android.com/reference/android/content/ClipData.Item.html Copy and paste operations use ClipData.Item and it does not support files. The closest thing is a URI, which means the WebView app has to temporarily put the file into a content provider (but WebView does not have one, because a content provider has to declared in the application's manifest), in order for another app to paste. And even then, the app that's pasted into has to understand how to read from the URI.
,
Sep 7 2016
Images can be represented as base64-encoded data:// URLs. This can cause perf problems because a lot of systems don't expect to encounter megabyte-sized URLs, but it's a common workaround in this type of situation.
,
Sep 7 2016
That might work for small images, assuming the destination app knows to decode the data:// back to an image. But ClipData has an upper limit of 1Mb (I think), which is binder's limit in Android.
,
Sep 7 2016
In fact, if I try to copy a very large piece of text (like the buildbot output page), then I would get "failed to copy to clipboard" in the toast, and "FAILED BINDER TRANSACTION" in the logcat.
,
Oct 28 2016
Is the plan to make it possible for LG to use the HTML5 APIs for this eventually?
,
Oct 28 2016
,
Oct 28 2016
My plan is that LG would eventually not need to write any code or use any API at all to support this. When selecting a contenteditable containing an image, Chromium's native selection ought to just paste the image into the Android clipboard properly. What LG Email app has today is a giant blob of JS and Java workarounds to implement this missing feature themselves.
,
Oct 28 2016
,
Jun 8 2017
aelias@ - Android Clipboard currently, don't have direct support of hosting an image. We can write the image in file system and share the content URL to the target app for reading it. Problem is most of the app, is directly expecting text or html format, but not image format from clipboard. Just thought to share this info in this context.
,
Aug 3 2017
,
Oct 26 2017
Hmm, cost/benefit doesn't seem to be there for this feature as it's not that clean and the workarounds do work (and it's probably hard to totally break compatibility with these already shipped workarounds in any case so the benefit of the replacement is mild). |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by aelias@chromium.org
, Sep 7 2016