1. 01 Feb, 2022 11 commits
  2. 31 Jan, 2022 19 commits
  3. 28 Jan, 2022 1 commit
  4. 27 Jan, 2022 1 commit
  5. 26 Jan, 2022 8 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
    • Robert Knight's avatar
      Simulate multi-step content loading process in VitalSource demo · df85b27f
      Robert Knight authored
      The VitalSource EPUB test page was missing an important behavior of the
      real VS viewer, where the content loads in multiple steps - see code
      comments for details. The client does not load reliably into the new
      chapter after a navigation due to this behavior of the VS viewer.
      df85b27f
    • Robert Knight's avatar
      Get WebSocket URL from /api/links endpoint · 78eb1bd1
      Robert Knight authored
      Get the WebSocket URL from the /api/links endpoint instead of the `websocketUrl`
      configuration in app.html. This ensures that the client uses the correct
      WebSocket endpoint for the h API service it is currently talking to, which may
      be different than the default when  `services` configuration is specified.
      
      When updating the tests, several had to be reworked to be less sensitive
      to the number of microtask ticks in between certain events.
      
      This depends on the h change in https://github.com/hypothesis/h/pull/7253.
      78eb1bd1