JSPM

@bretkikehara/devtools-detect

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q44452F
  • License MIT

Utility to check if DevTools.

Package Exports

  • @bretkikehara/devtools-detect

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bretkikehara/devtools-detect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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