Repository: electron/electron (language: cpp)

Issue:
[Bug]: `WebviewTag.webpreferences` has wrong type
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

30.0.6

### What operating system are you using?

macOS

### Operating System Version

Sonoma 14.4.1

### What arch are you using?

arm64 (including Apple Silicon)

### Last Known Working Electron version

29.4.0

### Expected Behavior

Can assign `"contextIsolation=false, nodeintegration=true"` and other valid strings to `WebviewTag.webpreferences`. The type of `WebviewTag.webpreferences` should be `string`.

### Actual Behavior

```
error TS2322: Type '"contextIsolation=false"' is not assignable to type '"transparent"'
```

`WebviewTag.webpreferences` has type `'transparent'`.

### Testcase Gist URL

_No response_

### Additional Information

* Broken in #40301


Discussion / hints:

Fix patch:
diff --git a/docs/api/structures/web-preferences.md b/docs/api/structures/web-preferences.md
index 9c6a3ecc8fc8c..044cd2b2270b1 100644
--- a/docs/api/structures/web-preferences.md
+++ b/docs/api/structures/web-preferences.md
@@ -143,6 +143,7 @@
   contain the layout of the document—without requiring scrolling. Enabling
   this will cause the `preferred-size-changed` event to be emitted on the
   `WebContents` when the preferred size changes. Default is `false`.
+* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
 
 [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
 [runtime-enabled-features]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5
diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md
index 99e740eb39a9c..14103680f7f4e 100644
--- a/docs/api/webview-tag.md
+++ b/docs/api/webview-tag.md
@@ -221,9 +221,7 @@ windows. Popups are disabled by default.
 ```
 
 A `string` which is a comma separated list of strings which specifies the web preferences to be set on the webview.
-The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions). In addition, webview supports the following preferences:
-
-* `transparent` boolean (optional) - Whether to enable background transparency for the guest page. Default is `true`. **Note:** The guest page's text and background colors are derived from the [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
+The full list of supported preference strings can be found in [BrowserWindow](browser-window.md#new-browserwindowoptions).
 
 The string follows the same format as the features string in `window.open`.
 A name by itself is given a `true` boolean value.


Test patch: