我正在开发一个chrome扩展以捕获chrome开发工具中的网络选项卡相关数据。 我的代码如下未捕获TypeError:无法读取Chrome扩展中未定义的属性'网络'
manifest.js
{
"name": "Entries",
"version": "1.0",
"description": "Give me entries",
"devtools_page": "devtools.html",
"manifest_version": 2
}
devtools.js
chrome.devtools.network.getHAR(function(result) {
var entries = result.entries;
Console.warn("entries : " + entries.length);
});
越来越控制台选项卡下面的错误
Uncaught TypeError: Cannot read property 'network' of undefined
这意味着'chrome.devtools'未定义 - devtools.html的内容是什么? –
可能阅读http://stackoverflow.com/questions/11661613/chrome-devpanel-extension-communicating-with-background-page/11677744#11677744 –
只是一个脚本标签,它调用'devtools.js'@jaromanda X –