browser-devtools-detector
v0.1.0
Published
Zero-deps detector checking if browser devtools is opened
Downloads
2
Readme
browser-devtools-detector
Detect if browser devtools is opened.
Install
install via npm:
# via npm
$ npm i --save browser-devtools-detector
# or yarn
$ yarn add browser-devtools-detector
# or pnpm
$ pnpm add browser-devtools-detector
Usage
- basic example:
import devtools from 'browser-devtools-detector'
devtools.on('change', (isOpen, detail) => {
console.log('devtools is opened?', isOpen)
})
devtools.launch()
- or you can create your own instance:
import { DevtoolsDetector } from 'browser-devtools-detector'
const devtools = new DevtoolsDetector({
threshold: 100, // default
})
// same as basic usage
- set detect delay (default to 500ms):
devtools.setDetectDelay(300)