Skip to main content

Module handoff

Module handoff 

Source
Expand description

The two hand-offs a backend can perform without a shell around it: saving bytes to a file and putting text on the clipboard. Both are browser affordances rather than application decisions, which is why they live at this level rather than above it.

Functionsยง

clipboard_write
Put text on the system clipboard. The write is asynchronous and its promise is dropped: a clipboard the user denied is not an editing error.
download
Save bytes as file_name: wrap them in a Blob, mint an object URL, and click a detached <a download>, so the browser saves the file straight away rather than offering a link.