Specifying multiple targetOrigin uris in postmessage
Unfortunately you can't. You should either provide "*" or single specified domain.
You could try to send multiples time, one per domain:
targetWindow.postMessage(message, "https://domain1.com");
targetWindow.postMessage(message, "http://localhost");
⚠ It is not recommended use "*" to prevent security vulnerabilities.
You can also make an array + loop