Live data from Hacker News

Headless mode in Firefox

developer.mozilla.org

101–110 of 191 posts

Re: Headless mode in Firefox

#101

Can someone do an ELI5 on why headless browsers are useful? I've use them before to make screenshots of webpages, and I have noticed that many NPM packages come (or came) with PhantomJS as a dependency, but I have no idea why one would need that.

Where I work (https://phantombuster.com) we use them for scraping the web.

They're a hassle-free way of getting the data. No need to worry about CORS, sessions, cookies, CSRF and other modern web stuff. Just simulate a human and you’re in.

Re: Headless mode in Firefox

#102

This is very nice. What's the recommended way to run end-to-end tests in headless firefox _and_ headless chrome? Can't wait for a cross-platform headless Edge :-)

We're developing a library[1] for this use-case. The goal is to have the same simple API for multiple browsers. Right now it supports both Headless Chrome and PhantomJS.

We think we'll begin work on Firefox headless soon. PRs welcome :)

[1] https://github.com/phantombuster/nickjs

Re: Headless mode in Firefox

#103

Perhaps I'm spoiled, but I'm wondering why this wasn't a thing many years ago. Am I wrong in saying this was brought about in reaction to Chrome adding the same feature, or has this been there for a while? Clearly people wanted this for ages, hence the work on things like PhantomJS. But it seems like it was only added once they realized they needed to play catch-up with Chrome.

Possibly contributing factor: the old selenium plugin for Firefox is broken by the webextensions move. While working for that use case, they cleaned up other issues for it?

This seems way too fast to be a response to chrome

Re: Headless mode in Firefox

#106

Perhaps I'm spoiled, but I'm wondering why this wasn't a thing many years ago. Am I wrong in saying this was brought about in reaction to Chrome adding the same feature, or has this been there for a while? Clearly people wanted this for ages, hence the work on things like PhantomJS. But it seems like it was only added once they realized they needed to play catch-up with Chrome.

http://web.archive.org/web/20070303040640/http://simile.mit....

I remember using this with xvfb to achieve headless Firefox. The rendered text could then be accessed via localhost with a text-only browser or tcp client e.g. netcat.

Re: Headless mode in Firefox

#107

Can someone do an ELI5 on why headless browsers are useful? I've use them before to make screenshots of webpages, and I have noticed that many NPM packages come (or came) with PhantomJS as a dependency, but I have no idea why one would need that.

To add to the sibling posts:

Crawling the Web. Although you might think that you can crawl a web site by poking through the HTML looking for tags and opening the URLs they contain; that stopped working well a long time ago. Modern sites are essentially complex GUI applications that run inside...a browser. You need either a browser, or some browser-equivalent thing therefore in order to run them and properly crawl them.

Re: Headless mode in Firefox

#108
post #6

Can you tell Firefox to print in headless mode? I want to write reports using HTML and JS, but printing is always an issue.

If you need professional typesetting from HTML+CSS, Prince XML is still king, I'm pretty sure. It can be invoked & run heedlessly. It also supports page-oriented CSS declarations and variables, like headers, footers, page numbers, etc.

What are the features that make Prince XML better than headless chrome? Prince XML is not open source or cheap.

Re: Headless mode in Firefox

#109
post #5
post #3

As a UI designer, I dream of strike headless strike chromeless browsers, where the UI appears when you need it, intuitively, even when NOT in full screen. The top bar simply takes too much unnecessary space. If there's any dev that wants to collaborate on this, let me know :)

From a security POV, the URL being displayed at all times is absolutely necessary in order to avoid phishing.

Useful. Neither ideal nor necessary, though.

A full source reputation, authentication, and integrity capability strikes me as far more useful.

Re: Headless mode in Firefox

#110
post #31

Does anyone have any metrics on headless vs headed browser testing? Can you say headless is 25% faster and 20% more reliable? What is the sales pitch for headless browsers for UI automation?

I don't have numbers handy, but I didn't notice any significant performance difference between headless and headed chrome. I think the main benefit of headless is ease of test server setup. We use a CI service, so that's not a factor.

We are sticking with phantomjs for now because it is significantly faster than chrome for our tests.

Post reply on HN