Chrome扩展程序读取HTTP响应 [英] Chrome extension to read HTTP response
问题描述
我有这个Chrome扩展程序在发送请求之前修改了请求的标题。我现在希望能够在相同的扩展名中检查响应的标题。我在整个Chrome扩展API中进行了搜索,但找不到任何有趣的东西。
这是我用来修改请求头的代码,可能对于你知道我是怎么做的。
chrome.webRequest.onBeforeSendHeaders.addListener(
function(details){/ *做些什么* /},
{url:[< all_urls>]},
[blocking,requestHeaders]);
有谁知道怎么做,或者可以将我指向一个有趣的源代码?谢谢
请参阅live-headers示例。 href =http://code.google.com/chrome/extensions/examples/api/debugger/live-headers.zip =nofollow> http://code.google.com/chrome/extensions/examples /api/debugger/live-headers.zip
I have this Chrome extension that modifies the header of requests before sending them. I now would like to be able, within the same extension, to check the header of the response. I searched throughout the Chrome Extension APIs but I couldn't find anything of interest.
This is the code I use for modifying the header of the request, maybe it's useful for you to know how I do it.
chrome.webRequest.onBeforeSendHeaders.addListener(
function(details) {/*do something*/},
{urls: ["<all_urls>"]},
["blocking", "requestHeaders"]);
Does anyone knows how to do that, or can point me to an interesting source? Thanks
See the live-headers example.
http://code.google.com/chrome/extensions/examples/api/debugger/live-headers.zip
这篇关于Chrome扩展程序读取HTTP响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!