1. 07 Oct, 2021 5 commits
    • Robert Knight's avatar
      Route guest frame unload notifications via host frame · c56cf3fa
      Robert Knight authored
      Change how the sidebar is notified of guest frames being unloaded to
      support guest frames where the client has been loaded via means other
      than `HypothesisInjector` or where the guest is cross-origin.
      
      Instead of listening for the guest frame's 'unload' event from the
      parent frame in `HypothesisInjector`, the guest frame instead listens
      for this event itself and sends a `hypothesisGuestUnloaded` message to
      the host frame via `window.postMessage`, which in turn is handled in the
      `Sidebar` class to relay it to the sidebar app via a `destroyFrame` RPC
      call. This indirect route works around a bug in Safari (see code
      comments).
      
      As well as supporting future use cases, this also simplifies the
      `HypothesisInjector` class as it no longer needs access to the `Bridge`.
      c56cf3fa
    • Robert Knight's avatar
      Add toggle button to "Annotatable iframe" test page · 84444667
      Robert Knight authored
      This enables testing handling of the client's discovery of existing
      frames (on page load) as well as handling of dynamic addition and removal after
      the client has started.
      84444667
    • Robert Knight's avatar
      Add test for `FrameSyncService.notifyHost` · d7a7f095
      Robert Knight authored
      d7a7f095
    • Robert Knight's avatar
      Use separate channels for guest / host messages from sidebar · 564e8cfe
      Robert Knight authored
      Use separate channels for sending messages to guests vs the host in the
      sidebar, even for the common case when there is only one guest and it is
      the same frame as the host.
      
      This change makes it clear for readers which part of the annotator code
      is intended to handle a particular message from the sidebar. It is also
      a step towards supporting host frames that are not guests. This will be
      needed in ebook readers where the host frame provides the navigation UI
      and contains the frame displaying the book content, but should not be
      annotatble itself.
      
       - Remove the `bridge` service in the sidebar. The `frameSync` service
         now provides the entry point for other services/components to make RPC calls
         to the host or guest frames. Currently the only use case is
         sending notifications to the host via `FrameSyncService.notifyHost`.
      
       - Create separate `Bridge` instances in `FrameSyncService` for sidebar
         <-> guest and sidebar <-> host communication. The sidebar <-> guest
         bridge works the same as before. The sidebar <-> host bridge
         is established by having `FrameSyncService` create a MessageChannel
         when sending the `hypothesisSidebarReady` notification to the host.
      
         The sidebar / host frames then add respective ports of this channel
         to a Bridge instance.
      
       - Change the various existing RPC calls between frames to use either
         the guest <-> sidebar or host <-> sidebar communication channels as
         appropriate
      564e8cfe
    • Robert Knight's avatar
      Show URLs for all connected frames in help panel · 4d3f72e9
      Robert Knight authored
      Show the URLs of all frames connected to the sidebar in the Version info
      tab of the Help panel. Previously only the URL of the main frame was
      shown.
      
      Initially this will mainly be useful for client developers to check that
      the expected set of frames are connected to the sidebar in different
      scenarios.
      4d3f72e9
  2. 06 Oct, 2021 6 commits
  3. 04 Oct, 2021 12 commits
  4. 30 Sep, 2021 7 commits
  5. 29 Sep, 2021 2 commits
  6. 28 Sep, 2021 1 commit
  7. 27 Sep, 2021 7 commits