Live data from Hacker News

Headless mode in Firefox

developer.mozilla.org

151–160 of 191 posts

Re: Headless mode in Firefox

#151

Earlier quoted context omitted.

Still requires a X server, which docker containers won't necessarily have.

Only versions 1.4 and below. Versions 1.5 and above do not require an X server. Version 1.5 has been available for 5+ years: https://ariya.io/2012/03/pure-headless-phantomjs-no-x11-or-x...

We have found PhantomJS to be very buggy and hard to debug. We generate millions of PDFs a month. Whenever we upgrade PhantomJS, something breaks with no way to debug easily. We end up reverting to the older version. After trying 3 times, we gave up and had settled for the older version.

Re: Headless mode in Firefox

#152

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?

It's becoming more and more popular not to use a browser for unit tests.

You do "pure" unit tests, which test most of the logic, computations and intention in nodejs, then rely on (usually just a few) E2E tests in selenium or whatever to make sure stuff actually work in the browser.

For example, in a standard React/Redux app with low amounts of legacy code, you can test almost all of the app's constructs in node and be very confident that everything works.

There's still a few places where Karma + Browser shine. Namely when something requires a unit test-style environment but is integration heavy. Think libraries abstracting browser details such as a rich text editor or a library like jQuery.

Re: Headless mode in Firefox

#154
post #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?

OP means custom launcher.

Re: Headless mode in Firefox

#155
post #151

Earlier quoted context omitted.

Only versions 1.4 and below. Versions 1.5 and above do not require an X server. Version 1.5 has been available for 5+ years: https://ariya.io/2012/03/pure-headless-phantomjs-no-x11-or-x...

We have found PhantomJS to be very buggy and hard to debug. We generate millions of PDFs a month. Whenever we upgrade PhantomJS, something breaks with no way to debug easily. We end up reverting to the older version. After trying 3 times, we gave up and had settled for the older version.

In the middle of moving a massive codebase off PhantomJS, it is indeed a nightmare. Old versions leaked memory, debugging/logging is really weird because you get trapped in the context of the browser, and pooling...one of the old phantom pooling packages on GH is part of someone's grad thesis.

Does not play well with React Fiber either, in my experience. Aaaand isn't the brain behind PhantomJS stepping down or something? To any potential users: just go with Chrome

Re: Headless mode in Firefox

#156
post #154
post #149

Earlier quoted context omitted.

> headless mode with a customer launcher Where does one find a customer launcher?

OP means custom launcher.

I think they got that, but customers can be difficult and the impulse to launch them can be strong.

Thank you for your helpfulness, regardless.

Re: Headless mode in Firefox

#158

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?

That's what TestingBot offers; a cloud of browsers to run automated tests. Pricing depends on test duration and concurrency.

We secure all VMs with a firewall, every test runs on a new VM which gets destroyed after the test.

Re: Headless mode in Firefox

#159
post #153

Earlier quoted context omitted.

Like that, but with documentation.

and that actually works. Using headless chrome with the direct API is so much more reliable than the selenium API.

The onus of who actually automates the browser is moving from Selenium (the open source project) to the browser vendors. This will help with reliability and is also exactly what you're asking for:

https://www.w3.org/TR/webdriver/

Re: Headless mode in Firefox

#160
post #65
post #23

Earlier quoted context omitted.

No it isn't, the URL is unreliable source of truth with Unicode spoofing attacks and things like that. Safari only shows the domain at this point; the URL is an unimportant implementation detail.

How would you differentiate say: " http://googlemail.buyviagra.com" From: " https://mail.google.com" If they looked the same.

Urls to be shown punycoded at all times. Not pretty but might be necessary. This should gain some momentum before emoji urls go mainstream
Post reply on HN