@bretkikehara/devtools-detect
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i @bretkikehara/devtools-detect

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

15.4 kB

Total Files

21

Last publish

Collaborators

  • bretkikehara