I have popup.html where popup.js is invoked when popup is loaded by clicking on browser action. There I'm programmatically injecting content scripts with chrome.tabs.executeScript()
. I need to append one element to page's body. How can I insert HTML code from different .html file within extension, because it's much easier to maintain the code like that. I was thinking of accessing it within popup.js (is there some API call for that?) and then within code
attribute to insert content script code with string of retrieved HTML code.
I saw some methods using XMLHttpRequest
from content script, but is there to avoid that? I tried with chrome.fileSystem
, but that's for chrome apps and not extensions.