📜  在 chrome 扩展中读取网络响应 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:59.136000             🧑  作者: Mango

代码示例1
chrome.devtools.network.onRequestFinished.addListener(request => {
  request.getContent((body) => {
    if (request.request && request.request.url) {
      if (request.request.url.includes('facebook.com')) {

         //continue with custom code
         var bodyObj = JSON.parse(body);//etc.
      }
}
});
});