From 4a998b05c196de116d8697b75432246df303183c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:35:53 -0700 Subject: [PATCH] fix(windows): keep browser close marker URL absolute (#12038) (cherry picked from commit 9db4cde93b7541350d765fafe5a04cab66b0fb51) --- src/main/window/createMainWindow.test.ts | 6 ++++++ src/shared/browser-window-close-policy.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/window/createMainWindow.test.ts b/src/main/window/createMainWindow.test.ts index 8a61f157584..81e30ee4ea9 100644 --- a/src/main/window/createMainWindow.test.ts +++ b/src/main/window/createMainWindow.test.ts @@ -147,6 +147,12 @@ describe('createMainWindow', () => { expect(browserWindowInstance.loadURL).not.toHaveBeenCalled() }) + it('keeps the browser close-policy marker absolute under Windows URL rules', () => { + expect(fileURLToPath(BROWSER_WINDOW_CLOSE_ALLOWED_PRELOAD, { windows: true })).toBe( + 'C:\\__orca_window_close_allowed__' + ) + }) + it('enables renderer sandboxing and opens external links safely', () => { const windowHandlers: Record void> = {} const webContents = { diff --git a/src/shared/browser-window-close-policy.ts b/src/shared/browser-window-close-policy.ts index 2ea28169ee7..93c37e18a48 100644 --- a/src/shared/browser-window-close-policy.ts +++ b/src/shared/browser-window-close-policy.ts @@ -1,2 +1,2 @@ -// Why: this marker carries the CLI's explicit close policy across attach before the guest exists. -export const BROWSER_WINDOW_CLOSE_ALLOWED_PRELOAD = 'file:///__orca_window_close_allowed__' +// Why: the synthetic drive keeps this marker absolute under Windows file-URL rules; main removes it before guest load. +export const BROWSER_WINDOW_CLOSE_ALLOWED_PRELOAD = 'file:///C:/__orca_window_close_allowed__'