title: Getting data from Google Chrome Webview to Caller/Parent window
body: <p>I'm working on a Chrome Kiosk Application (So packaged app limitations apply) that's essentially a web browser that will be deployed to some Chrome devices. I'm looking to support screenshots, and I'm using HTML2Canvas to do this, but I need to store them to be uploaded later on. </p>
  
  <p>I'm calling HTML2Canvas by using webview.executeScript{file:} with a callback. In the callback I'm executing the actual html2canvas call</p>
  
  <pre><code>  webview.executeScript({ file: "kiosk/html2canvas.js" }, handleHTML2CanvasInjected);
  
    function handleHTML2CanvasInjected(event) {
       var webview = document.querySelector('webview');
       webview.executeScript({code: "html2canvas(document.body).then(function(canvas){ //whatever });"});
     }
  </code></pre>
  
  <p>I can append the canvas object to the body and see that the screenshot is working. However, I need this to be returned to the caller. </p>
  
  <p>I've tried to use localStorage, but it seems the webviews storage and the caller's storage are two different things. </p>
  
  <p>It really boils down to the fact that I need to be able to communicate "stuff" between a Webview and the Window that created the Webview.</p>