sitespeedio / chrome-har

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

pageTimings empty #64

Open amezioud opened 4 years ago

amezioud commented 4 years ago

Hello,

I'm using puppeteer@2.1.1 puppeteer-har@1.1.2 and chrome-har@0.11.7

const puppeteer = require('puppeteer'); const PuppeteerHar = require('puppeteer-har');

(async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); console.log("create page");

const har = new PuppeteerHar(page); await har.start({ path: 'results.har' }); console.log('Har started');

await page.goto('https://********/portail');

await har.stop(); await browser.close(); })();

How can I stop having empty "pageTimings" please ?

{"log":{"version":"1.2","creator":{"name":"chrome-har","version":"0.11.7","comment":"https://github.com/sitespeedio/chrome-har"},"pages":[{"id":"page_1","startedDateTime":"2020-04-29T14:00:06.681Z","title":"https://********/portail","**pageTimings":{}**}],"entries":[{"cache":{},"startedDateTime":"2020-04-29T14:00:06.682Z","_requestId":"5380B4DD08F8636FEB1F2EC3A5914CE6","_initialPriority":"VeryHigh","_priority":"VeryHigh","pageref":"page_1","request":{"method":"GET","url":

soulgalore commented 4 years ago

Hi @amezioud at the moment we don't add them from the trace, in Browsertime we add it later after the HARs been generated, so I guess you could do the same, run some JS in puppeteer and get the data from the browser and add it to the HAR.

amezioud commented 4 years ago

Do you have an example please ?

Thanks a lot !