Skip to content

Commit

Permalink
chore: manually update website content (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Nov 15, 2024
1 parent d37d744 commit 9ee726b
Show file tree
Hide file tree
Showing 59 changed files with 1,258 additions and 362 deletions.
1 change: 1 addition & 0 deletions docs/latest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ an issue:
* [Offline/Online Detection](latest/tutorial/online-offline-events.md)
* [Represented File for macOS BrowserWindows](latest/tutorial/represented-file.md)
* [Native File Drag & Drop](latest/tutorial/native-file-drag-drop.md)
* [Navigation History](latest/tutorial/navigation-history.md)
* [Offscreen Rendering](latest/tutorial/offscreen-rendering.md)
* [Dark Mode](latest/tutorial/dark-mode.md)
* [Web embeds in Electron](latest/tutorial/web-embeds.md)
Expand Down
34 changes: 33 additions & 1 deletion docs/latest/api/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Returns:
* `launch-failed` - Process never successfully launched
* `integrity-failure` - Windows code integrity checks failed
* `exitCode` number - The exit code for the process
(e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows).
(e.g. status from waitpid if on POSIX, from GetExitCodeProcess on Windows).
* `serviceName` string (optional) - The non-localized name of the process.
* `name` string (optional) - The name of the process.
Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc.
Expand Down Expand Up @@ -1497,6 +1497,38 @@ This method can only be called after app is ready.

Returns `Promise<string>` - Resolves with the proxy information for `url` that will be used when attempting to make requests using [Net](latest/api/net.md) in the [utility process](latest/glossary.md#utility-process).

### `app.setClientCertRequestPasswordHandler(handler)` _Linux_

* `handler` Function\<Promise\<string\>\>
* `clientCertRequestParams` Object
* `hostname` string - the hostname of the site requiring a client certificate
* `tokenName` string - the token (or slot) name of the cryptographic device
* `isRetry` boolean - whether there have been previous failed attempts at prompting the password

Returns `Promise<string>` - Resolves with the password

The handler is called when a password is needed to unlock a client certificate for
`hostname`.

```js
const { app } = require('electron')

async function passwordPromptUI (text) {
return new Promise((resolve, reject) => {
// display UI to prompt user for password
// ...
// ...
resolve('the password')
})
}

app.setClientCertRequestPasswordHandler(async ({ hostname, tokenName, isRetry }) => {
const text = `Please sign in to ${tokenName} to authenticate to ${hostname} with your certificate`
const password = await passwordPromptUI(text)
return password
})
```

## Properties

### `app.accessibilitySupportEnabled` _macOS_ _Windows_
Expand Down
17 changes: 12 additions & 5 deletions docs/latest/api/base-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ It creates a new `BaseWindow` with native properties as set by the `options`.
* `show` boolean (optional) - Whether window should be shown when created. Default is
`true`.
* `frame` boolean (optional) - Specify `false` to create a
[frameless window](latest/tutorial/window-customization.md#create-frameless-windows). Default is `true`.
[frameless window](latest/tutorial/custom-window-styles.md#frameless-windows). Default is `true`.
* `parent` BaseWindow (optional) - Specify parent window. Default is `null`.
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
Expand All @@ -154,7 +154,7 @@ It creates a new `BaseWindow` with native properties as set by the `options`.
is only implemented on Windows and macOS.
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` boolean (optional) - Makes the window [transparent](latest/tutorial/window-customization.md#create-transparent-windows).
* `transparent` boolean (optional) - Makes the window [transparent](latest/tutorial/custom-window-styles.md#transparent-windows).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` string (optional) - The type of window, default is normal window. See more about
this below.
Expand Down Expand Up @@ -227,8 +227,7 @@ Possible values are:
-webkit-app-region: drag. This type is commonly used for splash screens.
* The `notification` type creates a window that behaves like a system notification.
* On macOS, possible types are `desktop`, `textured`, `panel`.
* The `textured` type adds metal gradient appearance
(`NSWindowStyleMaskTexturedBackground`).
* The `textured` type adds metal gradient appearance. This option is **deprecated**.
* The `desktop` type places the window at the desktop background window level
(`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
Expand Down Expand Up @@ -287,10 +286,18 @@ or session log off.

#### Event: 'blur'

Returns:

* `event` Event

Emitted when the window loses focus.

#### Event: 'focus'

Returns:

* `event` Event

Emitted when the window gains focus.

#### Event: 'show'
Expand Down Expand Up @@ -640,7 +647,7 @@ Sets the content view of the window.

#### `win.getContentView()`

Returns [View](latest/api/view.md) - The content view of the window.
Returns [`View`](latest/api/view.md) - The content view of the window.

#### `win.destroy()`

Expand Down
6 changes: 5 additions & 1 deletion docs/latest/api/browser-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ deprecated:
[browserWindow](latest/api/browser-window.md) has disabled `backgroundThrottling` then
frames will be drawn and swapped for the whole window and other
[webContents](latest/api/web-contents.md) displayed by it. Defaults to `true`.
* `offscreen` boolean (optional) - Whether to enable offscreen rendering for the browser
* `offscreen` Object | boolean (optional) - Whether to enable offscreen rendering for the browser
window. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `useSharedTexture` boolean (optional) _Experimental_ - Whether to use GPU shared texture for accelerated
paint event. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `contextIsolation` boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `true`. The context that the `preload` script runs in will only have
Expand Down
6 changes: 5 additions & 1 deletion docs/latest/api/browser-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,14 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
[browserWindow](latest/api/browser-window.md) has disabled `backgroundThrottling` then
frames will be drawn and swapped for the whole window and other
[webContents](latest/api/web-contents.md) displayed by it. Defaults to `true`.
* `offscreen` boolean (optional) - Whether to enable offscreen rendering for the browser
* `offscreen` Object | boolean (optional) - Whether to enable offscreen rendering for the browser
window. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `useSharedTexture` boolean (optional) _Experimental_ - Whether to use GPU shared texture for accelerated
paint event. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `contextIsolation` boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `true`. The context that the `preload` script runs in will only have
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 @@ -60,7 +60,7 @@ following properties:
[`request.followRedirect`](#requestfollowredirect) is invoked synchronously
during the [`redirect`](#event-redirect) event. Defaults to `follow`.
* `origin` string (optional) - The origin URL of the request.
* `referrerPolicy` string (optional) - can be `""`, `no-referrer`,
* `referrerPolicy` string (optional) - can be "", `no-referrer`,
`no-referrer-when-downgrade`, `origin`, `origin-when-cross-origin`,
`unsafe-url`, `same-origin`, `strict-origin`, or
`strict-origin-when-cross-origin`. Defaults to
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/command-line-switches.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Without `*` prefix the URL has to match exactly.

### --disable-ntlm-v2

Disables NTLM v2 for posix platforms, no effect elsewhere.
Disables NTLM v2 for POSIX platforms, no effect elsewhere.

### --disable-http-cache

Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/dock.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ Returns `Menu | null` - The application's [dock menu][dock-menu].

Sets the `image` associated with this dock icon.

[dock-menu]: https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
[dock-menu]: https://developer.apple.com/design/human-interface-guidelines/dock-menus
2 changes: 1 addition & 1 deletion docs/latest/api/incoming-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Emitted when a request has been canceled during an ongoing HTTP transaction.

Returns:

`error` Error - Typically holds an error string identifying failure root cause.
* `error` Error - Typically holds an error string identifying failure root cause.

Emitted when an error was encountered while streaming response data events. For
instance, if the server closes the underlying while the response is still
Expand Down
17 changes: 13 additions & 4 deletions docs/latest/api/navigation-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ Returns `Integer` - The index of the current page, from which we would go back/f

* `index` Integer

Returns `Object`:

* `url` string - The URL of the navigation entry at the given index.
* `title` string - The page title of the navigation entry at the given index.
Returns [`NavigationEntry`](latest/api/structures/navigation-entry.md) - Navigation entry at the given index.

If index is out of bounds (greater than history length or less than 0), null will be returned.

Expand All @@ -72,3 +69,15 @@ Navigates to the specified offset from the current entry.
#### `navigationHistory.length()`

Returns `Integer` - History length.

#### `navigationHistory.removeEntryAtIndex(index)`

* `index` Integer

Removes the navigation entry at the given index. Can't remove entry at the "current active index".

Returns `boolean` - Whether the navigation entry was removed from the webContents history.

#### `navigationHistory.getAllEntries()`

Returns [`NavigationEntry[]`](latest/api/structures/navigation-entry.md) - WebContents complete history.
2 changes: 1 addition & 1 deletion docs/latest/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ won't be able to connect to remote sites. However, a return value of
whether a particular connection attempt to a particular remote site
will be successful.

#### `net.resolveHost(host, [options])`
### `net.resolveHost(host, [options])`

* `host` string - Hostname to resolve.
* `options` Object (optional)
Expand Down
23 changes: 15 additions & 8 deletions docs/latest/api/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ Returns:
* `event` Event
* `details` Object
* `deviceList` [HIDDevice[]](latest/api/structures/hid-device.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this event.
May be `null` if accessed after the frame has either navigated or been destroyed.
* `callback` Function
* `deviceId` string | null (optional)

Expand Down Expand Up @@ -339,7 +340,8 @@ Returns:
* `event` Event
* `details` Object
* `device` [HIDDevice](latest/api/structures/hid-device.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this event.
May be `null` if accessed after the frame has either navigated or been destroyed.
Emitted after `navigator.hid.requestDevice` has been called and
`select-hid-device` has fired if a new device becomes available before
Expand All @@ -354,7 +356,8 @@ Returns:
* `event` Event
* `details` Object
* `device` [HIDDevice](latest/api/structures/hid-device.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this event.
May be `null` if accessed after the frame has either navigated or been destroyed.
Emitted after `navigator.hid.requestDevice` has been called and
`select-hid-device` has fired if a device has been removed before the callback
Expand Down Expand Up @@ -480,7 +483,8 @@ Returns:
* `event` Event
* `details` Object
* `port` [SerialPort](latest/api/structures/serial-port.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this event.
May be `null` if accessed after the frame has either navigated or been destroyed.
* `origin` string - The origin that the device has been revoked from.
Emitted after `SerialPort.forget()` has been called. This event can be used
Expand All @@ -502,7 +506,7 @@ app.whenReady().then(() => {
})
```
```js
```js @ts-nocheck
// Renderer Process

const portConnect = async () => {
Expand All @@ -524,7 +528,8 @@ Returns:
* `event` Event
* `details` Object
* `deviceList` [USBDevice[]](latest/api/structures/usb-device.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this event.
May be `null` if accessed after the frame has either navigated or been destroyed.
* `callback` Function
* `deviceId` string (optional)
Expand Down Expand Up @@ -964,7 +969,8 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
* `handler` Function | null
* `request` Object
* `frame` [WebFrameMain](latest/api/web-frame-main.md) - Frame that is requesting access to media.
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - Frame that is requesting access to media.
May be `null` if accessed after the frame has either navigated or been destroyed.
* `securityOrigin` String - Origin of the page making the request.
* `videoRequested` Boolean - true if the web content requested a video stream.
* `audioRequested` Boolean - true if the web content requested an audio stream.
Expand Down Expand Up @@ -1165,7 +1171,8 @@ app.whenReady().then(() => {
pin displayed on the device.
* `providePin`
This prompt is requesting that a pin be provided for the device.
* `frame` [WebFrameMain](latest/api/web-frame-main.md)
* `frame` [WebFrameMain](latest/api/web-frame-main.md) | null - The frame initiating this handler.
May be `null` if accessed after the frame has either navigated or been destroyed.
* `pin` string (optional) - The pin value to verify if `pairingKind` is `confirmPin`.
* `callback` Function
* `response` Object
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Open the given file in the desktop's default manner.

### `shell.openExternal(url[, options])`

* `url` string - Max 2081 characters on windows.
* `url` string - Max 2081 characters on Windows.
* `options` Object (optional)
* `activate` boolean (optional) _macOS_ - `true` to bring the opened application to the foreground. The default is `true`.
* `workingDirectory` string (optional) _Windows_ - The working directory.
Expand Down
7 changes: 3 additions & 4 deletions docs/latest/api/structures/base-window-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ hide_title: false
* `show` boolean (optional) - Whether window should be shown when created. Default is
`true`.
* `frame` boolean (optional) - Specify `false` to create a
[frameless window](latest/tutorial/window-customization.md#create-frameless-windows). Default is `true`.
[frameless window](latest/tutorial/custom-window-styles.md#frameless-windows). Default is `true`.
* `parent` BaseWindow (optional) - Specify parent window. Default is `null`.
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
Expand All @@ -77,7 +77,7 @@ hide_title: false
is only implemented on Windows and macOS.
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` boolean (optional) - Makes the window [transparent](latest/tutorial/window-customization.md#create-transparent-windows).
* `transparent` boolean (optional) - Makes the window [transparent](latest/tutorial/custom-window-styles.md#transparent-windows).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` string (optional) - The type of window, default is normal window. See more about
this below.
Expand Down Expand Up @@ -150,8 +150,7 @@ Possible values are:
-webkit-app-region: drag. This type is commonly used for splash screens.
* The `notification` type creates a window that behaves like a system notification.
* On macOS, possible types are `desktop`, `textured`, `panel`.
* The `textured` type adds metal gradient appearance
(`NSWindowStyleMaskTexturedBackground`).
* The `textured` type adds metal gradient appearance. This option is **deprecated**.
* The `desktop` type places the window at the desktop background window level
(`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
Expand Down
6 changes: 5 additions & 1 deletion docs/latest/api/structures/browser-window-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ hide_title: false
[browserWindow](latest/api/browser-window.md) has disabled `backgroundThrottling` then
frames will be drawn and swapped for the whole window and other
[webContents](latest/api/web-contents.md) displayed by it. Defaults to `true`.
* `offscreen` boolean (optional) - Whether to enable offscreen rendering for the browser
* `offscreen` Object | boolean (optional) - Whether to enable offscreen rendering for the browser
window. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `useSharedTexture` boolean (optional) _Experimental_ - Whether to use GPU shared texture for accelerated
paint event. Defaults to `false`. See the
[offscreen rendering tutorial](latest/tutorial/offscreen-rendering.md) for
more details.
* `contextIsolation` boolean (optional) - Whether to run Electron APIs and
the specified `preload` script in a separate JavaScript context. Defaults
to `true`. The context that the `preload` script runs in will only have
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/structures/ipc-main-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hide_title: false
* `frameId` Integer - The ID of the renderer frame that sent this message
* `returnValue` any - Set this to the value to be returned in a synchronous message
* `sender` [WebContents](latest/api/web-contents.md) - Returns the `webContents` that sent the message
* `senderFrame` [WebFrameMain](latest/api/web-frame-main.md) _Readonly_ - The frame that sent this message
* `senderFrame` [WebFrameMain](latest/api/web-frame-main.md) | null _Readonly_ - The frame that sent this message. May be `null` if accessed after the frame has either navigated or been destroyed.
* `ports` [MessagePortMain](latest/api/message-port-main.md)[] - A list of MessagePorts that were transferred with this message
* `reply` Function - A function that will send an IPC message to the renderer frame that sent the original message that you are currently handling. You should use this method to "reply" to the sent message in order to guarantee the reply will go to the correct process and frame.
* `channel` string
Expand Down
2 changes: 1 addition & 1 deletion docs/latest/api/structures/ipc-main-invoke-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ hide_title: false
* `processId` Integer - The internal ID of the renderer process that sent this message
* `frameId` Integer - The ID of the renderer frame that sent this message
* `sender` [WebContents](latest/api/web-contents.md) - Returns the `webContents` that sent the message
* `senderFrame` [WebFrameMain](latest/api/web-frame-main.md) _Readonly_ - The frame that sent this message
* `senderFrame` [WebFrameMain](latest/api/web-frame-main.md) | null _Readonly_ - The frame that sent this message. May be `null` if accessed after the frame has either navigated or been destroyed.
11 changes: 11 additions & 0 deletions docs/latest/api/structures/navigation-entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "NavigationEntry Object"
description: ""
slug: navigation-entry
hide_title: false
---

# NavigationEntry Object

* `url` string
* `title` string
Loading

0 comments on commit 9ee726b

Please sign in to comment.