javascript - Chrome extension not working properly, am I doing something wrong? - Stack Overflow

here is the code I use in my Chrome extension. It's an extension that for now just intercepts the

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

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

Share Improve this question asked Jan 7, 2012 at 14:43 MasiarMasiar 21.4k31 gold badges100 silver badges140 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

It seems that the second parameter of chrome.webRequest.onBeforeRequest.addListener (trunk of chrome extensions doc) is no more optional.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745553273a4632675.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信