The extension I am writing triggers a content script on the start of page load, using:
"run_at": "document_start"
This works just fine. However, I need to "inject" something and then continue rendering the initial page. If my action script simply contains:
alert("Hello World");
The alert will fire and the page will continue rendering. In contrast if the action script contains:
document.write("<span>Hello World!</span>");
This will write "Hello World!" but will not continue rendering the page. I know that "document.write" is almost never a good tool, but it seemed like the right tool because (a) its writing BEFORE the rest of the DOM and (b) there are no elements in the dom to "change" to effectuate the injection.
I think that explains the situation fairly well. But I'm going to provide a little more context. Ultimately I want to "inject" an iframe that will load "in front" of the page in question. Trying to provide users of my extension with an alternative user experience for a particular website.