Reputation:
I'm trying to load myframe.html inside an iframe and attach that iframe to the DOM of the current page. Is this possible, if myframe.html is part of my extension source?
I was thinking something like
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "myframe.html"); //what would be my path here, if this were possible?
document.body.appendChild(iframe);
Upvotes: 1
Views: 2534
Reputation: 16597
It should be possible, use a content script to inject javascript into the page and then use the chrome.extension.getURL()
method to get the correct URL to your file hosted inside your extension
Upvotes: 6