fix: correctly parse default_app path on windows (#18102)

This commit is contained in:
trop[bot]
2019-05-03 11:16:57 -04:00
committed by John Kleinschmidt
parent ea6815c0f7
commit a431f1a663

View File

@@ -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) => {