Skip to content
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

Headless Chrome #40

Open
kevva opened this issue May 19, 2017 · 11 comments
Open

Headless Chrome #40

kevva opened this issue May 19, 2017 · 11 comments

Comments

@kevva
Copy link
Owner

kevva commented May 19, 2017

Just need to create a bin-wrapper for it. Also, not sure if a streaming interface is available using https://github.com/cyrus-and/chrome-remote-interface. Worst case scenario is that we skip the streams altogether and just return a Promise or if we want to keep them, possibly just emit a data event with the buffer.

@sindresorhus
Copy link
Contributor

sindresorhus commented May 19, 2017

The only reason we're using streams today is to improve performance, as we have to decode a huge Base64 string. If using a Promise is possible, I would much prefer that.

@SamVerschueren
Copy link
Collaborator

Just need to create a bin-wrapper for it

I tried doing that two weeks ago but gave up. I couldn't find a version of Chrome that's just one binary that we can ship. Instead I tried doing it with the full blown Chrome from my computer which is like 160 MB or something. So if you guys can point me in the right direction, happy to create the wrapper.

@sindresorhus
Copy link
Contributor

Also, is this really something we want to maintain? For reference: https://github.com/Medium/phantomjs/issues?utf8=%E2%9C%93&q= (Note the issue count)

@sindresorhus
Copy link
Contributor

I was hoping I could just ignore Chrome Headless until someone did a bin wrapper, so I don't have to maintain it.

@SamVerschueren
Copy link
Collaborator

I was hoping I could just ignore Chrome Headless until someone did a bin wrapper, so I don't have to maintain it.

I'm afraid that if no one of us does it, nobody will do it :p. Maintaining a bin-wrapper doesn't feel as complex as maintaining PhantomJS, or am I missing something? It's just a binary, right?

@kevva
Copy link
Owner Author

kevva commented May 19, 2017

Well, I had a look at it yesterday and it doesn't seem too complex tbh. I'd just get the latest revision from here https://chromium.woolyss.com/#api and then fetch the binary. There is some logic in here that we could make us of https://github.com/scheib/chromium-latest-linux/blob/master/update.sh.

Note that I haven't actually tried it out so the files from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html might not work out of the box.

@kevva
Copy link
Owner Author

kevva commented May 19, 2017

The only reason we're using streams today is to improve performance, as we have to decode a huge Base64 string. If using a Promise is possible, I would much prefer that.

It still returns a Base64 string https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot.

@silverwind
Copy link

puppeteer might be worth checking out.

@SamVerschueren
Copy link
Collaborator

Only works on Node 7.10+ for now though. But looks really nice.

@silverwind
Copy link

Yeah. It has no streaming API that I see, but we should evaluate if we can require Node.js 8, and possibly rename this package or create a new one with a more fitting name.

@c0bra
Copy link

c0bra commented Mar 28, 2018

@SamVerschueren the readme for puppeteer now reads:

Puppeteer requires at least Node v6.4.0,

What are the chances of getting this thing rolling again? Not sure that I would be successful at a PR but I might be able to take a stab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants