Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/latest/.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d0661e765b698323bca09f86690519d17adaa33f
2511f7812078229065849db2777e3594b5a6b171
32 changes: 27 additions & 5 deletions docs/latest/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ Returns:

Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`
`tabbingIdentifier`.

You must create a window in this handler in order for macOS tabbing to work as expected.

### Event: 'browser-window-blur'

Expand Down Expand Up @@ -639,7 +641,7 @@ Returns `string` - The current application directory.
Returns `string` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.

If `app.getPath('logs')` is called without called `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.
If `app.getPath('logs')` is called without calling `app.setAppLogsPath()` being called first, a default log directory will be created equivalent to calling `app.setAppLogsPath()` without a `path` parameter.

### `app.getFileIcon(path[, options])`

Expand All @@ -654,7 +656,7 @@ Returns `Promise<NativeImage>` - fulfilled with the app's icon, which is a [Nati

Fetches a path's associated icon.

On _Windows_, there a 2 kinds of icons:
On _Windows_, there are 2 kinds of icons:

* Icons associated with certain file extensions, like `.mp3`, `.png`, etc.
* Icons inside the file itself, like `.exe`, `.dll`, `.ico`.
Expand Down Expand Up @@ -770,7 +772,7 @@ app.getPreferredSystemLanguages() // ['fr-CA', 'en-US', 'zh-Hans-FI', 'es-419']

Both the available languages and regions and the possible return values differ between the two operating systems.

As can be seen with the example above, on Windows, it is possible that a preferred system language has no country code, and that one of the preferred system languages corresponds with the language used for the regional format. On macOS, the region serves more as a default country code: the user doesn't need to have Finnish as a preferred language to use Finland as the region,and the country code `FI` is used as the country code for preferred system languages that do not have associated countries in the language name.
As can be seen with the example above, on Windows, it is possible that a preferred system language has no country code, and that one of the preferred system languages corresponds with the language used for the regional format. On macOS, the region serves more as a default country code: the user doesn't need to have Finnish as a preferred language to use Finland as the region, and the country code `FI` is used as the country code for preferred system languages that do not have associated countries in the language name.

### `app.addRecentDocument(path)` _macOS_ _Windows_

Expand Down Expand Up @@ -1128,6 +1130,19 @@ Updates the current activity if its type matches `type`, merging the entries fro

Changes the [Application User Model ID][app-user-model-id] to `id`.

### `app.setToastActivatorCLSID(id)` _Windows_

* `id` string

Changes the [Toast Activator CLSID][toast-activator-clsid] to `id`. If one is not set via this method, it will be randomly generated for the app.

* The value must be a valid GUID/CLSID in one of the following forms:
* Canonical brace-wrapped: `{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}` (preferred)
* Canonical without braces: `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` (braces will be added automatically)
* Hex digits are case-insensitive.

This method should be called early (before showing notifications) so the value is baked into the registration/shortcut. Supplying an empty string or an unparsable value throws and leaves the existing (or generated) CLSID unchanged. If this method is never called, a random CLSID is generated once per run and exposed via `app.toastActivatorCLSID`.

### `app.setActivationPolicy(policy)` _macOS_

* `policy` string - Can be 'regular', 'accessory', or 'prohibited'.
Expand Down Expand Up @@ -1232,7 +1247,7 @@ Returns `boolean` - whether hardware acceleration is currently enabled.
### `app.disableDomainBlockingFor3DAPIs()`

By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per
domain basis if the GPU processes crashes too frequently. This function
domain basis if the GPU process crashes too frequently. This function
disables that behavior.

This method can only be called before app is ready.
Expand Down Expand Up @@ -1291,6 +1306,8 @@ For `infoType` equal to `basic`:

Using `basic` should be preferred if only basic information like `vendorId` or `deviceId` is needed.

Promise is rejected if the GPU is completely disabled, i.e. no hardware and software implementations are available.

### `app.setBadgeCount([count])` _Linux_ _macOS_

* `count` Integer (optional) - If a value is provided, set the badge to the provided value otherwise, on macOS, display a plain white dot (e.g. unknown number of notifications). On Linux, if a value is not provided the badge will not display.
Expand Down Expand Up @@ -1708,8 +1725,13 @@ platforms) that allows you to perform actions on your app icon in the user's doc

A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.

### `app.toastActivatorCLSID` _Windows_ _Readonly_

A `string` property that returns the app's [Toast Activator CLSID][toast-activator-clsid].

[tasks]:https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/packager
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
Expand Down
31 changes: 26 additions & 5 deletions docs/latest/api/auto-updater.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ update process. Apps that need to disable ATS can add the

### Windows

On Windows, you have to install your app into a user's machine before you can
use the `autoUpdater`, so it is recommended that you use
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib] to generate a Windows installer.
On Windows, the `autoUpdater` module automatically selects the appropriate update mechanism
based on how your app is packaged:

* **MSIX packages**: If your app is running as an MSIX package (created with [electron-windows-msix][msix-lib] and detected via [`process.windowsStore`](process.md#processwindowsstore-readonly)),
the module uses the MSIX updater, which supports direct MSIX file links and JSON update feeds.
* **Squirrel.Windows**: For apps installed via traditional installers (created with
[electron-winstaller][installer-lib] or [Electron Forge's Squirrel.Windows maker][electron-forge-lib]),
the module uses Squirrel.Windows for updates.

You don't need to configure which updater to use; Electron automatically detects the packaging
format and uses the appropriate one.

#### Squirrel.Windows

Apps built with Squirrel.Windows will trigger [custom launch events](https://github.com/Squirrel/Squirrel.Windows/blob/51f5e2cb01add79280a53d51e8d0cfa20f8c9f9f/docs/using/custom-squirrel-events-non-cs.md#application-startup-commands)
that must be handled by your Electron application to ensure proper setup and teardown.
Expand All @@ -62,6 +72,14 @@ The installer generated with Squirrel.Windows will create a shortcut icon with a
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
not be able to pin your app properly in task bar.

#### MSIX Packages

When your app is packaged as an MSIX, the `autoUpdater` module provides additional
functionality:

* Use the `allowAnyVersion` option in `setFeedURL()` to allow updates to older versions (downgrades)
* Support for direct MSIX file links or JSON update feeds (similar to Squirrel.Mac format)

## Events

The `autoUpdater` object emits the following events:
Expand Down Expand Up @@ -99,7 +117,7 @@ Returns:

Emitted when an update has been downloaded.

On Windows only `releaseName` is available.
With Squirrel.Windows only `releaseName` is available.

> [!NOTE]
> It is not strictly necessary to handle this event. A successfully
Expand Down Expand Up @@ -131,10 +149,12 @@ changes:
```

* `options` Object
* `url` string
* `url` string - The update server URL. For _Windows_ MSIX, this can be either a direct link to an MSIX file (e.g., `https://example.com/update.msix`) or a JSON endpoint that returns update information (see the [Squirrel.Mac][squirrel-mac] README for more information).
* `headers` Record\<string, string\> (optional) _macOS_ - HTTP request headers.
* `serverType` string (optional) _macOS_ - Can be `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.
* `allowAnyVersion` boolean (optional) _Windows_ - If `true`, allows downgrades to older versions for MSIX packages.
Defaults to `false`.

Sets the `url` and initialize the auto updater.

Expand Down Expand Up @@ -171,3 +191,4 @@ closed.
[electron-forge-lib]: https://www.electronforge.io/config/makers/squirrel.windows
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[msix-lib]: https://github.com/electron-userland/electron-windows-msix
14 changes: 12 additions & 2 deletions docs/latest/api/base-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ Emitted when the window has closed a sheet.

#### Event: 'new-window-for-tab' _macOS_

Emitted when the native new tab button is clicked.
Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`.

You must create a window in this handler in order for macOS tabbing to work as expected.

#### Event: 'system-context-menu' _Windows_ _Linux_

Expand Down Expand Up @@ -763,6 +767,9 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `
> [!NOTE]
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.

> [!NOTE]
> On Wayland, this method will return `{ x: 0, y: 0, ... }` as introspecting or programmatically changing the global window coordinates is prohibited.

#### `win.getBackgroundColor()`

Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format.
Expand Down Expand Up @@ -976,6 +983,9 @@ Moves window to `x` and `y`.

Returns `Integer[]` - Contains the window's current position.

> [!NOTE]
> On Wayland, this method will return `[0, 0]` as introspecting or programmatically changing the global window coordinates is prohibited.

#### `win.setTitle(title)`

* `title` string
Expand Down Expand Up @@ -1048,7 +1058,7 @@ under this mode apps can choose to optimize their UI for tablets, such as
enlarging the titlebar and hiding titlebar buttons.

This API returns whether the window is in tablet mode, and the `resize` event
can be be used to listen to changes to tablet mode.
can be used to listen to changes to tablet mode.

#### `win.getMediaSourceId()`

Expand Down
14 changes: 12 additions & 2 deletions docs/latest/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,11 @@ Emitted when the window has closed a sheet.

#### Event: 'new-window-for-tab' _macOS_

Emitted when the native new tab button is clicked.
Emitted when the user clicks the native macOS new tab button. The new
tab button is only visible if the current `BrowserWindow` has a
`tabbingIdentifier`.

You must create a window in this handler in order for macOS tabbing to work as expected.

#### Event: 'system-context-menu' _Windows_ _Linux_

Expand Down Expand Up @@ -856,6 +860,9 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `
> [!NOTE]
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.

> [!NOTE]
> On Wayland, this method will return `{ x: 0, y: 0, ... }` as introspecting or programmatically changing the global window coordinates is prohibited.

#### `win.getBackgroundColor()`

Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format.
Expand Down Expand Up @@ -1069,6 +1076,9 @@ Moves window to `x` and `y`.

Returns `Integer[]` - Contains the window's current position.

> [!NOTE]
> On Wayland, this method will return `[0, 0]` as introspecting or programmatically changing the global window coordinates is prohibited.

#### `win.setTitle(title)`

* `title` string
Expand Down Expand Up @@ -1139,7 +1149,7 @@ under this mode apps can choose to optimize their UI for tablets, such as
enlarging the titlebar and hiding titlebar buttons.

This API returns whether the window is in tablet mode, and the `resize` event
can be be used to listen to changes to tablet mode.
can be used to listen to changes to tablet mode.

#### `win.getMediaSourceId()`

Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/client-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ will not be allowed. The `finish` event is emitted just after the end operation.
Cancels an ongoing HTTP transaction. If the request has already emitted the
`close` event, the abort operation will have no effect. Otherwise an ongoing
event will emit `abort` and `close` events. Additionally, if there is an ongoing
response object,it will emit the `aborted` event.
response object, it will emit the `aborted` event.

#### `request.followRedirect()`

Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hide_title: false
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) _Deprecated_ (non-sandboxed only)

> [!NOTE]
> Using the `clipoard` API from the renderer process is deprecated.
> Using the `clipboard` API from the renderer process is deprecated.

> [!IMPORTANT]
> If you want to call this API from a renderer process,
Expand Down
9 changes: 8 additions & 1 deletion docs/latest/api/command-line-switches.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Enables net log events to be saved and writes them to `path`.
Sets the verbosity of logging when used together with `--enable-logging`.
`N` should be one of [Chrome's LogSeverities][severities].

Note that two complimentary logging mechanisms in Chromium -- `LOG()`
Note that two complementary logging mechanisms in Chromium -- `LOG()`
and `VLOG()` -- are controlled by different switches. `--log-level`
controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()`
messages. So you may want to use a combination of these three switches
Expand Down Expand Up @@ -373,6 +373,13 @@ Keep in mind that standalone switches can sometimes be split into individual fea

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.

### Chromium features relevant to Electron apps

* `AlwaysLogLOAFURL`: enables script attribution for
[`long-animation-frame`](https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Long_animation_frame_timing)
`PerformanceObserver` events for non-http(s), non-data, non-blob URLs (such as `file:` or custom
protocol URLs).

[app]: app.md
[append-switch]: command-line.md#commandlineappendswitchswitch-value
[debugging-main-process]: ../tutorial/debugging-main-process.md
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/corner-smoothing-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Use the `system-ui` keyword to match the smoothness to the OS design language.
| Value: | `60%` | `0%` |
| Example: | ![A rectangle with round corners whose smoothness matches macOS](../images/corner-smoothing-example-60.svg) | ![A rectangle with round corners whose smoothness matches Windows and Linux](../images/corner-smoothing-example-0.svg) |

### Controlling availibility
### Controlling availability

This CSS rule can be disabled using the Blink feature flag `ElectronCSSCornerSmoothing`.

Expand Down
Loading