Fix content not loading when the app path contains special characters

Changelog-entry: Fix content not loading when the app path contains special characters
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-09-09 17:06:04 +02:00
parent 78a5339e3e
commit b9076d01af

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;