summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-11-25 10:56:20 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-11-25 17:04:12 +0100
commitcc260080b8a0f9f446cb33f6d31545289533122c (patch)
tree5bc38b7b8b56115ddeeab057ff2ed6928028f971 /gui/src
parentd0816e181992ff1fd772d383113fc27a673adcf9 (diff)
downloadmullvadvpn-cc260080b8a0f9f446cb33f6d31545289533122c.tar.xz
mullvadvpn-cc260080b8a0f9f446cb33f6d31545289533122c.zip
Use web server for renderer content in development
Third party devtools can't be loaded on `file://` URLs due to an issue in Electron. Using a web server locally works around that issue.
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/main/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 53e281c15a..73a1656782 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -434,7 +434,13 @@ class ApplicationMain {
const filePath = path.resolve(path.join(__dirname, '../renderer/index.html'));
try {
- await this.windowController?.window.loadFile(filePath);
+ if (process.env.NODE_ENV === 'development') {
+ await this.windowController?.window.loadURL(
+ 'http://localhost:8080/src/renderer/index.html',
+ );
+ } else {
+ await this.windowController?.window.loadFile(filePath);
+ }
} catch (error) {
log.error(`Failed to load index file: ${error.message}`);
}