我正在编写一个扩展程序,并在我的后台页面中有这个调用:
chrome.webRequest.onBeforeRequest.addListener(function(details) {console.log(details)}, {urls: ["<all_urls>"]}, ["blocking"]);
但是,每当我运行它时,我都会在后台页面的开发工具中收到此错误:
Error during webRequestInternal.addEventListener: You do not have permission to use blocking webRequest listeners. Be sure to declare the webRequestBlocking permission in your manifest.
即使我在清单中的权限看起来像这样:
"permissions": [
"cookies",
"http://*/*",
"https://*/*",
"tabs",
"history",
"webRequest",
"webRequestBlocking"
]
这到底是怎么回事?这是网络请求文档http://developer.chrome.com/stable/extensions/webRequest.html。