@bretkikehara/devtools-detect

Utility to check if DevTools.

Usage no npm install needed!

<script type="module">
  import bretkikeharaDevtoolsDetect from 'https://cdn.skypack.dev/@bretkikehara/devtools-detect';
</script>

README

devtools-detect

CircleCI

Utility to check if DevTools.

  • Chrome DevTools
  • Safari DevTools
  • Firefox DevTools
  • Opera DevTools
  • Firebug
  • Firebug Lite

How to use

import { isDevtoolsOpen } from '@bretkikehara/devtools-detect';

if (isDevtoolsOpen(window)) {
    console.log('devtools is open!');
} else {
    console.log('devtools is closed!');
}

isDevtoolsOpen(window: Window, threshold: number = 160)

  • window - Window variable to check.
  • threshold - Screen dimension inner vs outer threshold.

Caveats

Firefox can't detect if devtools is open as an external window.

License

MIT © Bret K. Ikehara

"/src/checks/window-dimensions.ts" is licensed under MIT © Sindre Sorhus. Original code available at https://github.com/sindresorhus/devtools-detect. "/src/checks/to-string.ts" Original code available at https://stackoverflow.com/questions/7798748/find-out-whether-chrome-console-is-open/30638226#30638226