Live data from Hacker News

Headless mode in Firefox

developer.mozilla.org

141–150 of 191 posts

Re: Headless mode in Firefox

#141

Has anyone built a WaaS yet ? (Web-browser as a service.)

I think if done right there would be a market (if this is actually the right direction and useful is another question).

wbaas.io "web browser as a service"

Support like say the 5 major browsers (Firefox, Chrome, Safari, ...), provide an API and charge like ~xx euro/month.

The biggest challenge is probably to make it secure as one builds in essence a DOS proxy?

Re: Headless mode in Firefox

#142

For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…

I use karma. Do only Angular 1 folks use it? What does everyone else use for browser tests?

We use Karma as well.

Re: Headless mode in Firefox

#143
post #100

Earlier quoted context omitted.

Automated integration/regression tests is a pretty big use case. You spin up a copy of your server, point the headless browser at it, run some JavaScript to simulate some user interactions, and verify the page contains the right strings / screenshot doesn't deviate too much from a golden image. I guess the ELI5 way of saying that would be: "Making sure your website still works." People also headless browsers for cont…

So an ELI5 of everything you said would be: Putting the website through user actions in a firefox browser and recording/capturing/documenting the results headlessly. Headless version allows you to go through hundreds of results in the background.

Maybe. I got stuck trying to imagine whether a five-year-old would understand what "headless" means in a software context (as opposed to, "headless dragon" or something).

Re: Headless mode in Firefox

#144

Can you download files in headless Firefox or Chrome?

Not with Chrome at the moment.

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

Soon.

In the interim I've been using standard C# web requests and using the cookies from the ChromeDriver. Doesn't work for downloads where it is not a direct link unfortunately.

Re: Headless mode in Firefox

#145

Earlier quoted context omitted.

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.

PrinceXML is in a league of it's own. Very, very light weight. Very fast and it has outstanding output. The price tag is steep for sure, but if your business relies on PDF output then nothing comes close.

Re: Headless mode in Firefox

#146

Earlier quoted context omitted.

F11 is full screen, not headless. Headless means you can't see the browser or the website content, it's built for scripting purposes (automated web testing and web scraping). The only time you can see the content is if your script requests a screen capture.

I know what headless means, but if fairpx is really referring to headless (he seems to have changed his post) then I have no idea what this means: > where the UI appears when you need it, intuitively, even when NOT in full screen or how it relates to a headless browser.

Replying to myself.. ok the poster was confused between headless and chromeless (by which he really meant full screen), that explains it.. sorry.

Re: Headless mode in Firefox

#147

Earlier quoted context omitted.

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.

You should check out their samples: http://www.princexml.com/samples/

Stuff looks like it was created with QuarkXPress or Adobe InDesign.

Re: Headless mode in Firefox

#148
The article mentions screenshots. I am interested in running the browser as a rendering tool, but ouputing not just a bitmap, but something closer to PDF. The goal here would be to crawl a bunch of pages and spin up the CPU to run all the needed JavaScript to render things, but to obtain an identical version of the page that runs about as fast viewing a screenshot, but also includes text. An offline "web OCR", if you will.

NeWS, Display PostScript, Quartz all come to mind. I know you can save webpages as PDF documents, but I am thinking of something that is like PDF but closer to HTML-just more closely coupled to what is being displayed, and not whatever arbitrary style or JavaScript abuse the developer decided on.

Even just outputing some neat, canonical HTML based on the state of the page once everything is loaded would be helpful, so that the bitmap could later be combined in some kind of new document format.

Re: Headless mode in Firefox

#149

For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…

> headless mode with a customer launcher

Where does one find a customer launcher?

Re: Headless mode in Firefox

#150

Has anyone built a WaaS yet ? (Web-browser as a service.)

I think if done right there would be a market (if this is actually the right direction and useful is another question). wbaas.io "web browser as a service" Support like say the 5 major browsers (Firefox, Chrome, Safari, ...), provide an API and charge like ~xx euro/month. The biggest challenge is probably to make it secure as one builds in essence a DOS proxy?

There totally is a market for it. Sauce Labs makes $25MM/year doing it. One way to secure the service is by using pristine virtual machines for each session and discarding them afterwards.
Post reply on HN