MCPcopy Index your code
hub / github.com/philc/vimium / dispatchReadyEventWhenReady

Function dispatchReadyEventWhenReady

pages/ui_component_messenger.js:57–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55// when we've seen both.
56let hasDispatchedReadyEvent = false;
57function 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}

Callers 1

openPortFunction · 0.85

Calls 1

postMessageFunction · 0.70

Tested by

no test coverage detected