Have opened say zyx.com in two different tabs (tab1, tab2) in a same browser.



zyx.com has the code

window.addEventListener("message", receiveMessage, false);

to receive messages from postMessage()

From zyx.com, opening a new window say

window.open("abc.com")

abc.com has post the message via postMessage() to zyx.com.

In this case, both the tabs ( which has zyx.com ) will listen for that message.

But in my case, i need to do the action based on postMessage() in only one tab (say tab1).

Please help/ guide to achieve this.

PS : If my explanation is not clear, please ask. Happy to explain more.