如何阅读Chrome扩展程序中的所有http请求?

时间:2018-01-15 16:35:55

标签: javascript json google-chrome google-chrome-extension

我希望我的Chrome扩展程序能够读取并显示警报中的所有http请求。但警报未显示,控制台清晰且没有错误。这是我的代码:

chrome.webRequest.onBeforeRequest.addListener(
function(details) {
        alert(JSON.stringify(details));
},
{urls: ["<all_urls>"]},
["blocking", "requestBody"]
);

我的清单:

{
"manifest_version": 2,
"name": "Some_Name",
"version": "1.2",

"content_scripts": [{"matches": ["<all_urls>","http://*/*", "https://*/*"],"js": ["background.js"]}],
"background": {

  "page": "background.html"
},

  "permissions": [
  "alarms",
  "webRequest",
    "webRequestBlocking"
],

    "browser_action": {
      "default_title": "Some extension"
  },

  "icons": {
   "128": "icon.png" }

  }

0 个答案:

没有答案