Skip to content

Commit 58f5ac3

Browse files
chore: update ref to docs (🤖) (#903)
Co-authored-by: electron-website-docs-updater[bot] <166660481+electron-website-docs-updater[bot]@users.noreply.github.com>
1 parent eaaf78c commit 58f5ac3

20 files changed

Lines changed: 490 additions & 117 deletions

docs/latest/.sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
370a737ced00938da0a8140d894abaf23bbb6256
1+
32f97529fcecf70aad21a728940c751da5c54323

docs/latest/api/app.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ Returns:
428428
* `oom` - Process ran out of memory
429429
* `launch-failed` - Process never successfully launched
430430
* `integrity-failure` - Windows code integrity checks failed
431+
* `memory-eviction` - Process proactively terminated to prevent a future out-of-memory (OOM) situation
431432
* `exitCode` number - The exit code for the process
432433
(e.g. status from waitpid if on POSIX, from GetExitCodeProcess on Windows).
433434
* `serviceName` string (optional) - The non-localized name of the process.

docs/latest/api/command-line-switches.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Field trials to be forcefully enabled or disabled.
9393

9494
For example: `WebRTC-Audio-Red-For-Opus/Enabled/`
9595

96-
### --host-rules=`rules`
96+
### --host-rules=`rules` _Deprecated_
9797

9898
A comma-separated list of `rules` that control how hostnames are mapped.
9999

@@ -111,9 +111,23 @@ These mappings apply to the endpoint host in a net request (the TCP connect
111111
and host resolver in a direct connection, and the `CONNECT` in an HTTP proxy
112112
connection, and the endpoint host in a `SOCKS` proxy connection).
113113

114+
**Deprecated:** Use the `--host-resolver-rules` switch instead.
115+
114116
### --host-resolver-rules=`rules`
115117

116-
Like `--host-rules` but these `rules` only apply to the host resolver.
118+
A comma-separated list of `rules` that control how hostnames are mapped.
119+
120+
For example:
121+
122+
* `MAP * 127.0.0.1` Forces all hostnames to be mapped to 127.0.0.1
123+
* `MAP *.google.com proxy` Forces all google.com subdomains to be resolved to
124+
"proxy".
125+
* `MAP test.com [::1]:77` Forces "test.com" to resolve to IPv6 loopback. Will
126+
also force the port of the resulting socket address to be 77.
127+
* `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for
128+
"www.google.com".
129+
130+
These `rules` only apply to the host resolver.
117131

118132
### --ignore-certificate-errors
119133

@@ -338,6 +352,22 @@ Affects the default output directory of [v8.setHeapSnapshotNearHeapLimit](https:
338352

339353
Disable exposition of [Navigator API][] on the global scope from Node.js.
340354

355+
## Chromium Flags
356+
357+
There isn't a documented list of all Chromium switches, but there are a few ways to find them.
358+
359+
The easiest way is through Chromium's flags page, which you can access at `about://flags`. These flags don't directly match switch names, but they show up in the process's command-line arguments.
360+
361+
To see these arguments, enable a flag in `about://flags`, then go to `about://version` in Chromium. You'll find a list of command-line arguments, including `--flag-switches-begin --your --list --flag-switches-end`, which contains the list of your flag enabled switches.
362+
363+
Most flags are included as part of `--enable-features=`, but some are standalone switches, like `--enable-experimental-web-platform-features`.
364+
365+
A complete list of flags exists in [Chromium's flag metadata page](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/flag-metadata.json), but this list includes platform, environment and GPU specific, expired and potentially non-functional flags, so many of them might not always work in every situation.
366+
367+
Keep in mind that standalone switches can sometimes be split into individual features, so there's no fully complete list of switches.
368+
369+
Finally, you'll need to ensure that the version of Chromium in Electron matches the version of the browser you're using to cross-reference the switches.
370+
341371
[app]: app.md
342372
[append-switch]: command-line.md#commandlineappendswitchswitch-value
343373
[debugging-main-process]: ../tutorial/debugging-main-process.md

docs/latest/api/context-bridge.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ has been included below for completeness:
162162
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple ||| See the linked document on cloneable types |
163163
| `Element` | Complex ||| Prototype modifications are dropped. Sending custom elements will not work. |
164164
| `Blob` | Complex ||| N/A |
165+
| `VideoFrame` | Complex ||| N/A |
165166
| `Symbol` | N/A ||| Symbols cannot be copied across contexts so they are dropped |
166167

167168
If the type you care about is not in the above table, it is probably not supported.

docs/latest/api/desktop-capturer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`Desktop
109109

110110
## Caveats
111111

112+
`desktopCapturer.getSources(options)` only returns a single source on Linux when using Pipewire.
113+
114+
PipeWire supports a single capture for both screens and windows. If you request the window and screen type, the selected source will be returned as a window capture.
115+
112116
`navigator.mediaDevices.getUserMedia` does not work on macOS for audio capture due to a fundamental limitation whereby apps that want to access the system's audio require a [signed kernel extension](https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/KernelExtensions/KernelExtensions.html). Chromium, and by extension Electron, does not provide this.
113117

114118
It is possible to circumvent this limitation by capturing system audio with another macOS app like Soundflower and passing it through a virtual audio input device. This virtual device can then be queried with `navigator.mediaDevices.getUserMedia`.
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
---
2+
title: "ColorSpace Object"
3+
description: ""
4+
slug: color-space
5+
hide_title: false
6+
---
7+
8+
# ColorSpace Object
9+
10+
* `primaries` string - The color primaries of the color space. Can be one of the following values:
11+
* `bt709` - BT709 primaries (also used for sRGB)
12+
* `bt470m` - BT470M primaries
13+
* `bt470bg` - BT470BG primaries
14+
* `smpte170m` - SMPTE170M primaries
15+
* `smpte240m` - SMPTE240M primaries
16+
* `film` - Film primaries
17+
* `bt2020` - BT2020 primaries
18+
* `smptest428-1` - SMPTEST428-1 primaries
19+
* `smptest431-2` - SMPTEST431-2 primaries
20+
* `p3` - P3 primaries
21+
* `xyz-d50` - XYZ D50 primaries
22+
* `adobe-rgb` - Adobe RGB primaries
23+
* `apple-generic-rgb` - Apple Generic RGB primaries
24+
* `wide-gamut-color-spin` - Wide Gamut Color Spin primaries
25+
* `ebu-3213-e` - EBU 3213-E primaries
26+
* `custom` - Custom primaries
27+
* `invalid` - Invalid primaries
28+
29+
* `transfer` string - The transfer function of the color space. Can be one of the following values:
30+
* `bt709` - BT709 transfer function
31+
* `bt709-apple` - BT709 Apple transfer function
32+
* `gamma18` - Gamma 1.8 transfer function
33+
* `gamma22` - Gamma 2.2 transfer function
34+
* `gamma24` - Gamma 2.4 transfer function
35+
* `gamma28` - Gamma 2.8 transfer function
36+
* `smpte170m` - SMPTE170M transfer function
37+
* `smpte240m` - SMPTE240M transfer function
38+
* `linear` - Linear transfer function
39+
* `log` - Log transfer function
40+
* `log-sqrt` - Log Square Root transfer function
41+
* `iec61966-2-4` - IEC61966-2-4 transfer function
42+
* `bt1361-ecg` - BT1361 ECG transfer function
43+
* `srgb` - sRGB transfer function
44+
* `bt2020-10` - BT2020-10 transfer function
45+
* `bt2020-12` - BT2020-12 transfer function
46+
* `pq` - PQ (Perceptual Quantizer) transfer function
47+
* `smptest428-1` - SMPTEST428-1 transfer function
48+
* `hlg` - HLG (Hybrid Log-Gamma) transfer function
49+
* `srgb-hdr` - sRGB HDR transfer function
50+
* `linear-hdr` - Linear HDR transfer function
51+
* `custom` - Custom transfer function
52+
* `custom-hdr` - Custom HDR transfer function
53+
* `scrgb-linear-80-nits` - scRGB Linear 80 nits transfer function
54+
* `invalid` - Invalid transfer function
55+
56+
* `matrix` string - The color matrix of the color space. Can be one of the following values:
57+
* `rgb` - RGB matrix
58+
* `bt709` - BT709 matrix
59+
* `fcc` - FCC matrix
60+
* `bt470bg` - BT470BG matrix
61+
* `smpte170m` - SMPTE170M matrix
62+
* `smpte240m` - SMPTE240M matrix
63+
* `ycocg` - YCoCg matrix
64+
* `bt2020-ncl` - BT2020 NCL matrix
65+
* `ydzdx` - YDzDx matrix
66+
* `gbr` - GBR matrix
67+
* `invalid` - Invalid matrix
68+
69+
* `range` string - The color range of the color space. Can be one of the following values:
70+
* `limited` - Limited color range (RGB values ranging from 16 to 235)
71+
* `full` - Full color range (RGB values from 0 to 255)
72+
* `derived` - Range defined by the transfer function and matrix
73+
* `invalid` - Invalid range
74+
75+
## Common `ColorSpace` definitions
76+
77+
### Standard Color Spaces
78+
79+
**sRGB**:
80+
81+
```js
82+
const cs = {
83+
primaries: 'bt709',
84+
transfer: 'srgb',
85+
matrix: 'rgb',
86+
range: 'full'
87+
}
88+
```
89+
90+
**Display P3**:
91+
92+
```js
93+
const cs = {
94+
primaries: 'p3',
95+
transfer: 'srgb',
96+
matrix: 'rgb',
97+
range: 'full'
98+
}
99+
```
100+
101+
**XYZ D50**:
102+
103+
```js
104+
const cs = {
105+
primaries: 'xyz-d50',
106+
transfer: 'linear',
107+
matrix: 'rgb',
108+
range: 'full'
109+
}
110+
```
111+
112+
### HDR Color Spaces
113+
114+
**Extended sRGB** (extends sRGB to all real values):
115+
116+
```js
117+
const cs = {
118+
primaries: 'bt709',
119+
transfer: 'srgb-hdr',
120+
matrix: 'rgb',
121+
range: 'full'
122+
}
123+
```
124+
125+
**scRGB Linear** (linear transfer function for all real values):
126+
127+
```js
128+
const cs = {
129+
primaries: 'bt709',
130+
transfer: 'linear-hdr',
131+
matrix: 'rgb',
132+
range: 'full'
133+
}
134+
```
135+
136+
**scRGB Linear 80 Nits** (with an SDR white level of 80 nits):
137+
138+
```js
139+
const cs = {
140+
primaries: 'bt709',
141+
transfer: 'scrgb-linear-80-nits',
142+
matrix: 'rgb',
143+
range: 'full'
144+
}
145+
```
146+
147+
**HDR10** (BT.2020 primaries with PQ transfer function):
148+
149+
```js
150+
const cs = {
151+
primaries: 'bt2020',
152+
transfer: 'pq',
153+
matrix: 'rgb',
154+
range: 'full'
155+
}
156+
```
157+
158+
**HLG** (BT.2020 primaries with HLG transfer function):
159+
160+
```js
161+
const cs = {
162+
primaries: 'bt2020',
163+
transfer: 'hlg',
164+
matrix: 'rgb',
165+
range: 'full'
166+
}
167+
```
168+
169+
### Video Color Spaces
170+
171+
**Rec. 601** (SDTV):
172+
173+
```js
174+
const cs = {
175+
primaries: 'smpte170m',
176+
transfer: 'smpte170m',
177+
matrix: 'smpte170m',
178+
range: 'limited'
179+
}
180+
```
181+
182+
**Rec. 709** (HDTV):
183+
184+
```js
185+
const cs = {
186+
primaries: 'bt709',
187+
transfer: 'bt709',
188+
matrix: 'bt709',
189+
range: 'limited'
190+
}
191+
```
192+
193+
**JPEG** (typical color space for JPEG images):
194+
195+
```js
196+
const cs = {
197+
primaries: 'bt709',
198+
transfer: 'srgb',
199+
matrix: 'smpte170m',
200+
range: 'full'
201+
}
202+
```

docs/latest/api/structures/offscreen-shared-texture.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,20 @@ hide_title: false
99

1010
* `textureInfo` Object - The shared texture info.
1111
* `widgetType` string - The widget type of the texture. Can be `popup` or `frame`.
12-
* `pixelFormat` string - The pixel format of the texture. Can be `rgba` or `bgra`.
12+
* `pixelFormat` string - The pixel format of the texture.
13+
* `rgba` - The texture format is 8-bit unorm RGBA.
14+
* `bgra` - The texture format is 8-bit unorm BGRA.
15+
* `rgbaf16` - The texture format is 16-bit float RGBA.
1316
* `codedSize` [Size](size.md) - The full dimensions of the video frame.
14-
* `visibleRect` [Rectangle](rectangle.md) - A subsection of [0, 0, codedSize.width(), codedSize.height()]. In OSR case, it is expected to have the full section area.
17+
* `colorSpace` [ColorSpace](color-space.md) - The color space of the video frame.
18+
* `visibleRect` [Rectangle](rectangle.md) - A subsection of [0, 0, codedSize.width, codedSize.height]. In OSR case, it is expected to have the full section area.
1519
* `contentRect` [Rectangle](rectangle.md) - The region of the video frame that capturer would like to populate. In OSR case, it is the same with `dirtyRect` that needs to be painted.
1620
* `timestamp` number - The time in microseconds since the capture start.
1721
* `metadata` Object - Extra metadata. See comments in src\media\base\video_frame_metadata.h for accurate details.
1822
* `captureUpdateRect` [Rectangle](rectangle.md) (optional) - Updated area of frame, can be considered as the `dirty` area.
1923
* `regionCaptureRect` [Rectangle](rectangle.md) (optional) - May reflect the frame's contents origin if region capture is used internally.
2024
* `sourceSize` [Rectangle](rectangle.md) (optional) - Full size of the source frame.
2125
* `frameCount` number (optional) - The increasing count of captured frame. May contain gaps if frames are dropped between two consecutively received frames.
22-
* `sharedTextureHandle` Buffer _Windows_ _macOS_ - The handle to the shared texture.
23-
* `planes` Object[] _Linux_ - Each plane's info of the shared texture.
24-
* `stride` number - The strides and offsets in bytes to be used when accessing the buffers via a memory mapping. One per plane per entry.
25-
* `offset` number - The strides and offsets in bytes to be used when accessing the buffers via a memory mapping. One per plane per entry.
26-
* `size` number - Size in bytes of the plane. This is necessary to map the buffers.
27-
* `fd` number - File descriptor for the underlying memory object (usually dmabuf).
28-
* `modifier` string _Linux_ - The modifier is retrieved from GBM library and passed to EGL driver.
26+
* `handle` [SharedTextureHandle](shared-texture-handle.md) - The shared texture handle data.
2927
* `release` Function - Release the resources. The `texture` cannot be directly passed to another process, users need to maintain texture lifecycles in
30-
main process, but it is safe to pass the `textureInfo` to another process. Only a limited number of textures can exist at the same time, so it's important
31-
that you call `texture.release()` as soon as you're done with the texture.
28+
main process, but it is safe to pass the `textureInfo` to another process. Only a limited number of textures can exist at the same time, so it's important that you call `texture.release()` as soon as you're done with the texture.

docs/latest/api/structures/render-process-gone-details.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ hide_title: false
1515
* `oom` - Process ran out of memory
1616
* `launch-failed` - Process never successfully launched
1717
* `integrity-failure` - Windows code integrity checks failed
18+
* `memory-eviction` - Process proactively terminated to prevent a future out-of-memory (OOM) situation
1819
* `exitCode` Integer - The exit code of the process, unless `reason` is
1920
`launch-failed`, in which case `exitCode` will be a platform-specific
2021
launch failure error code.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "SharedTextureHandle Object"
3+
description: ""
4+
slug: shared-texture-handle
5+
hide_title: false
6+
---
7+
8+
# SharedTextureHandle Object
9+
10+
* `ntHandle` Buffer (optional) _Windows_ - NT HANDLE holds the shared texture. Note that this NT HANDLE is local to current process.
11+
* `ioSurface` Buffer (optional) _macOS_ - IOSurfaceRef holds the shared texture. Note that this IOSurface is local to current process (not global).
12+
* `nativePixmap` Object (optional) _Linux_ - Structure contains planes of shared texture.
13+
* `planes` Object[] _Linux_ - Each plane's info of the shared texture.
14+
* `stride` number - The strides and offsets in bytes to be used when accessing the buffers via a memory mapping. One per plane per entry.
15+
* `offset` number - The strides and offsets in bytes to be used when accessing the buffers via a memory mapping. One per plane per entry.
16+
* `size` number - Size in bytes of the plane. This is necessary to map the buffers.
17+
* `fd` number - File descriptor for the underlying memory object (usually dmabuf).
18+
* `modifier` string _Linux_ - The modifier is retrieved from GBM library and passed to EGL driver.
19+
* `supportsZeroCopyWebGpuImport` boolean _Linux_ - Indicates whether supports zero copy import to WebGPU.

docs/latest/api/structures/usb-device.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,36 @@ hide_title: false
77

88
# USBDevice Object
99

10+
* `configuration` Object (optional) - A [USBConfiguration](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration) object containing information about the currently selected configuration of a USB device.
11+
* `configurationValue` Integer - the configuration value of this configuration.
12+
* `configurationName` string - the name provided by the device to describe this configuration.
13+
* `interfaces` Object[] - An array of [USBInterface](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface) objects containing information about an interface provided by the USB device.
14+
* `interfaceNumber` Integer - the interface number of this interface.
15+
* `alternate` Object - the currently selected alternative configuration of this interface.
16+
* `alternateSetting` Integer - the alternate setting number of this interface.
17+
* `interfaceClass` Integer - the class of this interface. See [USB.org](https://www.usb.org/defined-class-codes) for class code descriptions.
18+
* `interfaceSubclass` Integer - the subclass of this interface.
19+
* `interfaceProtocol` Integer - the protocol supported by this interface.
20+
* `interfaceName` string (optional) - the name of the interface, if one is provided by the device.
21+
* `endpoints` Object[] - an array containing instances of the [USBEndpoint interface](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint) describing each of the endpoints that are part of this interface.
22+
* `endpointNumber` Integer - this endpoint's "endpoint number" which is a value from 1 to 15.
23+
* `direction` string - the direction in which this endpoint transfers data - can be either 'in' or 'out'.
24+
* `type` string - the type of this endpoint - can be either 'bulk', 'interrupt', or 'isochronous'.
25+
* `packetSize` Integer - the size of the packets that data sent through this endpoint will be divided into.
26+
* `alternates` Object[] - an array containing instances of the [USBAlternateInterface](https://developer.mozilla.org/en-US/docs/Web/API/USBAlternateInterface) interface describing each of the alternative configurations possible for this interface.
27+
* `configurations` Object[] - An array of [USBConfiguration](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration) interfaces for controlling a paired USB device.
28+
* `deviceClass` Integer - The device class for the communication interface supported by the device.
1029
* `deviceId` string - Unique identifier for the device.
11-
* `vendorId` Integer - The USB vendor ID.
12-
* `productId` Integer - The USB product ID.
13-
* `productName` string (optional) - Name of the device.
14-
* `serialNumber` string (optional) - The USB device serial number.
15-
* `manufacturerName` string (optional) - The manufacturer name of the device.
16-
* `usbVersionMajor` Integer - The USB protocol major version supported by the device
17-
* `usbVersionMinor` Integer - The USB protocol minor version supported by the device
18-
* `usbVersionSubminor` Integer - The USB protocol subminor version supported by the device
19-
* `deviceClass` Integer - The device class for the communication interface supported by the device
20-
* `deviceSubclass` Integer - The device subclass for the communication interface supported by the device
21-
* `deviceProtocol` Integer - The device protocol for the communication interface supported by the device
30+
* `deviceProtocol` Integer - The device protocol for the communication interface supported by the device.
31+
* `deviceSubclass` Integer - The device subclass for the communication interface supported by the device.
2232
* `deviceVersionMajor` Integer - The major version number of the device as defined by the device manufacturer.
2333
* `deviceVersionMinor` Integer - The minor version number of the device as defined by the device manufacturer.
2434
* `deviceVersionSubminor` Integer - The subminor version number of the device as defined by the device manufacturer.
35+
* `manufacturerName` string (optional) - The manufacturer name of the device.
36+
* `productId` Integer - The USB product ID.
37+
* `productName` string (optional) - Name of the device.
38+
* `serialNumber` string (optional) - The USB device serial number.
39+
* `usbVersionMajor` Integer - The USB protocol major version supported by the device.
40+
* `usbVersionMinor` Integer - The USB protocol minor version supported by the device.
41+
* `usbVersionSubminor` Integer - The USB protocol subminor version supported by the device.
42+
* `vendorId` Integer - The USB vendor ID.

0 commit comments

Comments
 (0)