mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-20 23:11:24 +02:00
feat(clipboard-manager): add support for writing secrets (#3376)
* feat(clipboard-manager): add support for writing secrets add `write_secret` command that writes a text into the clipboard and hints clipboard managers to not save the text. uses `arboard`'s `SetExtLinux`, `SetExtWindows`, and `SetExtApple` extensions for each platform. * fix(clipboard-manager): require arboard 3.6 * chore(clipboard-manager): add license header to secret.rs * fix(clipboard-manager): only exclude from monitoring on Windows * refactor(clipboard-manager): replace ExcludeSecret trait with a function * chore(clipboard-manager): drop redundant cfg(desktop) in desktop.rs * refactor(clipboard-manager): share clipboard access in a helper * feat(clipboard-manager): implement write_secret on Android and iOS * docs(clipboard-manager): document writeSecret * chore(clipboard-manager): add change file for writeSecret * test(clipboard-manager): cover writeSecret in e2e --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
1 parent
1ab930465f
commit
57297f3fb1
21 files changed
+247
-72
No files matched your search
@@ -35,6 +35,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
function writeSecret() {
|
||||
clipboard.writeSecret(text).then(() => {
|
||||
onMessage("Wrote secret to the clipboard")
|
||||
})
|
||||
.catch(onMessage)
|
||||
}
|
||||
|
||||
async function read() {
|
||||
try {
|
||||
const image = await clipboard.readImage()
|
||||
@@ -63,6 +70,7 @@
|
||||
bind:value={text}
|
||||
/>
|
||||
<button class="btn" type="button" on:click={writeText}>Write</button>
|
||||
<button class="btn" type="button" on:click={writeSecret}>Write Secret</button>
|
||||
<button class="btn" type="button" on:click={writeImage}>Pick Image</button>
|
||||
<button class="btn" type="button" on:click={read}>Read</button>
|
||||
</div>
|
||||
Reference in new issue
Block a user