title: Find out whether Chrome console is open
body: <p>I am using this little script to find out whether Firebug is open:</p>
  
  <pre><code>if (window.console &amp;&amp; window.console.firebug) {
      //is open
  };
  </code></pre>
  
  <p>And it works well. Now I was searching for half an hour to find a way to detect whether Google Chrome's built-in web developer console is open, but I couldn't find any hint.</p>
  
  <p>This:</p>
  
  <pre><code>if (window.console &amp;&amp; window.console.chrome) {
      //is open
  };
  </code></pre>
  
  <p>doesn't work.</p>
  
  <p>EDIT:</p>
  
  <p>So it seems that it is not possible to detect whether the Chrome console is open. But there is a "<a href="https://stackoverflow.com/questions/7527442/how-to-detect-chrome-inspect-element-is-running-or-not">hack</a>" that works, with some drawbacks:</p>
  
  <ul>
  <li>will not work when console is undocked</li>
  <li>will not work when console is open on page load</li>
  </ul>
  
  <p>So, I am gonna choose Unsigned´s answer for now, but if some1 comes up with a brilliant idea, he is welcome to still answer and I change the selected answer! Thanks!</p>