Cross Origin Iframe Recording
Cross-origin iframe support is still in development. If you have any questions or suggestions please reach out to us at support@highlight.io
Cross-origin iframes are <iframe>
elements in your app that reference a domain considered to be of a different origin. When your iframe uses a src
tag pointing to a different origin, the iframe is not accessible from the parent page. However, the iframe can still emit messages that the parent page can hear.
To support cross-origin iframes, we added functionality into our recording client that allows the iframe to forward its events to the parent session. All you need to do is add the Highlight snippet to both the parent window and the iframe.
Ensure you are using highlight.run 5.2.0 or newer. Then, add the following option to the H.init
call inside of your iframe.
import { H } from 'highlight.run' H.init('<YOUR_PROJECT_ID>', { isCrossOriginIframe: true, })
Ensure that you add the H.init
call to both the parent page and the iframe page, but that you only set isCrossOriginIframe
in the H.init call of your iframe. Otherwise your sessions will not be recorded.