Live data from Hacker News

PhantomJS: Archiving the project, suspending development

github.com

131–138 of 138 posts

Re: PhantomJS: Archiving the project, suspending development

#131
post #101

Earlier quoted context omitted.

Sadly, Chrome won't support extensions: https://bugs.chromium.org/p/chromium/issues/detail?id=706008

but... i think you can attach it to an existing chrome with remote debugging enabled, so not that big a deal!

Sure can, I've done it with puppeteer. Just can't enable headless.

Re: PhantomJS: Archiving the project, suspending development

#132
post #80

Earlier quoted context omitted.

You could use a parser like esprima or its equivalent from the babeljs ecosystem on the JS source instead and just find the global variable with name `__STATE__` and just eval its init expression. Cheaper, more secure, more direct than actually running the JS.

I actually looked into this (from reading docs, never wrote code) and I wasn't able to find a way to convert the AST for the ObjectExpression into JSON or an actual Javascript object.

What you need is a code generation library that will turn the AST back into JS code once you've identified which part of the syntax tree you're interested in. And that's the code you want to then eval(). Esprima has escodegen for that purpose. I'm not sure what the counterparts are in the babel world. Feel free to shoot me an email with any specifics of where you're getting stuck thinking this through (email should be visible from my profile?), and I'll be glad to help.

Re: PhantomJS: Archiving the project, suspending development

#133

Earlier quoted context omitted.

Exactly. I mean look at his commits. Look at this file: https://github.com/ariya/phantomjs/blob/master/package.json (He created a commit only to add his how name as a contributor to package.json, which is the only name in package.json). How did his changes even make it to the repo. There are commits adding and deleting whitespace with the disguised commit message of "Refactoring Code". I have no doubt on why ariya co…

Some of his commits surely don't even compile. This one takes the leading # characters off of preprocessor directives: https://github.com/ariya/phantomjs/commit/52e4849a36c68b15c6...

This is why every open source project needs a basic CircleCi.

Re: PhantomJS: Archiving the project, suspending development

#134

Some people are mentioning headless Chromium, so I wanna mention another tool I've used to replace some of phantomjs' functionality: jsdom [0]. It's much more lightweight than a real browser, and it doesn't require large extra binaries. I don't do any complex scrapping, but occasionally I want to pull down and aggregate a site's data. For most pages, it's as simple as making a request and passing the response into a…

jsdom is pretty unforgiving and won't load broken HTML. That's where I stopped using it. Could use some tidy tool maybe.

Re: PhantomJS: Archiving the project, suspending development

#135

There is one thing about this that saddens me: PhantomJS still starts up much faster than headless Firefox or Chrome, at least for me, which makes some of our integration tests take a long longer than they should. Has anyone here figured out any tricks to get headless Chrome booted fast?

Running it as a pooled web server via generic-pool makes it run a bit more efficiently. Using the pooling method, it can do 512x512 images every 400 ms, add in Optimize, WebP & S3 for a total 1000 ms.

I based the pool off of https://github.com/latesh/puppeteer-pool/blob/master/src/ind... .

Re: PhantomJS: Archiving the project, suspending development

#136
post #97

Earlier quoted context omitted.

He committed: - Removing one whitespace and adding an unnecessary file https://github.com/ariya/phantomjs/commit/98272b9752b2d505f7... - Conflicted files https://github.com/ariya/phantomjs/commit/63a69d9e2e9c31baab... - Personal build env https://github.com/ariya/phantomjs/commit/d57ff74f36c5b79d82... - Deleted the whole project while changing cloud provider https://github.com/ariya/phantomjs/commit/a242fb8d605d9aa4a…

Now, he shows up at number 4 in the Github contributor list ( https://github.com/ariya/phantomjs/graphs/contributors ) with 179,603 lines added, not a single one of which seems to be a meaningful contribution by him. Are such incidences common in other open source software too, or does this one seem a rare case?

I doubt it, but the line count / commit frequency heuristics really shouldn't be taken too seriously anyways

Re: PhantomJS: Archiving the project, suspending development

#137

There is one thing about this that saddens me: PhantomJS still starts up much faster than headless Firefox or Chrome, at least for me, which makes some of our integration tests take a long longer than they should. Has anyone here figured out any tricks to get headless Chrome booted fast?

this is one of the reasons i created chromedriver-proxy[0]

[0] https://github.com/ZipRecruiter/chromedriver-proxy

Re: PhantomJS: Archiving the project, suspending development

#138

For those who haven't looked at some of the commits by @pixiuPL, the list is here : https://github.com/ariya/phantomjs/commits?author=pixiuPL . To summarize: It does not look like the guy has done a single commit with any meaning. His commits are basically the following: 1. Adding his own name in package.json 2. Adding and deleting whitespace. 3. Deleting the entire project and commiting. 4. Adding the entire project…

Sounds like you're getting ideas.
Post reply on HN