News for hackers. Stuff that matters.
Re:Headless mode in Firefox by dsr_ on Wednesday August 30, 2017 @09:46AM (#15132075)
Remember that if you pass through any data from an outside source, you're running their code on your browser when you thought you were just printing a document.

The security issues don't apply in all circumstances, of course, but if you feel like taking a shortcut to PDF generation and printing through a headless browser, you need to keep them in mind.

Re:Headless mode in Firefox by NathanKP on Wednesday August 30, 2017 @11:25AM (#15132909)
I highly recommend that anyone using a headless browser that may access outside sources employ something like this to run the headless browser in an external environment, in this case AWS Lambda: https://github.com/justengland/phantom-lambda-template

I used this approach for a project at a previous company and not only did it keep the potentially unsafe external code execution isolated from the rest of the stack, but it also proved to be fantastically scalable because of the ability to have AWS Lambda running many headless browsers in parallel compared to trying to scale something like this out on your own hardware.

Re:Headless mode in Firefox by noir_lord on Wednesday August 30, 2017 @12:40PM (#15133613)
That's a neat approach, I'm not on anything like that scale though, looking for something to get rid of JasperReports.
Re:Headless mode in Firefox by b15h0p on Thursday August 31, 2017 @09:35AM (#15140150)
Did you find any library that implements this? I mean, it should not be hard to implement, just slap together some templating language like thymeleaf or velocity and shell it to the headless browser. But still, it would be nice to have all this already implemented.
Re:Headless mode in Firefox by noir_lord on Thursday August 31, 2017 @12:51PM (#15141661)
Last time I had to generate PDF's from scratch rather than inheriting a mess I built a custom heavily modified version of bootstrap (really ripped it apart) just for print use and fed it to wkhtmltopdf via snappy, it worked great and was very fast to develop since I could output to the browser as HTML to debug.
Re:Headless mode in Firefox by foreigner on Wednesday August 30, 2017 @10:31AM (#15132394)
Rendering a PDF you got some other way is also "Running their code", just in a different sandbox :-)
Re:Headless mode in Firefox by Piskvorrr on Friday September 01, 2017 @09:54AM (#15148318)
I don't think you're thinking of the same case: this is "open a browser, and output a PDF"; not "read a PDF."