mirror of
https://github.com/electron/electron.git
synced 2026-01-07 22:54:25 -05:00
fix: correctly parse default_app path on windows (#18086)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user