Permissions policy violation: unload is not allowed in this document.
I have this problem when reading epub and switching chapters on chrome. It seems to be the result of deprecating-unload. The hypothes.is client give the following uri
http://127.0.0.1:3000/dist/index.html, https://s3.amazonaws.com/moby-dick/OPS/chapter_033.xhtml, https://s3.amazonaws.com/moby-dick/OPS/chapter_033.xhtml, https://s3.amazonaws.com/moby-dick/OPS/chapter_033.xhtml, https://s3.amazonaws.com/moby-dick/OPS/chapter_006.xhtml, https://s3.amazonaws.com/moby-dick/OPS/chapter_007.xhtml, https://s3.amazonaws.com/moby-dick/OPS/chapter_008.xhtml
The integration with Epub.js and Readium is non-functional and needs to be re-implemented from scratch along the lines of the VitalSource integration. See also https://github.com/hypothesis/client/issues/4283 and https://github.com/hypothesis/client/issues/4153. We have removed references to Epub.js and Readium from the Hypothesis website.
We currently use the unload event to:
- Detect when a guest window is unloaded and send a "close" message via the MessagePort. See https://github.com/hypothesis/client/blob/30112b6268f88c44556b53d7494ae3e7b0981e23/src/shared/messaging/port-rpc.ts#L245
- Detect when a same-origin iframe is about to navigate to a different document. See https://github.com/hypothesis/client/blob/30112b6268f88c44556b53d7494ae3e7b0981e23/src/annotator/frame-observer.ts#L69.
Point (1) is a pain because the platform does not have an alternative API for detecting when the other end of a MessagePoint goes away. There was work being done on an onclose handler, but that has gotten stalled for security reasons. This thread has some workarounds for same-origin iframes which might be enough for our needs.