gpt4 book ai didi

javascript - 本地文件未触发 webRequest.onHeadersReceived

转载 作者:行者123 更新时间:2023-12-02 14:59:12 25 4
gpt4 key购买 nike

使用此代码片段时,它应该在加载 file://.. 时记录 header url 也是如此,但它只适用于 http(s) 请求。

  chrome.webRequest.onHeadersReceived.addListener((info) => {
console.log(info);
}, {
urls: ['<all_urls>']
}, ['responseHeaders']);

在你问之前,我使用 <all_urls>manifest.json权限,如果我通过基本 content_scripts 执行此操作,它就可以工作API。

我应该提交 chrome 问题还是我的代码有问题?

最佳答案

来自the docs :

Note that for some of the supported schemes the set of available events might be limited due to the nature of the corresponding protocol. For example, for the "file:" scheme, only onBeforeRequest, onResponseStarted, onCompleted, and onErrorOccurred may be dispatched.

关于javascript - 本地文件未触发 webRequest.onHeadersReceived,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35566567/

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