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

(cherry picked from commit 9db4cde93b)
This commit is contained in:
Neil
2026-08-02 00:50:29 -07:00
committed by Jinjing
parent 809695a048
commit 4a998b05c1
2 changed files with 8 additions and 2 deletions
+6
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 = {
+2 -2
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__'