Socket
Socket
Sign inDemoInstall

@bretkikehara/devtools-detect

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bretkikehara/devtools-detect

Utility to check if DevTools.


Version published
Maintainers
1
Install size
15.1 kB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 02 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc