The file shown is about to be downloaded, from the viewer's own
Download, Ctrl+S or the Files download action. The same event the
handler's element gets: what is handed to waitUntil() holds the
download, and a promise that rejects cancels it.
The viewer closed.
Editing was entered or left.
Another file is shown: the next or previous one, or the one after a
deleted file. Not when a page asks for it with goTo().
What the viewer tells about itself, on the viewer (
getViewer()) for any page, and on the sessionopen()resolves with for its opener. Shaped like what handler elements emit: aCustomEventwhosedetailholds the values.