MCPcopy Create free account
hub / github.com/dailydotdev/apps / post

Function post

packages/extension/src/embedTargetReady/index.ts:31–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29if (window.top !== window.self) {
30 if (hasDailyDevEmbedAncestor()) {
31 const post = () => {
32 try {
33 window.parent.postMessage(
34 {
35 source: extensionSiteEmbedTargetMessageSource,
36 type: extensionSiteEmbedTargetEvent.DomReady,
37 target: window.location.href,
38 },
39 // Parent validates the sender against the target iframe window, with
40 // origin validation as a fallback, so a wildcard target is safe here.
41 '*',
42 );
43 } catch {
44 // postMessage is best-effort — never throw out of a content script.
45 }
46 };
47
48 if (document.readyState !== 'loading') {
49 post();

Callers 1

index.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected