title: How to get document.documentMode property from WebBrowser control
body: <p>I have a very simple forms application with WebBrowser control on the form which I want to use to debug rendering issues, especially which documentType is used by the browser.
  When I navigate in IE to the website, it's easy - I open up the JS console and type <code>document.documentType</code> and get value.</p>
  
  <p>How can I achieve the same from the C# and <code>WebBrowser</code> control?</p>
  
  <p>I have tried:</p>
  
  <pre><code>private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
  {
      if (webBrowser1.Document != null)
      {
          var document = webBrowser1.Document;
          mshtml.IHTMLDocument doc = (mshtml.IHTMLDocument) document.DomDocument;   
      }
  }
  </code></pre>
  
  <p>But the <code>doc</code> doesn't seem to surface <code>documentMode</code> property easily.</p>