Chrome Extension: Accessing a cross-origin iframe within background.html
<p>I'm trying to write an extension that scrapes a site that needs to be loaded as a webpage, due to the complexities of the pages (XHR isn't really an option).  The best solution I've come up with is to do the scraping via an iframe placed in the background.html.  The extension will provide the user with notifications when certain conditions on the target page are met.</p>

<p>There was a very similar question posted here a few years ago:</p>

<p><a href="https://stackoverflow.com/questions/17299322/chrome-extension-loading-a-hidden-page-without-iframe">Chrome extension: loading a hidden page (without iframe)</a></p>

<p>I was able to load an iframe with the target page in the background page by <a href="https://stackoverflow.com/questions/15532791/getting-around-x-frame-options-deny-in-a-chrome-extension/15534822#15534822">removing the x-frame-options header</a>, as suggested in the response to the question above.  I can scrape the data via a content script when the page is loaded in a browser tab/window.  However, I want to be able to do this from the background script, and of course it cannot access the iframe contentDocument directly due to cross-origin security.</p>

<p>Unfortunately, although the iframe loads the content from the target page just fine, it does not load the content script.  It doesn't seem the background.html loads any content scripts at all.  This makes sense, because things could get crazy when extensions start loading each other's content scripts.</p>

<p>Is there a manifest option that will allow a specific content script to run in the iframe on the background page?</p>

<p>If not, is there any way to relax cross-origin security in the extension to access the iframe contentDocument?</p>

<p>Please note, using the --disable-web-security chrome command line switch isn't an option.  I want non-technical people to be able to use the extension, and I don't want to require users to disable web security to use it.</p>

<p>If there isn't any way to run a content script in a background page or relax security, what other possibilities are there for scraping a page DOM with a chrome extension without using XHR?  Surely there must be a way.</p>