#53202: docs: type webContents as nullable in app 'login' and 'select-client-certificate'
Description of Change
app's login and select-client-certificate events fire with webContents === null for requests that don't originate from a renderer (net.fetch/net.request, utility processes; #52162 added the latter case for select-client-certificate in 44). The prose and breaking-changes.md say so, but the parameter lines were marked (optional), which the definitions generator drops for a non-trailing event argument, so electron.d.ts typed both listeners as webContents: WebContents and TypeScript consumers got no prompt to null-check. Writing the type as WebContents | null makes the generated listener signature webContents: WebContents | null for both events.
Checklist
- PR description included
-
npm run create-typescript-definitionsshows the listener param becoming nullable - PR title follows semantic commit guidelines
Release Notes
Notes: Fixed the TypeScript type of the webContents argument to app's login and select-client-certificate events, which is null for net and utility-process requests.
Backports
Semver Impact
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