Live data from Hacker News

Headless mode in Firefox

developer.mozilla.org

111–120 of 191 posts

Re: Headless mode in Firefox

#111
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 :)

I'm working on some thoughts in a related, if not entirely similar, vein:

https://www.reddit.com/r/dredmorbius/comments/6bgowu/what_if...

Re: Headless mode in Firefox

#112
post #100

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.

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…

Got it.

Thanks!

Re: Headless mode in Firefox

#113

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.

phantomjs is a lot of work to maintain, and the developer officially deprecated it, recommending people to use chrome headless mode instead.

Re: Headless mode in Firefox

#114

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 the…

Isn’t this why these ‘headless’ solution have (or are actually built on) JavaScrict engines like V8 with the ability to also simulate any user interaction?

Re: Headless mode in Firefox

#116

since you're setting the environment variable to be headless what happens if you're browsing with Firefox while running your automated process?

You don't need to set all your environment variables in your bashrc, if that's not obvious. They're not global state. You can change them on a per-terminal basis, and that only effects the environment of that one terminal. Firefox does some weird stuff with multiprocessing, where if you run the firefox command twice you only get one process. I don't know how that would effect things, but I imagine just setting the en…

D'oh of course.

Re: Headless mode in Firefox

#117
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…

Got it. Thanks!

Scraping for data is another big use case. Like a price comparison web site. Or the company LinkedIn is unhappy about because they are scraping profile data.

Re: Headless mode in Firefox

#118
post #94

Earlier quoted context omitted.

Thanks for the info, that's good news.

Or you could look at as really bad news if it takes a decade to implement this.

I mean, Selenium has worked for Firefox for years so it's not like this was a priority.

It's a decade to decide this is worth doing, which is reasonable given that there's also a "good enough" solution out there; Selenium.

Re: Headless mode in Firefox

#119

Earlier quoted context omitted.

Do you have any advice on how to get off of Karma with Angular 1 apps?

Well why do you want to do that, if you are finding the tests are too slow it maybe worth writing some tests with jasmine that can be run in node without a browser. That's what we currently do, karma and browser testing are useful but sometimes you can get away with not using them. One thing we are trying is using JSDom to run browser based tests in node

We ported all our karma/Jasmine tests to (ts-)jest. Works great. Comes with JsDOM out of the box.
Post reply on HN