2011-06-17 44 views
1

我想加载iframe中的myframe.html并将该iframe附加到当前页面的DOM。如果myframe.html是我的扩展源的一部分,这是可能的吗?谷歌浏览器扩展从源添加iframe

我想这样

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

回答