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:
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.
[x] Manually verify (using devtools) that Hypothesis will work in the VS reader after the above change is made
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: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 to3
.