Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 

Repository files navigation

Chrome Inspector Detector

A simple utility for detecting whether or not the Chrome Inspector is open or docked.

Simply call chrome.inspector.detector() and you will be returned one of the following three objects:

  • When the inspector is opened and docked: { opened: true, docked: true }
  • When the inspector is opened and in a separate window: { opened: true, docked: false }
  • When the inspector is closed: { opened: false, docked: false }

Things you could do with this that are not malicious :P

  • You're developing a JS game and you want to pause the game whenever you open the console so that it's easier to adjust CSS without it constantly re-rerendering.
  • You're designing a site and want to display a typography grid overlay whenever inspecting to aid in design.
  • You want a few dom nodes or JS objects to be console.log'd whenever you open the console for up-to-date information.

Credit goes to this Stackoverflow answer for the profiler technique.

About

Detect if the Chrome Inspector is open or closed.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages