Premise:
Trying to write an incredibly simple chrome extension, and as a test, I wanted to add console logging for debugging. But, I keep getting this error
Unchecked runtime.lastError while running
webRequestInternal.addEventListener
: You need to request host permissions in the manifest file in order to be notified about requests from the webRequest API.
Attempted:
I have tried adding every permission I can find without any luck. Could someone please help me out!
Manifest File:
{
"manifest_version": 2,
"name": "test",
"description": "testing app",
"version": "1.0",
"background": {
"scripts": ["small.js"],
"persistent": true
},
"permissions": ["webRequest", "webRequestBlocking", "tabs", "background", "storage"],
"optional_permissions": ["http://*/*", "https://*/*", "<all_urls>"]
}
small.js
chrome.webRequest.onBeforeRequest.addListener(function(details) {
if (details.method === "POST") {
alert('here');
console.log('logging here');
} else if (details.method === "GET") {
alert('there');
console.log('logging there');
}
}, {
urls: ["<all_urls>"]
}, ["blocking", "requestBody"]);