Here's a simplified version of what I want to do.
I have this in my manifest:
"content_scripts": [
{
"matches": ["*://*.foo.com/*"],
"js": [ "content.js"]
}
]
And I have a file in my extension called stuff.html.
When a user visits a foo.com page, I want to inject some html into certain areas of the page. I want to maintain this html in a separate file. So I want to do something like this in content.js:
stuff = readfile("stuff.html")
document.body.innerHTML = document.body.innerHTML.replace('bad stuff', stuff);
"readfile" of course is a fake method I made up for the question.
How can I do this?