chrome扩展执行tabs.executeScript报错提示no main frame

在选项卡里打开www.baidu.com,然后在background里后台运行chrome.tabs.executeScript(cid, {code:"document.body.innerHTML +='< div >aa< /div >'",allFrames:false}); 提示no main frame;不知道怎么解决。

是不是页面没有加载完毕,你的js试试放到window.onload中执行

http://stackoverflow.com/questions/25839547/chrome-tabs-executescript-and-injection-only-into-pages-that-pass-matches-filter

谢谢两位 我明白是怎么回事了。我的扩展是在360双引擎浏览器测试的,如果是chrome引擎则可以执行。如果是兼容模式(IE引擎),则会提示no main frame。也就是chrome扩展 在兼容模式(IE引擎)下是无法正常运行