(action = "copy")
| 2501 | }, |
| 2502 | |
| 2503 | async copyBrowserClipboardToHost(action = "copy") { |
| 2504 | try { |
| 2505 | const clipboard = await this.sendClipboard(action); |
| 2506 | const text = String(clipboard?.text || clipboard?.clipboard_text || ""); |
| 2507 | if (!text) return; |
| 2508 | await copyToClipboard(text); |
| 2509 | this._clipboardFallbackText = text; |
| 2510 | const message = action === "cut" ? "Cut from Browser" : "Copied from Browser"; |
| 2511 | globalThis.justToast?.(message, "success", 1200, "browser-clipboard"); |
| 2512 | } catch (error) { |
| 2513 | this.error = action === "cut" |
| 2514 | ? "Browser cut failed." |
| 2515 | : "Browser copy failed."; |
| 2516 | globalThis.justToast?.(this.error, "warning", 1800, "browser-clipboard"); |
| 2517 | console.warn("Browser clipboard copy failed", error); |
| 2518 | } |
| 2519 | }, |
| 2520 | |
| 2521 | async readHostClipboardText() { |
| 2522 | const clipboard = globalThis.navigator?.clipboard; |
nothing calls this directly
no test coverage detected