[英]How would I monitor all http requests coming from a site [Chrome Extension]
I'm currently writing a chrome extension and require to monitor and get a header from a http POST
request from a site.我目前正在编写一个 chrome 扩展程序,并需要监视并从站点的 http
POST
请求中获取标头。 How would I wait for a request from the site and then save the specified header's argument to a variable for future use?我将如何等待来自站点的请求,然后将指定标头的参数保存到变量中以备将来使用?
I ended up using:我最终使用了:
chrome.webRequest.onSendHeaders.addListener(function (details) {
//my stuff here
}, {
urls: ["<all_urls>"],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
}, ["requestHeaders"]);
along with some code to store the varible i got from details.*
.以及一些代码来存储我从
details.*
获得的变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.