Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix some string union typings #40203

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/api/app.md
Expand Up @@ -1135,11 +1135,11 @@ indicates success while any other value indicates failure according to Chromium
resolver will attempt to use the system's DNS settings to do DNS lookups
itself. Enabled by default on macOS, disabled by default on Windows and
Linux.
* `secureDnsMode` string (optional) - Can be "off", "automatic" or "secure".
Configures the DNS-over-HTTP mode. When "off", no DoH lookups will be
performed. When "automatic", DoH lookups will be performed first if DoH is
* `secureDnsMode` string (optional) - Can be 'off', 'automatic' or 'secure'.
Configures the DNS-over-HTTP mode. When 'off', no DoH lookups will be
performed. When 'automatic', DoH lookups will be performed first if DoH is
available, and insecure DNS lookups will be performed as a fallback. When
"secure", only DoH lookups will be performed. Defaults to "automatic".
'secure', only DoH lookups will be performed. Defaults to 'automatic'.
* `secureDnsServers` string[] (optional) - A list of DNS-over-HTTP
server templates. See [RFC8484 § 3][] for details on the template format.
Most servers support the POST method; the template for such servers is
Expand Down
2 changes: 1 addition & 1 deletion docs/api/web-contents.md
Expand Up @@ -1211,7 +1211,7 @@ Returns `string` - The user agent for this web page.

* `css` string
* `options` Object (optional)
* `cssOrigin` string (optional) - Can be either 'user' or 'author'. Sets the [cascade origin](https://www.w3.org/TR/css3-cascade/#cascade-origin) of the inserted stylesheet. Default is 'author'.
* `cssOrigin` string (optional) - Can be 'user' or 'author'. Sets the [cascade origin](https://www.w3.org/TR/css3-cascade/#cascade-origin) of the inserted stylesheet. Default is 'author'.

Returns `Promise<string>` - A promise that resolves with a key for the inserted CSS that can later be used to remove the CSS via `contents.removeInsertedCSS(key)`.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/web-frame.md
Expand Up @@ -113,7 +113,7 @@ webFrame.setSpellCheckProvider('en-US', {

* `css` string
* `options` Object (optional)
* `cssOrigin` string (optional) - Can be either 'user' or 'author'. Sets the [cascade origin](https://www.w3.org/TR/css3-cascade/#cascade-origin) of the inserted stylesheet. Default is 'author'.
* `cssOrigin` string (optional) - Can be 'user' or 'author'. Sets the [cascade origin](https://www.w3.org/TR/css3-cascade/#cascade-origin) of the inserted stylesheet. Default is 'author'.

Returns `string` - A key for the inserted CSS that can later be used to remove
the CSS via `webFrame.removeInsertedCSS(key)`.
Expand Down
10 changes: 10 additions & 0 deletions spec/ts-smoke/electron/main.ts
Expand Up @@ -418,6 +418,11 @@ win2.once('ready-to-show', () => {
app.relaunch({ args: process.argv.slice(1).concat(['--relaunch']) });
app.exit(0);

app.configureHostResolver({ secureDnsMode: 'off' });

// @ts-expect-error Invalid type value
app.configureHostResolver({ secureDnsMode: 'foo' });

// auto-updater
// https://github.com/electron/electron/blob/main/docs/api/auto-updater.md

Expand Down Expand Up @@ -1269,6 +1274,11 @@ win4.webContents.on('devtools-open-url', (event, url) => {
console.log(url);
});

win4.webContents.insertCSS('body {}', { cssOrigin: 'user' });

// @ts-expect-error Invalid type value
win4.webContents.insertCSS('body {}', { cssOrigin: 'foo' });

win4.loadURL('http://github.com');

// TouchBar
Expand Down