Skip to content

Commit 60fb97d

Browse files
authored
fix(desktop): preserve keyboard focus during browser navigation (#48593)
1 parent b2e6e76 commit 60fb97d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/desktop/src/main/browser-chromium.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export function createBrowserPage(
5353
webviewTag: false,
5454
devTools: false,
5555
backgroundThrottling: false,
56+
// Agent navigation, including in hidden tabs, must not take the user's keyboard focus.
57+
focusOnNavigation: false,
5658
},
5759
})
5860
const contents = view.webContents
@@ -157,6 +159,8 @@ export function createBrowserPage(
157159
webSecurity: true,
158160
webviewTag: false,
159161
devTools: false,
162+
// Electron applies these preferences before the popup is adopted by our view.
163+
focusOnNavigation: false,
160164
partition: options.partition,
161165
},
162166
},

0 commit comments

Comments
 (0)