Currently working on an Angular project, I am facing a scenario where I have a link on page A that directs users to a different origin page B. The HTML code for the link is shown below:
...
<a href="https://another.origin"> PAGE B </a>
...
Once a user opens page B in a new window from page A, I need to be able to post a message to page B using
referenceOfB.postmessage(msg, bOrigin)
. In order to do this, I must first obtain a reference to page B.
I attempted to use window.open
to retrieve a reference to page B, but ended up with null. I am unsure if this is the correct approach and would appreciate any insights or suggestions on how to properly achieve this task.