1. 05 Aug, 2021 2 commits
  2. 04 Aug, 2021 6 commits
  3. 03 Aug, 2021 6 commits
  4. 02 Aug, 2021 8 commits
  5. 30 Jul, 2021 7 commits
  6. 29 Jul, 2021 7 commits
    • Robert Knight's avatar
      f144f6d0
    • Robert Knight's avatar
      Add missing `origin` parameter in `connectToSidebar` call · 41659761
      Robert Knight authored
      The test happened to work without it, but the parameter is ostensibly
      required.
      41659761
    • Robert Knight's avatar
      Add missing `if` check around assignment of `sidebarWindow` · d5441c76
      Robert Knight authored
      We don't want to connect to the sidebar in the parent frame if the
      current frame has one.
      d5441c76
    • Robert Knight's avatar
      Improve error when a guest-only frame has a cross-origin parent · 62e9564b
      Robert Knight authored
      The previous code assumed that the `window.parent.__hypothesis` access
      would return undefined. This assumption was wrong. Instead it triggers
      an error.
      
      Handle this error and display a more informative message if a guest
      cannot connect to a sidebar.
      62e9564b
    • Robert Knight's avatar
      Add missing `FrameSyncService.connect` call in test · 177eaed0
      Robert Knight authored
      Without this call the test doesn't execute the code paths it intends to
      test.
      177eaed0
    • Robert Knight's avatar
      Remove `port` property from `hypothesisGuestReady` message · f6f0f632
      Robert Knight authored
      Use the existing `MessageEvent.ports` property to access transferred
      ports instead of adding an extra property to the message itself.
      f6f0f632
    • Robert Knight's avatar
      Convert host <-> guest communication to use MessageChannel · 036fb8c6
      Robert Knight authored
      This commit implements the initial transition of communication between
      guest/host frames and the sidebar to use `MessageChannel` as the
      underlying transport instead of `window.postMessage`, building on
      previous changes to the `Bridge` and `RPC` classes.
      
      This change aligns with an ongoing to plan to use `MessageChannel`
      instead of `window.postMessage`, and also resolves an issue where guest
      frames may fail to connect to the sidebar if the annotator code loads in
      the guest before the sidebar application has finished loading.
      
      This initial version has several limitations compared to what is planned
      for the final version of the new inter-frame communication system:
      
       - It only supports guest frames which are the same frame as the host or
         a direct, same-origin child.
      
       - Sidebar <-> host communication relies on the host frame also being a
         guest frame. In order for the host frame to receive messages from the
         sidebar, it must run the logic to establish sidebar <-> guest communication.
         In other words, it is not possible to have a host frame which cannot
         also be annotated.
      
       - The only supported roles for frames are sidebar and host/guest. There
         is no separate role for notebook frames for use in notebook <->
         sidebar communication.
      
      Making this change involved replacing the protocol used by guest frames
      and the sidebar to discover each other. The new one is simpler than the
      previous one and works as follows:
      
      1. When the sidebar application starts up it notifies the parent frame that
         it is ready to connect to guests via a `hypothesisSidebarReady`
         message.
      
      2. Guest frames wait for this notification to be received before
         connecting to the sidebar. When they connect, they create a
         `MessageChannel` and send one port to the sidebar via a
         `hypothesisGuestReady` message and use the other port locally.
      
      3. When the sidebar receives a `hypothesisGuestReady` message it creates
         a channel to communicate with the guest.
      036fb8c6
  7. 28 Jul, 2021 4 commits