Live data from Hacker News

Firefox 56 supports headless mode on Windows

bugzilla.mozilla.org

61–70 of 88 posts

Re: Firefox 56 supports headless mode on Windows

#61
post #44

Earlier quoted context omitted.

Latex is free.

Really not the same thing (e.g. pandoc for html -> pdf via LaTeX) as having a webkit based renderer. They do not look the same at all; sometimes it is good to have a LaTeX output but most of the time you are going to want a more accurate representation of your HTML.

That is true. TeX is a typesetting engine, and allows you exact control over the final rendering, while HTML is a markup language, the rendering of which depends on very many factors.

Re: Firefox 56 supports headless mode on Windows

#62
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?

Patch author here: To add to the other comments, you could also use SlimerJS[1]. Though I don't know if I'd consider that lower level. We're open to supporting other ways of controlling FIrefox and have been gauging feedback on what to support.

[1]https://slimerjs.org/

Re: Firefox 56 supports headless mode on Windows

#63

What are the biggest challenges when implementing headless mode? I'm asking cause this feature took some time to be delivered both in Firefox and Chrome and I always assumed that it should be 'pretty' straightforward to implement. Is it that both engines were coupled with GUI libs?

There are a bunch of things which are tied to native GUI libs in ways that make headless a little annoying to implement. Some examples, from memory and looking at the patches/dependencies in the Firefox bugs on this:

1) Theming of form controls to make them look like native widgets.

2) Clipboard.

3) Printing.

4) Fonts and font rendering.

5) General "now it's time to repaint" machinery.

This is in no way an exhaustive list. In practice what you have to do for headless is create the relevant GUI bits anyway, but not actually show them on screen, then deal with whatever quirks your GUI library has when its bits are not shown.

Re: Firefox 56 supports headless mode on Windows

#64
post #36

It's not very clear how to actually use this in a test environment like Selenium etc. At least with headless Chrome there are libraries now to drive it via the remote debug protocol like https://github.com/LucianoGanga/simple-headless-chrome This feels a little nicer than Selenium as it's one less layer of abstraction. EDIT: guess from other comments WebDriver is the right method to access.

FWIW, from the Chome side, we think there's more power via the protocol rather than WebDriver.

Re: Firefox 56 supports headless mode on Windows

#66

Earlier quoted context omitted.

Genuine noob question: could you not use Xvfb?

you can, and it worked, prior to availability of headless options(Phantom sucks). However xvfb is yet another dependency that could cause breakage.

It also takes a bit longer to start up IIRC, but xvfb + chrome driver on Jenkins definitely works for running tests.

Re: Firefox 56 supports headless mode on Windows

#67
Firefox 55 introduced major changes in the process model. My scrolling on the Mac is slow and not smooth. Others have reported the same. Maybe focusing on stabilizing this big change over one or two releases would be a good thing?

Of course headless is also needed as the PhantomJS solution is not maintained anymore since April. See discussion here: https://news.ycombinator.com/item?id=14105489

Re: Firefox 56 supports headless mode on Windows

#68
I just finished writing an article that explains how to connect WebDriver to Firefox running in the new headless mode on Windows if anybody's interested: https://intoli.com/blog/running-selenium-with-headless-firef...

It should be pretty similar on Linux, and probably macOS when it comes around.

Re: Firefox 56 supports headless mode on Windows

#69
post #32
post #22

"headless" Poke me when there are no X11/Qt/GTK/whatever dependencies at all - that is headless. https://packages.debian.org/stretch/firefox-esr

Upvote the bug! https://bugzilla.mozilla.org/show_bug.cgi?id=1372998 I doubt it'll happen anytime too soon, but Mozilla should see the community interest.

As minor counterpoint: Firefox is not strictly speaking developed "by Mozilla" but by the community. Mozilla's the curator, and has a fair bit of staff also working on it, but vast swathes of the codebase are community contributions. If you need FF to do a thing, and you think you have good enough ideas to contribute the solution there, then rather than upvoting a bug, or bumping it to ask what's happening, be the person to make the happening happen =)

Re: Firefox 56 supports headless mode on Windows

#70
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.

Genuine noob question: could you not use Xvfb?

You could also install X server and run tests with an entire graphical stack. But if you don't have to....
Post reply on HN