I am able to add HTML/CSS dynamically into the page using a content script. But I tried adding an iframe tag, and ran into a little bit of trouble.
Here is my code:
const myIFrame = `
<iframe src="${modalIFrameURL}"></iframe>
`;
let div = document.createElement('div');
div.style.zIndex = 9999999;
div.innerHTML = myIFrame;
document.body.insertBefore(div, document.body.firstChild);
note the modalIFrameURL value is:
chrome-extension://omelijcoklpokoeobkpepoipjpbakoeo/modal-iframe.html
This is what I get at the top left of the page:
If I hover over the gray fail box, it says:
Requests to the server have been blocked by an extension.
Does anyone know how to load an iframe from a content-script? What I am looking to do is load an HTML file from my Chrome Extension codebase into that iframe.