Live data from Hacker News

Prototype: Puppeteer for Firefox

github.com

81–90 of 133 posts

Re: Prototype: Puppeteer for Firefox

#81

In case you're wondering, and the linked page doesn't explain: > Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium. https://developers.google.com/web/tools/puppeteer/

Thank you. This industry has a huge failure mode in touting tech used in projects/frameworks without linking out to at least the source so that someone can learn about them. Can't tell you how many things I've bailed on because it was a pile of obscure library references that weren't (to me) worth looking up.

Re: Prototype: Puppeteer for Firefox

#82
post #17

Earlier quoted context omitted.

Much better access to low-level information. You can hook (and mock) requests, see what POST data was sent and basically do lots of magic. Also, my experience with Selenium under Python is that doing anything bigger quickly turns into one giant timing hack.

Does puppeteer work with Safari and MS browsers or is it another Chrome only tool (and now Firefox)?

It's yet another Chrome only tool.

Re: Prototype: Puppeteer for Firefox

#83

Earlier quoted context omitted.

Selenium / WebDriver has a HTTP API so you can have clients in any language, not just in Java

It would be awesome to have Puppeteer support Python... then I'd drop Selenium from my toolbox.

My company is using https://github.com/miyakogi/pyppeteer in production and it has worked great. I suggest checking it out.

Re: Prototype: Puppeteer for Firefox

#84
post #15

For automated testing, why Puppeteer instead of Selenium?

I'm using puppeteer at work to dump dom changes, console logs, network requests, css and images to create a test bundle that can be replayed with a test bundle viewer (ie. move the slider to move the browser view of the test through the changes). Puppeteer is powerful enough to let that happen! And overall Puppeteer has caused us less headaches than Selenium

Re: Prototype: Puppeteer for Firefox

#85

Earlier quoted context omitted.

I have never heard of TestCafe, but I've used Puppeteer for a variety of projects with Chrome. My latest one was using it to convert HTML files into PDFs en masse.

Is there an advantage to that approach over the more direct wkhtmltopdf?

This approach, for us, proved fastest when we scaled it using Kubernetes compared to the others we tried.

Re: Prototype: Puppeteer for Firefox

#88
post #53
post #15

For automated testing, why Puppeteer instead of Selenium?

Just download both and try doing the same test suite. See which one hurts the least. I'm 99% sure Puppeteer will feel like a breath of fresh air to you. CasperJS was OK, even better with Nightwatch but Puppeteer is quicker, more stable and actively developed.

That was what I found, as well, for my PhotoStructure tests. It's great to have them driven by gitlab's ci and have cross-platform tests run automatically, and it will be great to now have them run cross-browser, as well.

Re: Prototype: Puppeteer for Firefox

#89
post #81

In case you're wondering, and the linked page doesn't explain: > Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium. https://developers.google.com/web/tools/puppeteer/

Thank you. This industry has a huge failure mode in touting tech used in projects/frameworks without linking out to at least the source so that someone can learn about them. Can't tell you how many things I've bailed on because it was a pile of obscure library references that weren't (to me) worth looking up.

Indeed, there is a skill when doing technical writing of putting yourself in the position of a reader, particularly one who is competent but who doesn't already know the thing that you are trying to explain, or the context. It's not as common as it should be.

Re: Prototype: Puppeteer for Firefox

#90
Huh. I worked on exactly this idea as a Mozilla intern in 2017. I wrote a collection of Rust crates (mentioned in [0]) comprising auto-generated types for all Chrome DevTools Protocol messages [1], (de)serialization, and a server lib to handle both the initial HTTP handshake and subsequent command execution over WebSockets. I used that to build out an initial CDP server inside Firefox (and Servo) with support for a couple of sample commands.

At the end of the internship I handed over everything I'd built by that point, with the idea that they (Mozilla) would turn it into a finished project. But I never saw any activity on that front after I left, so I assumed the idea'd been scrapped. Feels very weird seeing this pop up out of the blue on HN today.

[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1523104#c1

[1] Complete with documentation comment generation; I found the result of running rustdoc over that crate super useful as an alternative to the official CDP docs site: https://www.spinda.net/files/mozilla/rust-cdp/doc/cdp/index....

Post reply on HN