I'm trying to make an extension that lets you click on an iframe in order to remove it (the iframe element) from the page.
I can detect the click only from inside the iframe, but removing the element I have to do from the parent document. This is difficult if the iframe doesn't have the same origin. I can send a message from the iframe content script to the parent content script, but how can the parent find the correct element? As far as I can tell I only have a frameId.