Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6703441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:10:17+00:00 2026-05-26T07:10:17+00:00

I am using this little script to find out whether Firebug is open: if

  • 0

I am using this little script to find out whether Firebug is open:

if (window.console && window.console.firebug) {
    //is open
};

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.

This:

if (window.console && window.console.chrome) {
    //is open
};

doesn’t work.

EDIT:

So it seems that it is not possible to detect whether the Chrome console is open. But there is a “hack” that works, with some drawbacks:

  • will not work when console is undocked
  • will not work when console is open on page load

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:10:18+00:00Added an answer on May 26, 2026 at 7:10 am

    Leaving previous answers below for historical context.

    Debugger (2022)

    While not fool-proof, this debugger-based approach in another answer does appear to still work.

    requestAnimationFrame (Late 2019)

    Currently Muhammad Umer’s approach works on Chrome 78, with the added advantage of detecting both close and open events.

    function toString (2019)

    Credit to Overcl9ck‘s comment on this answer. Replacing the regex /./ with an empty function object still works.

    var devtools = function() {};
    devtools.toString = function() {
      if (!this.opened) {
        alert("Opened");
      }
      this.opened = true;
    }
    
    console.log('%c', devtools);
    // devtools.opened will become true if/when the console is opened

    regex toString (2017-2018)

    Since the original asker doesn’t seem to be around anymore and this is still the accepted answer, adding this solution for visibility. Credit goes to Antonin Hildebrand‘s comment on zswang‘s answer. This solution takes advantage of the fact that toString() is not called on logged objects unless the console is open.

    var devtools = /./;
    devtools.toString = function() {
      if (!this.opened) {
        alert("Opened");
      }
      this.opened = true;
    }
    
    console.log('%c', devtools);
    // devtools.opened will become true if/when the console is opened

    console.profiles (2013)

    Update: console.profiles has been removed from Chrome. This solution no longer works.

    Thanks to Paul Irish for pointing out this solution from Discover DevTools, using the profiler:

    function isInspectOpen() {
      console.profile();
      console.profileEnd();
      if (console.clear) {
        console.clear();
      }
      return console.profiles.length > 0;
    }
    function showIfInspectIsOpen() {
      alert(isInspectOpen());
    }
    <button onClick="showIfInspectIsOpen()">Is it open?</button>

    window.innerHeight (2011)

    This other option can detect the docked inspector being opened, after the page loads, but will not be able to detect an undocked inspector, or if the inspector was already open on page load. There is also some potential for false positives.

    window.onresize = function() {
      if ((window.outerHeight - window.innerHeight) > 100) {
        alert('Docked inspector was opened');
      }
    }
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using series.add(180, 1); produces a perfectly valid chart like this (little red dot at
This one might be a little confusing. I'm using AMCharts with rails. Amcharts comes
I would like a little confirmation that I'm doing this correctly. Using rails single
Using this code to zip a folder and it works perfect on small files
I'm currently working on a little harvester, using this dataset of 2700 foundations .
I am displaying a message in my ASP.NET from code-behind using this: Response.Write(<script>alert('Hello')</script>); When
var firstValue = $(this).find('.feedback-selected').val(); var secondValue = $('.feedback-selected').val(); alert(firstValue); alert(secondValue); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div> <input
I'm a beginner programmer, so this question might be a little simple. I'm using
Using this question as the base is there an alogrithm or coding example to
Using this file as source, I have a situation where I need to retrieve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.