vbauer / manet

Website screenshot service powered by Node.js, SlimerJS and PhantomJS
MIT License
575 stars 102 forks source link

Ability to take screenshots of logged in pages #43

Closed codextremist closed 8 years ago

codextremist commented 8 years ago

Manet is brilliant! One nice feature would be the abiliy to take screenshots of pages that require user authentication. Maybe through PhantomJS (i'm not an expert on it), that could be accomplished by pointing it first to a sign in page if a forbidden 401 status is returned (just a quick example so u can get the idea). For example we could set parameters on the config file so that phantom would be able to log itself

sign_in: path: /user user: foo pass: bar user_field_matcher : blah pass_field_matcher: blah

Or even setting cookies (not sure exactly how phantom internals work).

vbauer commented 8 years ago

I've just added cookies support via special parameter (cookies). You can use HTTP message body to send some parameters (including array of cookies). New version was released (0.4.7).

You can also use any other version and change execution command. For example: PhantomJS supports parameter --cookies-file (http://phantomjs.org/api/command-line.html) It allows you to catch all necessary cookies and use them.

codextremist commented 8 years ago

Brilliant! Gonna try it out ! tks

vbauer commented 8 years ago

YW :)