
SlimerJS: a replacement for PhantomJS using recent Firefox - fanf2
https://slimerjs.org/
======
folkhack
At this point you should really be looking into Google's Puppeteer -
[https://github.com/GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer)

One of the most active browser automation libs out there and it's just a pure
joy to use =)

~~~
dmbass
puppeteer only supports Chorme so you will need to use Slimer if you wish to
use Firefox.

~~~
paulirish
Correct for now. However...

Firefox did start investigating supporting the Chrome DevTools Protocol:
[https://groups.google.com/d/topic/mozilla.dev.platform/4-4A8...](https://groups.google.com/d/topic/mozilla.dev.platform/4-4A8W-nP5g/discussion)

We (Chrome DevTools/Puppeteer team) have had detailed discussions with their
DevTools team on this, recommending what subset would enable Puppeteer. I
don't know where they are with this, but in the long-term, this solution looks
most promising.

~~~
folkhack
Firefox/Mozilla has been doing a great job with cross-browser initiatives like
the WebExtension APIs, and dipping their toes into CDP. I am STOKED to hear
you guys have been having cross-team conversations on these details!

Shameless fanboy moment: have followed your stuff for years, and I absolutely
love the products your team(s) put out (CDP/Puppeteer)!

~~~
paulirish
Aww thanks amigo! Thanks v much. Plz holler my way if there's anything we can
do better.

The devtools teams (Chrome, FF, Safari, and Edge) actually talk quite a bit.
We collaborate on the console spec [0] and keep each-other in check on feature
parity. ;)

[0] [https://github.com/whatwg/console](https://github.com/whatwg/console)

------
ravenstine
Glad to see there's an alternative to headless Chrome that's not tied to
Google in any way.

~~~
TAForObvReasons
Without being too cynical, is the fact that Mozilla receives most of their
funding from Google not relevant when considering Google's influence?

~~~
st3fan
Not funding. Revenue.

What influence are you talking about? Can you be more specific?

------
2trill2spill
Does this support FreeBSD? The docs say it's supports anything that can run
Firefox so I would think yes. I can't check cause I'm in a car for the next 6
hours. But if this supports FreeBSD I would definitely use it over puppeteer
because puppeteer does not support FreeBSD and it doesn't really look like
they care to add support [1].

[1]:
[https://github.com/GoogleChrome/puppeteer/issues/1049](https://github.com/GoogleChrome/puppeteer/issues/1049)

------
sebazzz
How does SlimerJS compare to Selenium which is truly cross-browser and the
cornerstone of our internal web automation tests?

~~~
zaarn
Afaict the difference is that slimerjs uses Firefox Headless while Selenium
spins up the entire browser.

For Web Testing spinning up the browser is okay, for some other tasks using
just a headless version can be good enough.

~~~
sebazzz
Selenium can also use headless if you use the MOZ_HEADLESS environment
variable.

------
dchuk
so I have an upcoming side project that will heavily leverage
scraping/screenshotting and I plan to use either headless chrome or slimerjs.
It will be a Rails app, queueing up lots of sidekiq jobs, that I (presumably)
will have calling a headless browser instance, probably running in a
container. Ideally I'll run this either on Heroku or even better, just a DO
droplet running dokku.

I found browserless.io and the supporting github project over the weekend,
looks promising.

Who else is doing this? Is the architecture I just touched on the right way to
go about doing this? Or should I have each sidekiq job spin up its own browser
container for the scraping job?

Also, chrome vs firefox won't really matter in this instance, but
reliability/performance/memory will...any recommendations?

~~~
deedubaya
I built [https://github.com/danielwestendorf/pdf-bot-
pro](https://github.com/danielwestendorf/pdf-bot-pro) a few days ago, a
scalable 1-click heroku deploy rewrite of pdf-bot. It's fully functional,
except I built the background queuing on Faktory, and there is not working
Faktory add-on available for heroku yet (and thus, no real promotion of the
project yet). You could set up a faktory server elsewhere and define the URL
as an ENV var and it would work today.

~~~
dchuk
Nice thanks for the link. So if I'm understanding correctly, your app
essentially runs as a standalone api, receiving pdf requests, queueing them,
processing them, then hitting a specific webhook url on success for other
systems to then query the pdf tool to get the resulting pdf.

This is approximately how I was thinking of settings thing up as well, so
thanks for this!

~~~
deedubaya
Yup, exactly.

------
codedokode
The "simple example" on the front page uses promises which silence all
exceptions by default. Not a good idea. Futhermore, with synchronous
operations the code would be much simpler.

