Load Slate within Electron render process

This commit is contained in:
uonai 2020-07-01 22:53:04 -05:00
parent ab1080027a
commit 47eab8eb7b
3 changed files with 7 additions and 20 deletions

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>

View File

@ -15,7 +15,7 @@ function createWindow() {
},
});
// and load the index.html of the app.
mainWindow.loadFile("electron/index.html");
mainWindow.loadURL("http://localhost:1337");
console.log("window created");
// Open the DevTools.

View File

@ -0,0 +1,6 @@
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// No Node.js APIs are available in this process because
// `nodeIntegration` is turned off. Use `preload.js` to
// selectively enable features needed in the rendering
// process.