equested URL if it redirected.
      //
      // We currently use `replaceState` rather than `pushState` on the assumption
      // that if the URL changed it did so because of a redirect and so the previous
      // URL shouldn't be retained in the tab's history. If we update the URL
      // in response to client-side URL changes in the iframe in future, we'll
      // probably want to change this.
      const viaURL = `/${metadata.location}`;
      history.replaceState(null, document.title, viaURL);
    