webkit2png icon indicating copy to clipboard operation
webkit2png copied to clipboard

Cookie support

Open robhudson opened this issue 14 years ago • 9 comments

Taking a full size screenshot of a web app that requires login could be supported via a cookies file. The user would log in via their browser, then tell webkit2png to use the cookies file as a source, or perhaps specify which browser's cookies to use as a source for ease of use to the end user.

Safari stores its cookies in a plist database in: ~/Library/Cookies/Cookies.plist

Google Chrome stores its cookies in a sqlite database in: ~/Library/Application Support/Google/Chrome/Default/Cookies

Firefox stores its cookies in a sqlite database in a non-guessable path: ~/Library/Application Support/Firefox/Profiles/????????.default/cookies.sqlite

robhudson avatar Apr 20 '10 15:04 robhudson

This would be fantastic. I've wanted a way to automate screenshots as I work on apps, and the apps always require authentication. I haven't found a solution that works yet.

rjs avatar Dec 23 '10 00:12 rjs

this would be great.

viktorkelemen avatar Jun 23 '11 05:06 viktorkelemen

Hi guys,

did you ever manage to hack on this script so that it can work with login?

jesperronn avatar Feb 09 '12 10:02 jesperronn

If it helps anyone, I've found a decent workaround for this is to save the page down as a Webarchive, and then take the screenshot from the Webarchive file.

By no means a fix, but for anyone in a pinch, this might be handy.

zahnster avatar Jan 02 '14 18:01 zahnster

I would need a parameter to skip HTTP-Logins (I need screens from some hundreds of websites). A little hack for this would be to set the timeout to a lower value.

pbov avatar Jul 24 '15 10:07 pbov

this would be still awesome!

mortensassi avatar Mar 09 '16 09:03 mortensassi

yeah this would be great

xingfanxia avatar Nov 29 '16 02:11 xingfanxia

A limited workaround for certain websites, for instance:

webkit2png --debug https://github.com/login --delay=100

The webpage will show up, then you enter your credentials (with mouse paste). For the following executions, you will be already logged in and can use webkit2png as usual.

jdcourcol avatar Mar 22 '18 10:03 jdcourcol

I think what you're all asking for here is support for specifying cookies - I can't think of any other sensible way we can support all the different login mechanisms used on the web.

#47 is a possible implementation.

paulhammond avatar Mar 26 '20 01:03 paulhammond