1. 01 Feb, 2022 13 commits
  2. 31 Jan, 2022 19 commits
  3. 28 Jan, 2022 1 commit
  4. 27 Jan, 2022 1 commit
  5. 26 Jan, 2022 6 commits
    • Robert Knight's avatar
    • Robert Knight's avatar
      Add/revise some comments to address PR feedback · 7f32c5ee
      Robert Knight authored
      Clarify what happens if we try to test whether a VitalSource frame
      contains "real content", before it has finished loading.
      7f32c5ee
    • Robert Knight's avatar
      Load final chapter URL in a more realistic way · ee8036cd
      Robert Knight authored
      The real VitalSource viewer loads the final URL with a form submission,
      which does not update the `src` attribute of the iframe. Make the demo
      page also load the app in a way that doesn't modify the parent frame's
      DOM, to ensure the client is not relying on that.
      ee8036cd
    • Robert Knight's avatar
      Use named parameter instead of boolean · 07d6c4ef
      Robert Knight authored
      07d6c4ef
    • Robert Knight's avatar
      Add tests for scenarios where client shouldn't be re-injected · c6a65f46
      Robert Knight authored
      I don't know if these scenarios can actually happen in the real VS viewer, but
      this feels like appropriate defensive coding.
      c6a65f46
    • Robert Knight's avatar
      Handle multi-step chapter navigations in VitalSource books · 1895eec5
      Robert Knight authored
      Navigations between sections of a book in VitalSource happen in several
      steps:
      
       1. The iframe for the previous chapter is removed
       2. An iframe is created for the new chapter. The initial load of this
          iframe contains a "blank" page with the chapter content in an
          encoded/encrypted form as hidden text in the page.
       3. The chapter content data is submitted to the VS backend via a form
          POST request, which returns the decoded content
      
      Previously the Hypothesis client would sometimes detect the new iframe
      after step 2 and inject the client before step 3 had completed. As a
      result the client would be injected into the blank frame, then
      immediately unloaded, and not re-loaded into the "real" content frame.
      
      Make injection more reliable by:
      
       1. Checking whether the content frame is a "blank" frame or not before
          injecting the client.
       2. Listening for `load` events on the frame and re-injecting the client
          if the iframe is navigated
      1895eec5