Assuming you have control over both pages, the answer is "yes", provided you open the second window from the first. window.postMessage
only works if you can get a handle to the window
. Therefore, if your background site were to invoke window.open()
to get to your "other" site, then you could retain a handle to it in your first page's script.
As far as opening it in a tab goes, you'll have to specify that in your browser options.