title: How do you set the browser inner window/viewport size?
body: <p>If I call the function:</p>
  
  <pre><code>browser.driver.manage().window().setSize(1000, 1000);
  </code></pre>
  
  <p>It sets my <strong>window size</strong> to 1000x1000 and my <strong>inner window/viewport size</strong> to 990x918. By inner window size, I mean the portion of the window that actually contains the content, not including window borders or tabs, for example. In this case, I have a 5px border on each side, and then 82px worth of url and tab bars that I would like to account for.</p>
  
  <p>I'd like to set the inner window size so that I dont need to potentially account specifically for the machine running the tests, should it happen to have an extra toolbar for example.</p>
  
  <p>Is there a protractor command for setting the size of the actual inner, content-filled portion of the window?</p>
  
  <hr>
  
  <p>As based on the answer below, I added this to the onPrepare section of my conf:</p>
  
  <pre><code>protractor.setViewportSize = function(width, height){
      const JS_GET_PADDING = "return {"
         + "w: window.outerWidth - window.innerWidth,"
         + "h: window.outerHeight - window.innerHeight };";
  
       browser.executeScript(JS_GET_PADDING).then(function(pad){
         browser.manage().window().setSize(width + pad.w, height + pad.h);
       });
  };
  </code></pre>
  
  <p>And in the test, I call something like:</p>
  
  <pre><code>protactor.setViewportSize(1440, 1000);
  </code></pre>