gpt4 book ai didi

javascript - Chrome 扩展 onResponseStarted

转载 作者:行者123 更新时间:2023-11-30 16:27:19 24 4
gpt4 key购买 nike

我正在尝试捕捉 onResponseStarted 事件。但我收到此错误: Uncaught Error :需要参数 1(过滤器)。

当我在 documentation 中查找时我真的看不出我做错了什么。

onResponseStarted

Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.

addListener

chrome.webRequest.onResponseStarted.addListener(function callback)

这是我的代码:

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

最佳答案

您必须提供 filteroptions也是。

尝试这样做:

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

关于javascript - Chrome 扩展 onResponseStarted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33911272/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com