This commit is contained in:
Victor Giers
2021-11-19 22:43:29 +01:00
parent 6491a5fd0b
commit bf58006e72
2 changed files with 9 additions and 25 deletions

View File

@@ -8,13 +8,16 @@ const loadURL = serve({directory: 'hen'});
let mainWindow;
(async () => {
await app.whenReady();
await app.whenReady();
mainWindow = new BrowserWindow();
mainWindow = new BrowserWindow({
width: 1280,
height: 720
});
await loadURL(mainWindow);
await loadURL(mainWindow);
// The above is equivalent to this:
await mainWindow.loadURL('app://-');
// The `-` is just the required hostname
// The above is equivalent to this:
await mainWindow.loadURL('app://-');
// The `-` is just the required hostname
})();

View File

@@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
<!-- You can also require other files to run in this process -->
<script src="./renderer.js"></script>
</body>
</html>