“No matching signature” error on adding a chrome.webRequest listener

前端 未结 1 1125
一向
一向 2021-01-04 13:26

I have this code:

chrome.webRequest.onCompleted.addListener(function(details){
  console.log(details);
});

I\'m trying to understand and us

相关标签:
1条回答
  • 2021-01-04 14:20

    "No matching signature" means you're passing the wrong parameters. As you can see in the documentation's concepts and examples you need to specify at least two parameters. The documentation for individual methods doesn't mention that which is really confusing, and you can report it on https://crbug.com.

    chrome.webRequest.onCompleted.addListener(
      function(details) {
        console.log(details);
      },
      {urls: ["<all_urls>"]}
    );
    

    To view the background script's console see this answer.

    0 讨论(0)
提交回复
热议问题