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

This commit is contained in:
Samuel Attard 2019-05-01 13:00:09 -07:00 committed by GitHub
parent 496d796833
commit 913bd4c832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,11 @@ function isTrustedSender (webContents: Electron.WebContents) {
} }
const parsedUrl = new URL(webContents.getURL()) 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) => { ipcMain.on('bootstrap', (event) => {