Create capture.js

Thanks to Shaun Dunne