Whenever an iframe changes location Hypothesis needs to be injected again
When enabling annotations on an iframe with the enable-annotation attribute, it appears the client is only injected once. This leads to issues when the frame navigates to another page. I haven't checked whether the issue exists for all types of navigation (for example if it matters if the parent or the frame itself is causing the navigation). In this particular case the frame was initialised with about:blank.
In this particular case the frame was initialised with about:blank.
We have code that is supposed to handle this use case and avoid the overhead of redundantly loading the client into an about:blank frame. See hasBlankDocumentThatWillNavigate. Can that solve your use case with some extensions?
I presume the hasBlankDocumentThatWillNavigate in this case wasn't sufficient because the <iframe> had no src set but instead got it assigned through either element.setAttribute or contentWindow.location. Any ideas how to solve this differently than registering a load event handler?