Live data from Hacker News

Firefox 56 supports headless mode on Windows

bugzilla.mozilla.org

11–20 of 88 posts

Re: Firefox 56 supports headless mode on Windows

#11
post #6

Is there a linux headless mode already? Selenium chrome driver headless is pretty much useless in linux because important methods like `send_keys` need X anyway for keyboard mappings or something like that.

There is a bug filed against the chrome driver send_keys issue, and a workaround...one that requires recompiling though.

https://bugs.chromium.org/p/chromedriver/issues/detail?id=17...

Re: Firefox 56 supports headless mode on Windows

#13
post #12

I was wondering if I could use this (using a plugin) or Chrome to generate PDF files on the web server. Most of the PDF generation software out there are quite expensive.

Maybe it's possible with the print option Chrome offers. Regular Chrome can print to PDF files. Maybe headless Chrome supports that.

Edit: It's possible. It's on the introduction page of Chrome Headless

https://developers.google.com/web/updates/2017/04/headless-c...

Look at 'Create a PDF'

Re: Firefox 56 supports headless mode on Windows

#15
post #12

I was wondering if I could use this (using a plugin) or Chrome to generate PDF files on the web server. Most of the PDF generation software out there are quite expensive.

We use wkhtmltopdf to do this server side. It as a few problems and quirks, but it work well enough for us.

Re: Firefox 56 supports headless mode on Windows

#16
post #8

Do you need to use selenium to control Firefox in headless mode or does it have something lower level like Chrome's devtools protocol?

You can use use WebDriver/GeckoDriver[0], which is how Selenium actually runs, but most people like the abstraction layer.

[0] https://github.com/mozilla/geckodriver

Re: Firefox 56 supports headless mode on Windows

#18
post #8

Do you need to use selenium to control Firefox in headless mode or does it have something lower level like Chrome's devtools protocol?

1. You can use the WebDriver protocol[0] without selenium

2. Firefox's WebDriver endpoint geckodriver[1] is a layer above Firefox/Gecko's native Marionette protocol[2]

So you doubly don't need to use selenium, you can write your own WebDriver client (which should be cross-browser assuming the browsers either support WebDriver natively or have a WD layer of some sort installed) or you can use raw Marionette (either a hand-rolled client or an existing client)

[0] https://w3c.github.io/webdriver/webdriver-spec.html#protocol

[1] https://github.com/mozilla/geckodriver

[2] https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionet...

Re: Firefox 56 supports headless mode on Windows

#19
post #15
post #12

I was wondering if I could use this (using a plugin) or Chrome to generate PDF files on the web server. Most of the PDF generation software out there are quite expensive.

We use wkhtmltopdf to do this server side. It as a few problems and quirks, but it work well enough for us.

it has a lot of quirks, and, frankly, webkit is pretty bad at printing in general as it lacks a ton of printing specific features like re-printing table headers across page boundaries.

There's also only very rudimentary support for page headers and footers.

wkhtmktopdf is probably ok if you just need a quick single page invoice printout, but the moment you need more (in our case, we definitely do), I can highly recommend paying for https://www.princexml.com/ which has support for a lot of printing specific features.

Post reply on HN