Where to define that the Enketo form should accept postMessage events

I need to use an Enketo form through an Iframe on my app’s page. I need to fill in a field in this form using javascript. It turns out that it is not possible to manipulate the iframe due to cross-origin blocking. From what I researched (link), the only way would be to use the window.postMessage api. If it exists, where is this option?