This is a backport PR for branch 42-x-y
trop[bot]

#53497: fix: don't throw when adding or removing console-message listeners on a destroyed WebContents

Merged
Created: Sep 3, 2026, 8:28:45 PM
Merged: Sep 3, 2026, 9:49:10 PM
1 comments
Target: 42-x-y

Backport of #53493

See that PR for details.

Notes: Fixed webContents.on(), removeListener() and removeAllListeners() throwing "Object has been destroyed" for console-message listeners after the WebContents was destroyed.

Backport Information

Original PR Author
MarshallOfSound
Original PR Status
Merged
Original PR Merged At
Sep 3, 2026, 8:28:08 PM
Original PR Link
GitHubView on GitHub

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