Live data from Hacker News

Headless mode in Firefox

developer.mozilla.org

171–180 of 191 posts

Re: Headless mode in Firefox

#171
post #119

Earlier quoted context omitted.

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

Do you have any advice / links on how to do that? May be you should write a blog post about it. :)

https://github.com/imrvelj/ng1-jest-example

Re: Headless mode in Firefox

#172
post #153

Earlier quoted context omitted.

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/

Right. That will be nice when it's done and stable (I'm looking at you, Safari), but for my tests today that doesn't really help me.

Re: Headless mode in Firefox

#173
post #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

This isn't another use case for it; you can still use Selenium with Firefox 57+. It's only the extension that allows you to generate Selenium scripts by performing the tasks you want it to execute manually that will no longer work, and no effort is invested in that because there are good enough alternatives.

Re: Headless mode in Firefox

#174

Which way to go: Chrome headless, Firefox headless or both?

Both. Ideally, you shouldn't run website tests on a single browser. We shouldn't want to return to the days where websites only worked well on a single browser.

Exactly. I already think it's a shame that I can only run Firefox and Chrome in Docker (i.e. CI), but I hope that their differences will compensate enough to cover most potential problems in Edge and Safari.

Re: Headless mode in Firefox

#175
post #172

Earlier quoted context omitted.

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/

Right. That will be nice when it's done and stable (I'm looking at you, Safari), but for my tests today that doesn't really help me.

I would be very interested in tracking the details you're hinting at to know when this is done and stable to use reliably. Do you have specific examples/issues related to what your tests today require that is unreliable / not currently possible using WebDriver with Safari and/or headless Chrome?

Re: Headless mode in Firefox

#176
What about the "app" mode? Chrome have introduced the --app command line switch long time ago and similar functionality would be very useful also in Firefox. I suppose that implementation would be also very easy, i don't understand why there is still no such functionality in Firefox.

Re: Headless mode in Firefox

#177

Earlier quoted context omitted.

We're using Chrome Headless inside Docker to produce thousands of PDF reports from an Angular/D3 web app. It works very well, but there are some gotchas with regard to the Chrome Remoting Interface.

Yeah, D3 is what we're working with as well; also need to be able to embed the charts in Powerpoint, but that'll be a different story. All fun and games.

You can use inkscape’s CLI interface to get SVG from pdf, and then manipulate that with any XML editing library automatically

Re: Headless mode in Firefox

#178

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…

What you want is SVG. You want an SVG output of the actual, full, page. With text embedded in SVG properly, of course.

Re: Headless mode in Firefox

#179
post #17

Earlier quoted context omitted.

You can generate pdfs with headless Chromium/Chrome pretty easily[1]. chromium-browser --headless --disable-gpu --print-to-pdf=output_file_name.pdf file:///path/to/your/html [1] https://developers.google.com/web/updates/2017/04/headless-c...

Any idea when exactly the PDF capture is performed? So many pages now render a minimal initial load, while the actual content is greatly delayed (usually Capturing the PDF at even the onload event (let alone the useless DOMContentLoaded event) is going to capture an incomplete picture in a huge number of situations. Frankly, a PDF capture at onload event is going to be utterly unusable. Is there a way to set a delay…

That's a good question but I don't know the answer. The reports we generate don't use js so I've never needed to investigate.

Re: Headless mode in Firefox

#180
post #65

Earlier quoted context omitted.

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

You mean, before the 90% of the global population that doesn’t speak english as first language goes online, right?

Because the #1 use case for this isn’t emoji, but sites such as bücher.de (I originally had a link here to the site, but HN punycodes that: http://xn--bcher-kva.de/ ) (which nowadays had to redirect, because the URL displayed in punycode made people believe it was a phishing attempt)

Post reply on HN