I would like to use postMessage in my application to communicate with IFrames. This would normally require access to the Window object, which I don’t see implemented anywhere in Elm. Neither have I found a package which implements a wrapper around postMessage.
Judging by the documentation, I could implement this myself with a port. Is this correct or am I missing a simpler way?
the other strategy I can think of would be wrapping your iframe thingy in a webcomponent and monitoring its attributes - then if something changed you could also trigger the message in a more declarative way. this is useful if your message is related to keeping some value synced between elm and your iframe.
either way - you will need to do it in JS land. ports is the global approach, webcomponents is the local approach (if that makes any sense).