[feat] Support for native webview clipboard methods without security prompt
WolfBearGames opened this issue · 0 comments
Describe the problem
The webview has native clipboard methods like navigator.clipboard.read
, navigator.clipboard.write
and navigator.clipboard.readText
, navigator.clipboard.writeText
but accessing these triggers a security prompt in the webview with an ugly dialog.
Using the clipboard-manager plugin to read an UHD image from the clipboard takes several seconds, because the clipboard content is transferred as an uncompressed 100MB+ bitmap to the webview.
This the native navigator.clipboard.read
the JavaScript app can read the clipboard content as image/png and the image is available instantly.
Describe the solution you'd like
Tauri should support using these native webview clipboard methods without showing the ugly security prompt (alternatively configure permissions in tauri config instead). (like Socket Runtime does: https://github.com/socketsupply/socket)
Alternatives considered
The "clipboard-manager" plugin allows limited access to the clipboard but has currently many drawbacks:
- images are always uncompressed bitmaps and reading/writing these to the clipboard is slow and inefficient
- not all formats like html are fully supported
Additional context
The native clipboard APIs have more features and are already available in the native webviews. If technically possible Tauri should support webstandard APIs. This makes porting apps to Tauri easier and more accessible.