()
| 55 | // when we've seen both. |
| 56 | let hasDispatchedReadyEvent = false; |
| 57 | function dispatchReadyEventWhenReady() { |
| 58 | if (hasDispatchedReadyEvent) return; |
| 59 | |
| 60 | if (document.readyState === "loading") { |
| 61 | globalThis.addEventListener("DOMContentLoaded", () => dispatchReadyEventWhenReady()); |
| 62 | return; |
| 63 | } |
| 64 | if (!ownerPagePort) return; |
| 65 | |
| 66 | if (globalThis.frameId != null) { |
| 67 | postMessage({ name: "setIframeFrameId", iframeFrameId: globalThis.frameId }); |
| 68 | } |
| 69 | hasDispatchedReadyEvent = true; |
| 70 | postMessage({ name: "uiComponentIsReady" }); |
| 71 | } |
no test coverage detected