Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Support for native webview clipboard methods without security prompt #12007

Open
WolfBearGames opened this issue Dec 19, 2024 · 0 comments

Comments

@WolfBearGames
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant