In order to be able to use your HTML-file (or any other resource) outside of the context of your extension (e.g. in a web-page), you need to add the target HTML file in the web_accessible_resources
section of your manifest. E.g.:
Extension file-structure:
root-dir/
|_____manifest.json
|_____content.js
|_____options.html
content.js:
/* Append a link to the web-page's body */
var a = document.createElement("a");
a.href = chrome.extension.getURL("options.html");
a.target = "_blank";
a.textContent = "My HTML file";
document.body.appendChild(a);
manifest.json:
{
"manifest_version": 2,
"name": "Test Extension",
"version": "0.0",
"offline_enabled": true,
"content_scripts": [{
"matches": ["*://*/*"],
"js": ["content.js"],
"run_at": "document_end",
"all_frames": false
}],
"web_accessible_resources": ["options.html"]
}