mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix(app): prevent focus issue by checking frame existence before handling dom-ready
This commit is contained in:
@@ -610,6 +610,10 @@ if (!gotTheLock) {
|
||||
|
||||
// fix focus issue after dialog show on Windows.
|
||||
webContents.on('frame-created', (_, { frame }) => {
|
||||
if (!frame) {
|
||||
return
|
||||
}
|
||||
|
||||
frame.on('dom-ready', () => {
|
||||
frame.executeJavaScript(`if ('ctx' in window && ctx?.env?.isWindows) {
|
||||
window._FIX_ELECTRON_DIALOG_FOCUS ??= function () {
|
||||
|
||||
Reference in New Issue
Block a user