blob: 5c1f505ed3bd38492e71085980f920c220b993e7 [file] [log] [blame]
Screenshot Extension
This extension is to visually test the SDK examples. To use, add this to the
TODO(binji): normal users shouldn't have to do this -- it should be
automatically loaded by the testing framework.
Then in JavaScript:
var myPluginEl = document.embeds[0];
function onSuccess(dataURL) {
// dataURL is a data URL encoded PNG. You can add this to a image like this:
var image = new Image();
image.onload = function() { ... }
image.src = dataURL;
function onError(errorMessage) {
screenshot.captureElement(myPluginEl, onSuccess, onError);
See screenshot.js for more info on the API.