MCPcopy
hub / github.com/agent0ai/agent-zero / copyToClipboard

Function copyToClipboard

plugins/_memory/webui/memory-dashboard-store.js:517–532  ·  view source on GitHub ↗
(text, toastSuccess = true)

Source from the content-addressed store, hash-verified

515 },
516
517 copyToClipboard(text, toastSuccess = true) {
518 if (navigator.clipboard && window.isSecureContext) {
519 navigator.clipboard
520 .writeText(text)
521 .then(() => {
522 if(toastSuccess)
523 justToast("Copied to clipboard!", "success");
524 })
525 .catch((err) => {
526 console.error("Clipboard copy failed:", err);
527 this.fallbackCopyToClipboard(text, toastSuccess);
528 });
529 } else {
530 this.fallbackCopyToClipboard(text, toastSuccess);
531 }
532 },
533
534 fallbackCopyToClipboard(text, toastSuccess = true) {
535 const textArea = document.createElement("textarea");

Callers 3

drawMessageCodeExeFunction · 0.90
drawBrowserToolFunction · 0.90

Calls 2

justToastFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected