Reputation: 21352
here is the code I use in my Chrome extension. It's an extension that for now just intercepts the requests and prints them in the pop-up.
<script>
function interceptRequest(request) {
var p = document.createElement("p");
var text = document.createTextNode("" + request.method + " " + request.url + " " + request.headers);
p.appendChild(text);
document.body.appendChild(p);
document.body.append(request.url);
}
chrome.webRequest.onBeforeRequest.addListener(interceptRequest, null, ['blocking']);
</script>
When I do "inspect pop-up" by right clicking on the extension's icon I get this error from the console: Uncaught Error: Parameter 1 is required. extensions/schema_generated_bindings.js:69
Does anyone know what's going on? It used to work a couple of months ago, then I stopped working on this and now it doesn't work anymore.
Thanks
Upvotes: 4
Views: 1811
Reputation: 1746
It seems that the second parameter of chrome.webRequest.onBeforeRequest.addListener (trunk of chrome extensions doc) is no more optional.
Upvotes: 9