Skip to content

Commit

Permalink
fix: correctly parse default_app path on windows (#18086)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 1, 2019
1 parent 496d796 commit 913bd4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion default_app/default_app.ts
Expand Up @@ -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) => {
Expand Down

0 comments on commit 913bd4c

Please sign in to comment.