这是我的manifest.json
{
"manifest_version": 2,
"name": "MyExt",
"version": "1.0",
"permissions": ["http://*/*", "https://*/*", "webRequest", "webRequestBlocking"],
"background": [
{
"scripts": [
"js/background.js"
],
"persistent": true
}
],
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": ["js/content.js"]
}
]
}
background.js:
chrome.webRequest.onBeforeRequest.addListener(
function(details){
console.log('test');
return {cancel: false};
},
{urls: [ "http://*/*", "https://*/*" ]},
["blocking"]
);
我认为,这应该记录Chrome正在进行的每个请求。 但我从来没有在我的控制台中看到任何“测试”......它让我非常疯狂......