paulhammond/webkit2png — pull request #39 by spicyj (2013-04-24 00:51:57+00:00)
Title: Allow waiting for async JS to capture the image

With this change, webkit2png is able to wait for arbitrary asynchronous JavaScript to finish before capturing the screenshot. Use JS code such as:

``` js
webkit2png.stop(); // wait for start() before capturing
$.get("/path/to/handler", function(data) {
displayData(data);
webkit2png.start();
});
```

and the picture won't be captured until the AJAX request returns. (I stole the names 'start' and 'stop' from QUnit: http://api.qunitjs.com/category/async-control/. Happy to switch if there are better suggestions.)