fix(desktop): preserve keyboard focus during browser navigation (#48593)

This commit is contained in:
Luke Parker 2026-09-12 13:54:22 +10:00 • committed by GitHub
parent b2e6e764a8
commit 60fb97d59e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,8 @@ export function createBrowserPage(
webviewTag: false,
devTools: false,
backgroundThrottling: false,
// Agent navigation, including in hidden tabs, must not take the user's keyboard focus.
focusOnNavigation: false,
},
})
const contents = view.webContents
@ -157,6 +159,8 @@ export function createBrowserPage(
webSecurity: true,
webviewTag: false,
devTools: false,
// Electron applies these preferences before the popup is adopted by our view.
focusOnNavigation: false,
partition: options.partition,
},
},