title: Javascript: save and restore browser window sizes
body: <p>In my vaadin application, user can save a user workspace with multiple browser popup windows and restore the workspace later.</p>
  
  <p>I save the browser window size returned by following vaadin methods.</p>
  
  <pre><code>Page.getBrowserWindowHeight();
  Page.getBrowserWindowWidth();
  </code></pre>
  
  <p>Vaadin returns the content width and height of the browser in above methods, not including title bar and other controls in the top such as the address bar and toolbar.</p>
  
  <p>When restoring a workspace, I use <code>resizeTo()</code> javascript method to set the size of the browser windows.</p>
  
  <pre><code>JavaScript.getCurrent().execute("resizeTo(" + windowWidth + "," + windowHeight + ")");
  </code></pre>
  
  <p><code>resizeTo()</code> sets the total width and height of the browser window, not the content area. Due to this, the browser window becomes smaller than the intended size.</p>
  
  <p>Does anyone know of a better method to achieve this?</p>