我一直在为iframe的Chrome扩展搞乱,我似乎遇到了很多与iframe相关的问题。无论如何,我有一个iframe注入到一个网站(跨域)。我想要的是iframes背景图像继承父母页面背景(所以它融入)。所以这就是我想:chrome javascript dom删除iframe backgroundimage
//Setup iframe attributes
iframe.setAttribute("id","injected_frame");
iframe.setAttribute("src", 'google.com');
iframe.setAttribute("width","100%");
iframe.setAttribute("height","425");
iframe.setAttribute("frameborder","0");
iframe.setAttribute("scrolling","auto");
iframe.setAttribute("style","backgroundImage: inherit"); <-- undefined error
基本上它只是不工作,背景保持不变,并试图这样,当我得到一个未定义的错误。
哦,我也试着object.body.style更换的最后一行,得到的未定义的错误也是如此。 – 2012-01-15 04:01:16