Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: native_client_sdk/src/build_tools/screenshot_extension/README

Issue 23458018: [NaCl SDK] Screen capture extension for use with SDK visual testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/screenshot_extension/background.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Screenshot Extension
2 --------------------
3
4 This extension is to visually test the SDK examples. To use, add this to the
5 html:
6
7 TODO(binji): normal users shouldn't have to do this -- it should be
8 automatically loaded by the testing framework.
9
10 <head>
11 ...
12 <script
13 src="chrome-extension://kbbhhngcmjcmlgcnbihfgliliemmijmj/screenshot.js">
14 </script>
15 <head>
16
17 Then in JavaScript:
18
19 var myPluginEl = document.embeds[0];
20 function onSuccess(dataURL) {
21 // dataURL is a data URL encoded PNG. You can add this to a image like this:
22 var image = new Image();
23 image.onload = function() { ... }
24 image.src = dataURL;
25 }
26
27 function onError(errorMessage) {
28 ...
29 }
30
31 screenshot.captureElement(myPluginEl, onSuccess, onError);
32
33 See screenshot.js for more info on the API.
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/screenshot_extension/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698