codebytere

#54492: fix: apply setContentProtection() in Windows remote sessions again

Merged
Created: Sep 27, 2026, 2:29:07 PM
Merged: Sep 28, 2026, 3:02:26 AM
3 comments
Target: main

Description of Change

Since Electron 44, win.setContentProtection(true) has done nothing when the app runs in a Windows remote session, while win.isContentProtected() kept returning true. Chromium stopped excluding windows from capture in remote sessions so that its own Picture-in-Picture windows stay visible to the remote user (https://chromium-review.googlesource.com/c/chromium/src/+/7918332), and setContentProtection() goes through the same code path.

This enables AllowWindowCaptureExclusionInRemoteSessions by default, so an explicit request for protection is honored again as it is on 43. Apps that would rather leave windows unprotected in remote sessions can pass the feature to --disable-features, which takes precedence. A second commit documents that the change takes effect with the next desktop composition.

Measured on Windows 11 24H2 in a Remote Desktop session: 43.7.5 sets WDA_EXCLUDEFROMCAPTURE, the window stays visible in the mstsc client and is absent from a capture taken inside the session; 44.4.5 leaves WDA_NONE and the capture contains the window. 44.4.3 launched with --enable-features=AllowWindowCaptureExclusionInRemoteSessions, which is what this change makes the default, applies the exclusion again and the window is absent from desktopCapturer.getSources(). At the console all of them set it. There's no spec because CI can't switch a session between console and remote.

Checklist

Release Notes

Notes: Fixed setContentProtection(true) having no effect in Windows remote sessions.

Backports

44-x-y
Merged
PR Number
#54500
Merged At
Sep 28, 2026, 7:34:42 AM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54499
Merged At
Sep 28, 2026, 7:37:02 AM
Released In
v45.0.0-alpha.13
Release Date
Sep 28, 2026, 3:00:19 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron