0

I am trying to build a chrome extension. An important part of the extension is to find out how large the request/response body of network requests is (this should include http request from video streams).

I am not sure what i am doing wrong but some solutions i tried either dont have the response body or the response header "Content-size" value does not correspond with the actual size of the asset.

Currently this is a snippet of my code

var requestFilter ={
    urls:[
        "<all_urls>"
    ]
};

let extraInfoSec=[
    "responseHeaders"
]

chrome.webRequest.onCompleted.addListener(function (request) {
    console.log(request, "WEB REQUEST")
},requestFilter,extraInfoSec)

i was hoping i could get the size of every request/response happening on the page, i don't care about the response content

Nefertem
  • 1
  • 3
  • The name of the header is Content-Length not size, but anyway it doesn't have to be present or correct, so you'll need to measure the actual response, see [Chrome extension to read HTTP response](https://stackoverflow.com/q/8939467) and [Chrome Extension - How to get HTTP Response Body?](https://stackoverflow.com/q/18534771) – wOxxOm Aug 07 '23 at 05:29

0 Answers0