| 29 | if (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(); |