Szpadel / chrome-headless-render-pdf

225 stars 67 forks source link

How to set cookies using chrome-headless-render-pdf? #60

Open ryanzidago opened 4 years ago

ryanzidago commented 4 years ago

Hi,

I want to generate a PDF from a page where a user is authenticated. Therefore, I'd like to pass the session cookie when using chrome-headless-render-pdf.

However, using the library, I haven't see anything regarding setting cookies. Maybe through the --chrome-options flag?

Which chrome options though? I've found this list: https://peter.sh/experiments/chromium-command-line-switches/ but there does not seem to have anything related to setting cookies.