fix(windows): keep browser close marker URL absolute (#12038)

This commit is contained in:
Neil 2026-08-01 20:35:53 -07:00 committed by GitHub
parent 8ab85c9bfc
commit 9db4cde93b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -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<string, (...args: any[]) => void> = {}
const webContents = {

View File

@ -1,2 +1,2 @@
// Why: this marker carries the CLI's explicit close policy across <webview> 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__'