feat: support app#login event for utility process net requests (#43317)

* feat: support app#login event for utility process net requests

* feat: support app#login event for utility process net requests

* chore: address review feedback

* GlobalRequestID: Avoid unwanted inlining and narrowing int conversions

Refs 5702737

* chore: fix lint
This commit is contained in:
Robo 2024-08-16 18:24:19 +09:00 committed by GitHub
parent 7123b313cf
commit 8c1be5ade2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 536 additions and 37 deletions

View file

@ -345,9 +345,10 @@ app.on('select-client-certificate', (event, webContents, url, list, callback) =>
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `webContents` [WebContents](web-contents.md) (optional)
* `authenticationResponseDetails` Object
* `url` URL
* `pid` number
* `authInfo` Object
* `isProxy` boolean
* `scheme` string
@ -358,7 +359,7 @@ Returns:
* `username` string (optional)
* `password` string (optional)
Emitted when `webContents` wants to do basic auth.
Emitted when `webContents` or [Utility process](../glossary.md#utility-process) wants to do basic auth.
The default behavior is to cancel all authentications. To override this you
should prevent the default behavior with `event.preventDefault()` and call

View file

@ -36,6 +36,8 @@ Process: [Main](../glossary.md#main-process)<br />
`com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will allow the utility process
to load unsigned libraries. Unless you specifically need this capability, it is best to leave this disabled.
Default is `false`.
* `respondToAuthRequestsFromMainProcess` boolean (optional) - With this flag, all HTTP 401 and 407 network
requests created via the [net module](net.md) will allow responding to them via the [`app#login`](app.md#event-login) event in the main process instead of the default [`login`](client-request.md#event-login) event on the [`ClientRequest`](client-request.md) object.
Returns [`UtilityProcess`](utility-process.md#class-utilityprocess)

View file

@ -14,6 +14,12 @@ This document uses the following convention to categorize breaking changes:
## Planned Breaking API Changes (33.0)
### Behavior Changed: `webContents` property on `login` on `app`
The `webContents` property in the `login` event from `app` will be `null`
when the event is triggered for requests from the [utility process](api/utility-process.md)
created with `respondToAuthRequestsFromMainProcess` option.
### Deprecated: `systemPreferences.accessibilityDisplayShouldReduceTransparency`
The `systemPreferences.accessibilityDisplayShouldReduceTransparency` property is now deprecated in favor of the new `nativeTheme.prefersReducedTransparency`, which provides identical information and works cross-platform.