Live data from Hacker News

Ask HN: What are you using headless Chrome for?

news.ycombinator.com

21–23 of 23 posts

Re: Ask HN: What are you using headless Chrome for?

#21
post #10
post #5

I use it to test my Content-Security-Policy by crawling my whole site and capturing any violation reports that are sent.

Mind sharing your script?

This has been absorbed into an internal repo now, but the original version that I wrote a couple of years ago is here: https://gitlab.com/jamieweb/travis-ci_csp-tester/

Re: Ask HN: What are you using headless Chrome for?

#22
post #17
post #2

I used it for creating PDFs at my last job.

Could someone elaborate? How does this work? Do you create a HTML document then print the output as a PDF with headless Chrome?

Yes exactly, HTML document using whatever templating language you want (or even client-side JavaScript framework since Chrome can handle that too) and then output a PDF.

Re: Ask HN: What are you using headless Chrome for?

#23
post #10

Earlier quoted context omitted.

Mind sharing your script?

This has been absorbed into an internal repo now, but the original version that I wrote a couple of years ago is here: https://gitlab.com/jamieweb/travis-ci_csp-tester/

Cheers!
Post reply on HN