Home | History | Annotate | only in /external/chromium_org/native_client_sdk/src/build_tools/screenshot_extension
Up to higher level directory
NameDateSize
background.js16-Dec-2014881
injected.js16-Dec-20142.3K
manifest.json16-Dec-2014570
README16-Dec-2014801
screenshot.js16-Dec-20145.9K

README

      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.
     34