MCPcopy Create free account
hub / github.com/anomalyco/models.dev / writeClipboard

Function writeClipboard

packages/web/src/index.ts:659–672  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

657}
658
659async function writeClipboard(value: string) {
660 if (writeClipboardWithSelection(value)) return true;
661
662 if (navigator.clipboard?.writeText) {
663 try {
664 await navigator.clipboard.writeText(value);
665 return true;
666 } catch {
667 return false;
668 }
669 }
670
671 return false;
672}
673
674function selectCopySource(button: HTMLButtonElement) {
675 const source = button

Callers 1

copyValueFunction · 0.85

Calls 1

Tested by

no test coverage detected