Goal:
When the user clicks a button in my Side Panel, the extension will paste text into a DOM element inside a cross-domain iFrame of the active tab.
Knowing I need a content script inserted into the cross-domain iFrame, i can't really figure out how to do it.
I know that I can get permissions to inject a content script into the active tab when the user clicks the extension's action button, but that doesn't get me down to the cross-domain iframe.
I have successfully injected a content script into the cross-domain iFrame when the user right-clicks a textarea in the dom and selects my extension's context menu item. I use optional permissions and chrome.scripting.executeScript to do that. Is there some way I could use this technique in my Side Panel scenario?
Maybe I could detect if there's an iFrame in the active tab, get its iframe index and src attribute, then request optional host permissions on it so I could then inject a content script.
Thanks for your thoughts!