What the viewer hands the element of the handler showing a file, with the
before-download event it dispatches on it before downloading that file,
from its own Download, Ctrl+S or the Files download action. A handler with
edits not written yet saves them first:
element.addEventListener('before-download', (event) => { if (dirty) { event.detail.waitUntil(save()) } })
A promise that rejects cancels the download, and the viewer says so.
What the viewer hands the element of the handler showing a file, with the
before-downloadevent it dispatches on it before downloading that file, from its own Download, Ctrl+S or the Files download action. A handler with edits not written yet saves them first:A promise that rejects cancels the download, and the viewer says so.