epub.js is working on integrating Hypothesis into their reader. Although ePub content is HTML and therefore they can use Hypothesis' existing code for annotating web content, their reader is somewhat different than a typical web page and consequently the built-in method of scrolling to an annotation when the user selects it in the sidebar does not work.
epub.js' reader consists of viewer controls, with an <iframe>
in the middle
of the page, which displays the HTML for the current chapter. The <iframe>
can be set to be the full height of the document.
The current integration works by embedding Hypothesis in the outer document,
and also loading Hypothesis into the <iframe>
but only loading Annotator.Guest
in the <iframe>
instead of the sidebar. The guest then connects to the
sidebar in the host document.