screenshot-stream icon indicating copy to clipboard operation
screenshot-stream copied to clipboard

Replace PhantomJS with Puppeteer

Open kevva opened this issue 6 years ago • 12 comments

Probably still needs some work:

  • [ ] Make sure we handle errors
  • [x] Add script option
  • [ ] Add style option
  • [ ] Add some sort of hook that exposes page from puppeteer to users
  • [ ] Add keepAlive option with a .close method on the returned promise that lets users kill it manually (good when capturing many pages).
  • [ ] Code improvements?

kevva avatar Sep 24 '17 18:09 kevva

@kevva What do you think about targeting Node.js 8? So we can use async/await. Would be so much nicer. It's going to be a major release anyway. I plan to do that in the next major of Pageres.

sindresorhus avatar Sep 24 '17 18:09 sindresorhus

@kevva What do you think about targeting Node.js 8? So we can use async/await. Would be so much nicer. It's going to be a major release anyway. I plan to do that in the next major of Pageres.

👍 I agree. And it would be pretty future proof for a foreseeable future.

kevva avatar Sep 24 '17 18:09 kevva

I'm super excited we can finally get rid of PhantomJS! 🙌

sindresorhus avatar Sep 24 '17 18:09 sindresorhus

Now uses async/await. Some tests are still failing though.

kevva avatar Sep 24 '17 21:09 kevva

By the way, should we consider renaming this to screenshot instead of screenshot-stream, it's not a stream anymore :p.

SamVerschueren avatar Sep 28 '17 05:09 SamVerschueren

By the way, should we consider renaming this to screenshot instead of screenshot-stream, it's not a stream anymore :p.

If we can get the name, yes. But it hasn't been updated in five years so shouldn't be impossible.

kevva avatar Oct 03 '17 20:10 kevva

Added a PR to Puppeteer to make injecting js and css much easier. https://github.com/GoogleChrome/puppeteer/pull/996

SamVerschueren avatar Oct 11 '17 17:10 SamVerschueren

What's left to do here?

sindresorhus avatar Mar 05 '18 20:03 sindresorhus

Probably some small things to edge out. I'll take a look in the weekend.

kevva avatar Mar 09 '18 14:03 kevva

Any news on this? I'd rather not have to fork to get around some PhantomJS wonkiness.

c0bra avatar Apr 30 '18 13:04 c0bra

I can help with this if needed!

cluk3 avatar Oct 28 '18 11:10 cluk3

@cluk3 Help is most welcome. Open a PR based on this one. I'll review ;)

sindresorhus avatar Oct 28 '18 11:10 sindresorhus