kevva / screenshot-stream

Capture screenshot of a website and return it as a stream
MIT License
236 stars 38 forks source link

add css option - fixes #24 #25

Closed SamVerschueren closed 8 years ago

SamVerschueren commented 8 years ago

Added support for a css option and it seems to work well. Feedback is more then welcome.

I am not sure if pageres should support a css file, but I think it would be a nice addition. Should screenshot-stream support a css file as well then? Or should pageres detect if it's a file, read the css file and pass the content of that file directly to screenshot-stream?

// @sindresorhus

kevva commented 8 years ago

Oh, great! I was working in this some time ago and I was using https://github.com/sindresorhus/file-url for files and used that in the href.

sindresorhus commented 8 years ago

Should screenshot-stream support a css file as well then?

Sure.

SamVerschueren commented 8 years ago

Added support for a css file but it's not working. Commented out the test. Anyone has an idea? Doesn't phantom support loading local files? Should I read the content of the file and just add it in the style tag?

SamVerschueren commented 8 years ago

Didn't seem to work with a local file in phantomjs. So now I read the file and inject the content in the page.

SamVerschueren commented 8 years ago

Fixed description and merge conflict.

Will do a PR in pageres if this one lands to add a css method.

SamVerschueren commented 8 years ago

ping @kevva @sindresorhus :)