[英]Chrome extension chrome.webRequest API - Some http request headers not coming in request headers
I was working on chrome extension with motive of intercepting all HTTP(S) requests/responses and log all headers into persistent file (on disk). 我正在进行chrome扩展,目的是拦截所有HTTP(S)请求/响应并将所有标头记录到持久文件(在磁盘上)中。 I was almost close to my goal.
我快要实现目标了。 But when I looked some requests closely, I found that in many requests "
If-None-Match
" and " If-Modified-Since
" are missing in requestHeaders
. 但是,当我仔细查看一些请求时,发现在很多请求中,
requestHeaders
都缺少“ If-None-Match
”和“ If-Modified-Since
”。 Though, I can see them in Network panel displayed by the Developer Tools. 不过,我可以在开发人员工具显示的“网络”面板中看到它们。
I tried hard to figure out any patterns, causing such behavior. 我尽力找出可能导致这种现象的任何模式。 But, unfortunately there is no such pattern.
但是,不幸的是,没有这种模式。
Anybody please help. 有人请帮忙。
The receive the list of requestHeader is necessary to use the onBeforeSendHeaders
event from chrome.webRequest API . 要使用chrome.webRequest API中的
onBeforeSendHeaders
事件,必须接收requestHeader列表。
In the onBeforeSendHeaders
description is mentioned that some headers are not available for reading/processing: 在
onBeforeSendHeaders
描述中提到某些标头不可用于读取/处理:
I'm afraid you will not be able to read or modify these headers, because it's an API forced limitation. 恐怕您将无法读取或修改这些标头,因为这是API的强制限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.