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__'