Running an extension in an iframe

Hello, sorry if this is basic. I tried searching the existing documentation and existing threads but had no success. I am trying to get an extension to run in iframes.

I created a browser extension that swallows a specific page: https://node.siasky.net/. My extension works great when loaded directly, the background script replaces the query to the webpage with a blank response, and then a content script is injected which writes a completely new page. So far so good.

But when another page loads https://node.siasky.net/ in an iframe, the extension appears to do nothing. The page loads within the iframe as though no extension is installed.

I would like my extension to apply even inside the iframe (only if the iframe is loading the above url). Is there an easy way to do this? What documentation should I be reading?

Resolved my issue. In the onBeforeRequest.addListener section, I had types: main_frame as a parameter. Removing that parameter solved my issue.

2 Likes