fix: unref browser grab timeout (#4247)

This commit is contained in:
Neil
2026-05-31 09:33:31 -07:00
committed by GitHub
parent d39fc28565
commit 51c1ca5023
@@ -188,6 +188,11 @@ export class BrowserGrabSessionController {
const timeoutId = setTimeout(() => {
settleOnce({ opId, kind: 'cancelled', reason: 'timeout' })
}, GRAB_OP_TIMEOUT_MS)
// Why: the timeout prevents stale grab state, but an armed grab should
// not keep Electron main alive after its owning tab/window is gone.
if (typeof timeoutId.unref === 'function') {
timeoutId.unref()
}
guest.on('did-start-navigation', handleNavigation)
guest.on('destroyed', handleDestroyed)