GoogleChrome/Firefox在控制台中看不到扩展输出我正在尝试测试浏览器的Web扩展示例代码。但是这不管用。我查看了GoogleChrome和Firefox的控制台。它什么都不印。以下是我的代码:耶森:{
"description": "Demonstrating webRequests",
"manifest_version": 2,
"name": "webRequest-demo",
"version": "1.0",
"permissions": [
"webRequest"
],
"background": {
"scripts": ["background.js"]
}
}背景js:function logURL(requestDetails) {
console.log("Loading: " + requestDetails.url);
}
chrome.webRequest.onBeforeRequest.addListener(
logURL,
{urls: ["<all_urls>"]}
);
console.log("Hell o extension background script executed");我是不是遗漏了什么?
3 回答
慕桂英3389331
TA贡献2036条经验 获得超8个赞
"background": { "persistent": true, "scripts": ["background.js"] }
- 3 回答
- 0 关注
- 1189 浏览
添加回答
举报
0/150
提交
取消