Chrome extension not working properly, am I doing something wrong?

here is the code i use in my Chrome extension. This is an extension that currently simply intercepts requests and prints them in a popup window.

<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 "check the popup" by right-clicking on the extension icon, I get this error from the console: Uncaught Error: Parameter 1 is required. extensions/schema_generated_bindings.js:69 Uncaught Error: Parameter 1 is required. extensions/schema_generated_bindings.js:69

Does anyone know what is going on? It worked a few months ago, and then I stopped working on it, and now it no longer works.

thanks

+4
source share
1 answer

It seems that the second parameter chrome.webRequest.onBeforeRequest.addListener (connecting line chrome extensions doc) is no longer optional.

+9
source

Source: https://habr.com/ru/post/1389810/


All Articles