DevTools open detection
Heuristics that guess when the browser developer tools are open.
In one line
Can guess when your browser developer tools are open, but often gets it wrong
Heuristics that guess when the browser developer tools are open.
Used by anti-scraping and anti-cheat code. Methods: window outer minus inner size over about 160 px, console getter traps, debugger timing. Easily false-positive when docked or zoomed.
What it can and can't do
What the user does: Nothing. It runs in the background while the page is open
It can
- Guess from window size changes that a side panel is open
- Use timing and console tricks to spot open tools
- Block content or end a session when it thinks tools are open
- Flag you as a possible scraper or cheater
It cannot
- Work on iPhone or Chrome on Android
- See what you do inside the tools
- Be sure; docked panels and zoom cause false alarms
- Stop you from closing the tools
How it differs between platforms: Works on desktop Chrome, Edge, Firefox, and Safari. It does not work on iPhone or Chrome on Android.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 1 | 2003-06-23 | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Not supported | Not available | Not listed | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | outerWidth - innerWidth, console.log getter, debugger timing |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
devtoolsOpen | boolean | None | inferred | heuristic |
Technical limits
- No standard API
- Mobile browsers have no devtools signal
The story
What it is
Guesses whether you have the browser's developer tools open.
For you
You never see it. You may notice a page that suddenly goes blank, redirects away or freezes when you press F12. It can also fire by mistake if your window is oddly sized.
For makers
Sites that fear scraping, cheating or copying want to know when someone inspects the code. They react by hiding content, adding delays or flagging the visit. It is easy to fool, but common in anti-bot and game protection.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game with paid items blanks the screen if the developer tools are open, to stop people editing score or coins. | None named |
| security | An anti-scraping script sees the tools open and serves empty data to the visitor. | PerimeterX, DataDome |
| media | A streaming page pauses playback when it thinks someone is capturing the video stream. | None named |
| education | An online exam page flags students who open developer tools during a timed test. | None named |
| shopping | A ticket sale page ends the session when it sees tools open during a drop, as a bot defence. | None named |
| developer | A tool maker uses the same check to show debug info only when developer tools are open. | None named |
| ads | An ad verification script avoids sending data when it detects a person inspecting it. | None named |
Risks
- False alarms for curious people
- Used to hinder security research
Good uses and abuse
Legitimate uses
- Anti-scraping
Known abuse
- Chilling inspection
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 0.3 | Rough identifying entropy, when known |
Sources
How well checked: Inferred from related behavior.