---
title: "The bug disappears when DevTools is open | Proofline"
description: "A bug that vanishes the moment you open DevTools is not haunted."
url: https://proofline.sh/learn/bug-disappears-with-devtools-open/
---

[Learning center](/learn/)

# The bug disappears when DevTools is open

A bug that vanishes the moment you open DevTools is not haunted. Opening DevTools changes at least three things the page can observe: the page loses focus, the viewport gets smaller when DevTools is docked, and some settings, such as Disable cache, take effect only while DevTools is open. Change those one at a time and the bug usually comes back, along with its cause.

Broken dependencies The Proofline team November 22, 2026 3 min read

## What opening DevTools changes

| Change | What the page sees | How to keep it without hiding the bug |
| --- | --- | --- |
| Focus moves to DevTools | `blur` on the window, `document.hasFocus()` becomes `false`; `focusout` on the active element | Turn on **Emulate a focused page** in the **Rendering** panel |
| The viewport shrinks (docked to the side or bottom) | A `resize` event and a smaller `innerWidth` or `innerHeight`, which can cross a breakpoint | Undock DevTools into a separate window |
| **Disable cache** is on | Every resource refetched from the network | Turn it off and compare |
| Network or CPU throttling left on from earlier | Different timing | Check the throttling menus |
| A paused breakpoint, or a slow console | Timers and responses arrive while the script is paused | Use logpoints instead of breakpoints |
| Logging an object to the console | The console keeps a reference, so the object is not garbage collected | Log copies, or nothing, while checking memory |

[Chrome DevTools: Emulate a focused page](https://developer.chrome.com/docs/devtools/rendering/apply-effects)

## Bugs that depend on focus

Focus is the most common reason. Code that reacts to `blur`, `focusout` or `visibilitychange` runs the moment you click into DevTools:

-   A dropdown or date picker closes on blur, so you cannot inspect its open state.
-   A form validates on blur, so a field shows an error that real use would not show yet.
-   An app pauses polling when the window loses focus, so a race between polling and an action disappears.

**Emulate a focused page** keeps the page treating itself as focused while you work in DevTools. For an element that disappears on blur, you can also pause on the moment it opens: in **Sources**, use the **Event Listener Breakpoints** for the event that opens it, or press F8 to pause script execution while the element is visible.

## Bugs that depend on timing

A breakpoint stops the page's JavaScript, but the network keeps going and timers come due. When you resume, everything that was waiting runs in a different order from real use. A race that depended on a response arriving before a timer can vanish under a breakpoint.

Use logpoints, which log without pausing, or `console.log` with timestamps. To make the race repeatable, control the order deliberately: [hold one response](/learn/force-response-order/).

## Write down what made it disappear

When you find which change hid the bug, it belongs in the report: "Reproduces with DevTools undocked; disappears when DevTools is docked at 1280 px wide, because the layout switches to tablet" saves the maintainer the same hour. Then reproduce it without DevTools in a script, where nothing observes the page: [codegen](/learn/playwright-codegen-reproduction/) or a [trace](/learn/playwright-trace-bug-report/).

## Worked example: an autocomplete list that would not stay open

This example is fictional. A tester reports that the address autocomplete's suggestions overlap the **Continue** button. Every time the developer opens DevTools to inspect the list, the list closes.

The list closed on the input's `blur`, which fired when focus moved into DevTools. With **Emulate a focused page** on, the list stayed open, and the developer saw the list's container set to `z-index: 1` inside a parent with its own stacking context. The bug had been there all along. The page's blur handling only hid it from the inspector.

## Questions

### Why does the bug also disappear in a recording tool?

Screen recorders and remote debugging can change focus and timing in the same ways. Note which tool was running when the bug did or did not appear.

### Does Firefox have the same problem?

Yes, opening its developer tools also moves focus and can shrink the viewport. Undocking the tools helps in the same way.

### What if the bug only appears with DevTools open?

Then look at the same list in reverse: **Disable cache** forcing fresh responses, throttling left on, a breakpoint changing timing, or the smaller viewport. The cause is real either way, but it may not be one users meet.

Return to [reproducing what someone else saw](/learn/replay-browser-bug-report/) for the other layers a replay needs.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Make a race reproduce every time by holding one response](/learn/force-response-order/)
    
    Network outages The Proofline team November 22, 2026 4 min read
    
-   ### [The bug does not reproduce in headless Chrome](/learn/headless-browser-different-result/)
    
    Broken dependencies The Proofline team November 22, 2026 3 min read
