hypothesis / client

The Hypothesis web-based annotation client.
Other
641 stars 197 forks source link

Load client into VitalSource container frame instead of content frame in the LMS app #4282

Closed robertknight closed 2 years ago

robertknight commented 2 years ago

The client is currently loaded into the VitalSource viewer in different ways in the browser extension vs. the LMS app. In the extension the client is injected into the container frame (see VitalSourceInjector class in the client for an explanation of the frame structure). In the LMS app the client is instead loaded into the content frame each time a new chapter is loaded.

The LMS app works the way it does because when we initially added the VS integration, there were many issues with the client's support for guest frames that are not the host frame. These issues have now been resolved, so we should change the extension and the LMS app to work the same way. Loading the client into the content frame provides better performance, as the sidebar app only loads once, and gives us the ability to preserve state across chapter navigations.

The work that needs to be done here is to contact VitalSource and ask them to change the way that https://hypothesis.vitalsource.com loads the client. The client is currently loaded and configured in the content frame using two <script> tags:

hypothesis vitalsource com config

These tags need to be moved one level up the frame tree to the container frame, and the ancestorLevel property value needs to be reduced to 3.

robertknight commented 2 years ago

VitalSource have completed this work and I have tested it.