As the comment mentioned, it is only about making a GET request to chrome.runtime.getURL("myfile.html") , where "myfile.html" is the relative path (from the extension root) to the file you want.
You can do this with raw XHR or, if you use jQuery, use $.ajax .
To do this from the contents of the script, you need to declare it in "web_accessible_resources" .
Since you do not want this, yes, there is another way (not available for content scripts).
You can get the read-only HTML5 file system for your extension files using chrome.runtime.getPackageDirectoryEntry :
chrome.runtime.getPackageDirectoryEntry(function(root) { root.getFile("myfile.html", {}, function(fileEntry) { fileEntry.file(function(file) { var reader = new FileReader(); reader.onloadend = function(e) {
As you can see, this is much more complicated than an XHR request. This is probably only possible if you want to list files .
Xan
source share