tauri
tauri copied to clipboard
clipboard cant read image and file-url
Is your feature request related to a problem? Please describe. clipboard only read text. cant read image and file-url
Describe the solution you'd like add features to read image and file-url
Describe alternatives you've considered
/upstream tauri-apps/tao
I have created an upstream issue at https://github.com/tauri-apps/tao/issues/232, I will notify you once it is resolved.
Any progress on this, or potential workarounds that anyone suggests?
It seems that due to Linux's special handling of clipboards, using the JavaScript API for document.onpaste
does not work as images don't come through correctly.
I have attempted to implement arboard
to no success due to my beginner-level skills in Rust, specifically due to not knowing how to properly capture a paste event. Suggestions online immediate suggest things that would cause concern for memory leaks.
Any direction would be incredibly helpful, thank you!
If it helps in the meantime, I created https://crates.io/crates/clipboard_files
It reads file urls from the clipboard, and it does so well on Mac, Windows and Linux. However, it doesn't write file urls, and it neither reads nor writes image data. It would be great to have that, and I'd probably have use for it at some point too..
I made a tauri plugin that support both text and image. You could simply import the API methods in JavaScript or TypeScript.
- https://github.com/CrossCopy/tauri-plugin-clipboard
- Crate: https://crates.io/crates/tauri-plugin-clipboard
- NPM Package: https://www.npmjs.com/package/tauri-plugin-clipboard-api?activeTab=readme
A demo app also included in the repo.
Sounds like a huge work, there are many things to do.
https://github.com/CrossCopy/tauri-plugin-clipboard now supports text, image, file, html, RTF and watching.
Closing as the official clipboard plugin for v2 now supports reading image, for any missing features please open an issue in https://github.com/tauri-apps/plugins-workspace/issues