feat: add focusOnNavigation flag to WebPreferences (#49511)

* feat: add focusOnNavigation webPreference

Co-authored-by: Kyle Cutler <kycutler@microsoft.com>

* WebContentsView tests

Co-authored-by: Kyle Cutler <kycutler@microsoft.com>

* fix

Co-authored-by: Kyle Cutler <kycutler@microsoft.com>

* fix

Co-authored-by: Kyle Cutler <kycutler@microsoft.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kyle Cutler <kycutler@microsoft.com>
This commit is contained in:
trop[bot]
2026-02-04 15:44:03 -05:00
committed by GitHub
parent 0abdb91b78
commit 2dbdf223b7
7 changed files with 77 additions and 0 deletions

View File

@@ -156,6 +156,8 @@
`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.
* `enableDeprecatedPaste` boolean (optional) _Deprecated_ - Whether to enable the `paste` [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand). Default is `false`.
* `focusOnNavigation` boolean (optional) - Whether to focus the WebContents
when navigating. Default is `true`.
[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