Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: use execCommand fallback for clipboard instead of missing plugin

Louis Beaumontec2d2e06f08b
diff --git a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
index d90f82d2c..20091a086 100644
--- a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
@@ -450,9 +450,15 @@ export function PrivacySection() {
try {
await navigator.clipboard.writeText(key);
} catch {
- // Fallback for Tauri webview clipboard restrictions
- const { writeText } = await import("@tauri-apps/plugin-clipboard-manager");
- await writeText(key);
+ // Fallback: create a temporary input and use execCommand
+ const el = document.createElement("textarea");
+ el.value = key;
+ el.style.position = "fixed";
+ el.style.opacity = "0";
+ document.body.appendChild(el);
+ el.select();
+ document.execCommand("copy");
+ document.body.removeChild(el);
}
toast({ title: "API key copied to clipboard" });
} else {