How to read file from chrome extension?

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.

47.6k 10 10 gold badges 105 105 silver badges 158 158 bronze badges asked Mar 4, 2015 at 15:17 3,443 7 7 gold badges 33 33 silver badges 44 44 bronze badges

I exactly said that I wouldn't like to use Ajax request with XMLHttpRequest. Isn't there a way to load another HTML from popup.js which is not a content script?