browser-devtools-detector
Detect if browser devtools is opened.
Install
install via npm:
$ npm i --save browser-devtools-detector
$ yarn add browser-devtools-detector
$ pnpm add browser-devtools-detector
Usage
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,
})
- set detect delay (default to 500ms):
devtools.setDetectDelay(300)
License
MIT