Merge pull request #3295 from balena-io/fix-launch-when-path-has-special-characters

Fix content not loading when the app path contains special characters
This commit is contained in:
bulldozer-balena[bot] 2020-09-10 17:31:35 +00:00 committed by GitHub
commit 68e24df52b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,13 @@ async function createMainWindow() {
event.preventDefault();
});
mainWindow.loadURL(`file://${path.join(__dirname, 'index.html')}`);
mainWindow.loadURL(
`file://${path.join(
'/',
...__dirname.split(path.sep).map(encodeURIComponent),
'index.html',
)}`,
);
const page = mainWindow.webContents;