title: Chrome Headless Selenium documentHeight
body: <p>I am using Selenium C# to drive a Headless instance of Chrome</p>
  <pre><code>            ((ChromeOptions)_Options).AddArgument(&quot;--headless&quot;);
              ((ChromeOptions)_Options).AddArgument(&quot;window-size=1920,1080&quot;);
  </code></pre>
  <p>I have run into the problem that my javascript is always detecting both</p>
  <blockquote>
  <p>$(document).height()</p>
  </blockquote>
  <p>and</p>
  <blockquote>
  <p>$(window).height()</p>
  </blockquote>
  <p>as being 1080 in height, which is not accurate.  The document height should be much taller in some cases.  Is there a reason this is not working correctly and/or a work around to solve the issue?</p>
  <p>In my troubleshooting, I grabbed the value for this javascript, and discovered that it was also 1080.</p>
  <blockquote>
  <p>Math.max(document.body.scrollHeight, document.body.offsetHeight,
  document.documentElement.clientHeight,
  document.documentElement.scrollHeight,
  document.documentElement.offsetHeight)</p>
  </blockquote>
  <p>This particular page is definitely taller than the screen, and I used the Selenium GetScreenshot() method to take a picture and verify the scrollbar exists and content exists below the visible area.</p>
  <p>For clarification, this does work correctly when running the headed version of Chrome.  And the javascript in question is being run from JQuery's method:</p>
  <blockquote>
  <p>$(document).ready(function () {</p>
  </blockquote>