Google chrome extension Google Chrome扩展从源代码添加iframe

Google chrome extension Google Chrome扩展从源代码添加iframe,google-chrome-extension,Google Chrome Extension,我正在尝试将myframe.html加载到iframe中,并将该iframe附加到当前页面的DOM中。如果myframe.html是扩展源的一部分,这可能吗 我在想 var iframe = document.createElement("iframe"); iframe.setAttribute("src", "myframe.html"); //what would be my path here, if this were possible? document.body.appendChi

我正在尝试将myframe.html加载到iframe中,并将该iframe附加到当前页面的DOM中。如果myframe.html是扩展源的一部分,这可能吗

我在想

var iframe = document.createElement("iframe");
iframe.setAttribute("src", "myframe.html"); //what would be my path here, if this were possible?
document.body.appendChild(iframe);

应该可以,使用a将javascript注入页面,然后使用该方法获取扩展名内托管文件的正确URL。

应该可以,使用a将javascript注入页面,然后使用该方法获取扩展名内托管文件的正确URL