I have a window with a cross origin iframe in it. The extension has a content script in both the parent window and the iframe'd window.
I would like to send a message from the parent window's content script to the iframe window's content script.
I don't see a reliable mechanism for this though. I've explored two options:
1) Some form of direct Content Script to Content Script communication. This is not possible as the same origin policy also applies to content scripts so access to the iframe'd window isn't possible from the parent content script.
2) Pass a message via the Background Script. The parent content script can send a message to the background script which will then relay the message to the iframed content script. However, to do this, I need the frameId for the iframe'd window (there may be many iframe'd windows in the page) but I don't see a way for the parent content script to access that.
What would be the best way to approach this?
thank you, Scott