-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from PhantomJS to Chrome's headless mode #707
Comments
+1 |
+1. Chromium is twice as faster than PhantomJS. |
Let's try what headless Chromium has to offer :) |
Puppeteer's Chromium binary dependencies:
|
I'd like to help you with this project. Could you give me some advice to start with, I was thinking of using yargs to intuitively parse the command. The page object inherits directly from EventEmmiter and a lot of phantomas code is no longer needed. That's the big gap between phantomJS and puppeteer.
|
@AdriwanKenoby, thanks for your interest! I'd definitely like to remove the extra code that was required to make PhantomJS work (and to be able to run SlimerJS as an engine as well) and be able to talk to Node.js layer ( |
Guys, It's been a while since the last activity in this thread. I want to give phantomas a new kick and refactor it to be more modular and use Puppeteer (headless Chromium) instead of PhantomJS (rest in peace, you've served us well!). Here's my list of ideas, directions, notes:
Some basic work has started here - https://gist.github.com/macbre/fded35f86893bace033e3790079bee76#file-script-js @gmetais - your feedback on what will make your life with YellowLabTools easier are more than welcome here :) |
This is great news! (and it could lead to a v2.0 on YLT too!) One thing that would be great is switching offenders to a JSON format instead of a string. Which means that the CLI reporter will need to do the reverse job to display a string again. Or a string version of the offender could be kept in a JSON key. I also consider removing from YLT the "Timeline" part, so YLT will stop spying the various jQuery functions. A JavaScript complexity index would still be cool, but a lighter one. Maybe Puppeteer gives access to the Chrome Timeline? Anyway, that's not a priority at all. How can I help right now? |
https://travis-ci.org/macbre/phantomas/jobs/473573512 - phantomas can now talk with Puppeteer's Chrome. And some tests do pass :) Within a next week or two, all core modules should work as expected. Next step will be testing the npm module against various sites to find incompatibilities between PhantomJS and Chrome. @gmetais, this will be something that you can help with. And thanks!
|
Surely I will. |
Work in progress update:
|
Progress update:
|
Tests status so far: ✗ Broken » 254 honored ∙ 28 broken (13.168s) |
More progress :) ✗ Broken » 272 honored ∙ 19 broken (42.727s) |
Now it's time to integrate |
|
118ce1b made all remaining tests pass :)
|
966ae00 - TravisCI checks are green again 😃 |
|
Documentation is now automatically generate from metadata JSON file that is built by parsing the code comments / annotations. @gmetais - I hope that these resources will make developing on top of |
Hi @macbre, Should I add my comments about v2 to this post or create a new issue each time? |
I see you count brotli compressed files as gzipped (here: https://github.com/macbre/phantomas/blob/phantomas-v2/core/modules/requestsMonitor/requestsMonitor.js#L256) For clarity, shouldn't Phantomas separate gzipRequests and brotliRequests and maybe add a new compressedRequests? |
Watch up here: https://github.com/macbre/phantomas/blob/phantomas-v2/core/modules/requestsMonitor/requestsMonitor.js#L303 When a request is answered as a redirect, entry.transferedSize is -1. So incrementing the contentLength metric actually decreases it it by 1. Not a big deal, though! What I find strange is that entry.responseSize is -1 too. The body size is zero, right, but headers are not. |
#753 has been merged and the first 2.0.0 npm pre-release package released. |
PhantomJS 2.5 may never reach the stable state (GitHub milestone shows that it's 27% complete). Chrome has obviously more stable development team 😉 and leads the improve the web initiative - webp and spdy/http2 to name just a few.
Let's consider porting phantomas (and rename it to
chromas
? 😄 ) to use Chrome (and Firefox) run in a headless mode for performance auditing / monitoring.Resources
Libraries
https://github.com/adieuadieu/node-headless-chrome (work in progress, Windows support is missing)Puppeteer troubleshooting
Initial work
Is being done in this gist - https://gist.github.com/macbre/fded35f86893bace033e3790079bee76
The text was updated successfully, but these errors were encountered: