Phantomas npm module returning 0ms domComplete
See original GitHub issueThanks for making this awesome tool! I used it for a new project (perfwars.com), and after launching it I realized that a lot of urls return 0ms domComplete, which I had to code a special case and error out for.
in node I’m using these flags with phantomas version 1.12.0 on ubuntu:
phantomas(url, {'timeout':30, 'modules': 'windowPerformance', 'stop-at-onload': true}, function(err, json, results) {}
Here’s an example of a url (sas.com) that returns 0ms domComplete about 80% of the time, captured in the console from the node app in debug mode (via DEBUG=phantomas* npm start):
As you can see, it returns no errors, yet 0ms domComplete.
After some experimentation, I realized that what was causing this was the “stop-at-onload”: true flag…with that set sometimes onload fires before domComplete (which I would think is the indicator for onload).
Might be a bug, might not, but figured I’d let you know.
UPDATE: After testing more (this time with nytimes.com), even without the stop-at-onload flag, I still get a mix of 0ms domComplete and error code 252
I can also verify the bug when running it straight in the command line:
phantomas http://nytimes.com --reporter=json --modules=windowPerformance
UPDATE2 Here’s some more urls that fail:
apicastor.com app.wlppr.co http://ft.com http://buzzfeed.com http://huffingtonpost.com http://walmart.com
Thanks again! Cory
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (12 by maintainers)
Top GitHub Comments
First off, awesome tool. Starting to work on a project and am integrating this into the toolset. I ran it on a schedule once every 60 seconds for a minute hitting the same URL each time and sending the data to a data warehouse we have onsite for reporting. Of those 60 runs two of them resulted in
domComplete
to report as 0. So it’s happening for me as well. Two in 60 isn’t major but any fix in progress is appreciated!Just wanted to report back after installing 1.14…this version seems to have significantly reduced the problem. About 90% of the sites that were reporting 0ms DomComplete now work properly. Thank you!