The chrome.devtools.* API modules are available only to the pages loaded within the DevTools window. Content scripts and other extension pages do not have these APIs. Thus, the APIs are available only through the lifetime of the DevTools window. (read more)
chrome.devtools.network
- Since Chrome 18.这个 API 必须是 18 以后的 Chrome,所以现在大家用的 Chrome 浏览器都应该能够满足,但要使用这个 API,有一个限制:必须在 devtool 的页面中。
必须在 devltool 的页面中,也就是是说,只能在 manifest.json 中指定的
devtools_page": "devtools.html"
,当然你可以通过 message passing 将这些信息送入其它的上下文,但必须在 devtool 的生命周期内(devtool 激活状态)。