Comments (11)
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.
Hey @soulgalore, is this what you are expecting : https://gist.github.com/vroumvroum/cda71d0c4e9efb22ced5eb4d5917b0e2 ?
from chrome-har.
@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.
from chrome-har.
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.
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.
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.
@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.
@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.
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.
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)
- bump tough-cookie dependency to 4.1.3 due to vulnerability HOT 1
- Invalid time value HOT 4
- Problems (i met) in Chrome Extension use HOT 1
- Support WebSocket in HAR HOT 3
- url.parse is deprecated HOT 1
- Early hints requests do not appear in HAR HOT 5
- Network.responseReceivedExtraInfo may be fired before or after responseReceived. HOT 3
- Response set-cookie header didn't align with chrome/firefox exported har HOT 2
- Redirects in main document are not detected as new page (explicit redirect or navigation) HOT 2
- Missing requests in iFrame within iFrame HOT 1
- Information missing from requests and responses HOT 1
- How to include the "_error" in the HAR file? HOT 4
- requestIntercepted deprecated. Support for responseReceived?
- Cached resources does not appear in har HOT 1
- TS types HOT 1
- discrepancies in Har generated from browsertime and Chorme DevTools HOT 1
- HAR file partially generated HOT 9
- possibility to get network without page fire events HOT 1
- How to determine if a request was preloaded ? HOT 6
- bump `debug` dependency version to latest version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-har.