sitespeedio / chrome-har

Create HAR files from Chrome Debugging Protocol data
MIT License
149 stars 50 forks source link

Make response.content.text full value available #58

Closed porteron closed 4 years ago

porteron commented 4 years ago

Currently in the outputted HAR, the response.content object does not include the actual content, which is how the HAR typically looks when exported from the browser. Instead there is a compression value and no text value. Is there a way to enable this or implement in the code?

                "response": {
                    "httpVersion": "h2",
                    "redirectURL": "",
                    "status": 200,
                    "statusText": "",
                    "content": {
                        "mimeType": "text/html",
                        "size": 1135094,
                        "compression": 979339
                    },
soulgalore commented 4 years ago

Hi @mnoster how do you create the HAR? If you use Browsertime you can enable it with:

 --chrome.includeResponseBodies   Include response bodies in the HAR file. [choices: "none", "all", "html"] [default: "none"

Best Peter

porteron commented 4 years ago

@soulgalore I am using puppeteer to launch headless chrome. I am going to try passing the --chrome.includeResponseBodies in the launch function.

    const browser = await puppeteer.launch({
        args: [
            '--incognito',
            '--window-size=1920x1080',
            '--start-fullscreen',
            '--chrome.includeResponseBodies',
        ],
    });
porteron commented 4 years ago

@soulgalore Is there anyway to enable it with just chrome-har? The above flag does not do anything in puppeteer launch.

soulgalore commented 4 years ago

No that is if you run https://github.com/sitespeedio/browsertime.

If you try the instructions in the README does that work? https://github.com/sitespeedio/chrome-har#support-for-response-bodies