I use a 3rd party library for my app inside the ui modal. At first, the library didn’t work at all so I add src attribute to the ui modal and follow the instruction in this link but nothing works, the modal iframe and the app iframe still cannot communicate.
In the above document mentioned this line
modal.contentWindow.postMessage(‘Hi, this is the main app!’, location.origin);
but contentWindow property is not exist in the modal, only in iframe element
Topic summary
Issue: A third‑party library embedded in a Shopify App Bridge UI modal doesn’t work. Adding a src attribute to the modal and following Shopify’s documentation on modal-app communication did not enable messaging between the modal iframe and the main app iframe.
Detail: The docs example uses modal.contentWindow.postMessage(…), but the poster notes contentWindow is not a property on the modal object—only on an iframe element—so the recommended approach cannot be applied as written. The linked Shopify doc is central to the issue.
Status: Unresolved. The thread seeks clarification on whether this is a bug in the App Bridge modal API or an error in the documentation, and how to correctly access the iframe window for postMessage.