Skip to content

fix: devtools re-attaches on open when previously detached#50815

Merged
dsanders11 merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-devtools-re-attaches-on-open-when-previously-detached-1775669816032
Apr 8, 2026
Merged

fix: devtools re-attaches on open when previously detached#50815
dsanders11 merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-devtools-re-attaches-on-open-when-previously-detached-1775669816032

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop Bot commented Apr 8, 2026

Backport of #50807

See that PR for details.

Notes: Fixed an issue where DevTools would re-attach to the window when opened after previously being detached.

PR #50646 added a dock state allowlist in SetDockState() that collapsed any
non-matching value to "right". WebContents::OpenDevTools passes an empty
string when no `mode` option is given, which is the sentinel LoadCompleted()
uses to restore `currentDockState` from prefs. The allowlist clobbered that
sentinel to "right", so previously-undocked devtools would flash detached
and then snap back to the right dock.

Preserve the empty string through SetDockState() so the pref-restore path
runs; still reject any non-empty invalid value to keep the JS-injection
guard from #50646 intact.

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
@trop trop Bot requested review from a team and codebytere April 8, 2026 17:37
@trop trop Bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Apr 8, 2026
@dsanders11 dsanders11 merged commit c4addb7 into 42-x-y Apr 8, 2026
121 of 123 checks passed
@dsanders11 dsanders11 deleted the trop/42-x-y-bp-fix-devtools-re-attaches-on-open-when-previously-detached-1775669816032 branch April 8, 2026 21:12
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Apr 8, 2026

Release Notes Persisted

Fixed an issue where DevTools would re-attach to the window when opened after previously being detached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant