title: How to capture entire WebContent inside CurrentWindow
body: <p>I have a really long page inside a window (need to scroll to view all), when I try to capture the entire window using the code below, I get a squeezed image instead of full WebContent screenshot inside the CurrentWindow.</p>
  
  <p><a href="https://github.com/electron/electron/blob/master/docs/api/browser-window.md#wincapturepagerect-callback">https://github.com/electron/electron/blob/master/docs/api/browser-window.md#wincapturepagerect-callback</a></p>
  
  <pre><code>        const remote = require('electron').remote;
          const win = remote.getCurrentWindow();
          const win_size = win.getSize();
          const win_height = win_size[0];
          const win_width = win_size[1];
  
          win.capturePage({
                  x: 0,
                  y: 0,
                  width: win_width,
                  height: win_height
              },
              (img) =&gt; {
                  remote.require('fs')
                      .writeFile(TEMP_URL, img.toPng());
              });
  </code></pre>
  
  <p>I have also tried the following code but the result is the same,</p>
  
  <pre><code>        const remote = require('electron').remote;
          const webContents = remote.getCurrentWebContents();
  
          webContents.capturePage({
              x: 0,
              y: 0,
              width: 1000,
              height: 2000
          }, (img) =&gt; {
              remote.require('fs')
                  .writeFile(TEMP_URL, img.toPng());
          });
  </code></pre>
  
  <p>The first object passed in into <code>capturePage</code> method should be the bound but turns out to be the size of the output image.</p>
  
  <p>I have inspected the <code>win_size</code> which is the correct size of the WebContent in the CurrentWindow.</p>
  
  <p><a href="https://i.stack.imgur.com/XFLsd.png"><img src="https://i.stack.imgur.com/XFLsd.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/hfznJ.png"><img src="https://i.stack.imgur.com/hfznJ.png" alt="enter image description here"></a></p>