navigator.clipboard is unavailable on insecure origins and on file://
pages — both of which MAIDR runs on routinely, since py-maidr and r-maidr
write charts to standalone HTML files — so a execCommand fallback covers
the cases the async API refuses.
Parameters
text: string
The text to place on the clipboard.
Returns Promise<void>
Throws
Error if neither the async API nor the fallback can copy.
Writes text to the system clipboard.
navigator.clipboardis unavailable on insecure origins and onfile://pages — both of which MAIDR runs on routinely, since py-maidr and r-maidr write charts to standalone HTML files — so aexecCommandfallback covers the cases the async API refuses.