Git Product home page Git Product logo

Comments (11)

soulgalore avatar soulgalore commented on September 7, 2024

Hey @vroumvroum hmm I got the same in Chrome 66 and did this fix for that: #12

I wonder if it has changed in 67 too? Can you provide the full trace log in a gist, then I can have a look and see what's going on.

Best
Peter

from chrome-har.

vroumvroum avatar vroumvroum commented on September 7, 2024

Hey @soulgalore, is this what you are expecting : https://gist.github.com/vroumvroum/cda71d0c4e9efb22ced5eb4d5917b0e2 ?

from chrome-har.

soulgalore avatar soulgalore commented on September 7, 2024

@vroumvroum yep almost, anyway you could skip the puppeteer log and get the raw one? We got a couple of fixed coming up the coming days but the more logs that breaks, the better so we are sure we fix it.

from chrome-har.

vroumvroum avatar vroumvroum commented on September 7, 2024

from chrome-har.

soulgalore avatar soulgalore commented on September 7, 2024

Ah I see. In the example: https://michaljanaszek.com/blog/generate-har-with-puppeteer

// convert events to HAR file
  const har = harFromMessages(events);
  await promisify(fs.writeFile)('en.wikipedia.org.har', JSON.stringify(har));

Skip the conversion and store the raw events to disk, something like:

  await promisify(fs.writeFile)('en.wikipedia.org.json', JSON.stringify(events));

from chrome-har.

tobli avatar tobli commented on September 7, 2024

It would also be helpful if you could enable debug logging in chrome-har. Just set the environment variable DEBUG=chrome-har before running.

from chrome-har.

suever avatar suever commented on September 7, 2024

It's worth noting that the blog post linked to by the OP doesn't include the Page.frameScheduledNavigation event which is being handled as of #12

from chrome-har.

vroumvroum avatar vroumvroum commented on September 7, 2024

@soulgalore : here is the raw output of the events : https://gist.github.com/vroumvroum/3106072293a061040d498839e212dc42

@tobli : tried to generate har with DEBUG=chrome-har (output was empty)

@suever : I did tried to add Page.frameScheduledNavigation in the list of the events beforehand and it changed nothing ...

from chrome-har.

vroumvroum avatar vroumvroum commented on September 7, 2024

@soulgalore : if it is of any help, here is the raw events with Page.frameScheduledNavigation added on the observers list : https://gist.github.com/vroumvroum/fcb9200953e499e988819cbec3ee226d

from chrome-har.

tobli avatar tobli commented on September 7, 2024

Hi @vroumvroum!
It think your method of extracting Chrome DevTools Protocol events via Puppeteer isn't 100% at the moment. Events seem to be written out of order, which makes chrome-har not work. Comparing to the perflog dump that Browsertime generates (see https://gist.github.com/tobli/3d76c24911a6ab073fe5e6916d173c7b) you see that Network events (such as Network.requestWillBeSent) are printed before Page events (such as Page.frameStartedLoading) in your example.

It would likely be possible for the HAR building algorithm to work independently of event order, but it would require some non-trivial restructuring. If you'd like to dig into that we're definitely open to PRs. I'm closing this issue now, but you could open a new issue for discussing approaches to making the algorithm more "Puppeteer friendly". =)

from chrome-har.

vroumvroum avatar vroumvroum commented on September 7, 2024

Hi @tobli, @soulgalore : thanks for your help !
I will inform the author of this code.
For information, puppeter-har module (https://www.npmjs.com/package/puppeteer-har) is also based on the same code.

from chrome-har.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.