From 913bd4c83212f9767f55a5bd03108f7036647507 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 1 May 2019 13:00:09 -0700 Subject: [PATCH] fix: correctly parse default_app path on windows (#18086) --- default_app/default_app.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/default_app/default_app.ts b/default_app/default_app.ts index 975a4c268eec..cbd10c15b184 100644 --- a/default_app/default_app.ts +++ b/default_app/default_app.ts @@ -30,7 +30,11 @@ function isTrustedSender (webContents: Electron.WebContents) { } const parsedUrl = new URL(webContents.getURL()) - return parsedUrl.protocol === 'file:' && parsedUrl.pathname === indexPath + const urlPath = process.platform === 'win32' + // Strip the prefixed "/" that occurs on windows + ? path.resolve(parsedUrl.pathname.substr(1)) + : parsedUrl.pathname + return parsedUrl.protocol === 'file:' && urlPath === indexPath } ipcMain.on('bootstrap', (event) => {