You see, I'm just learning
This commit is contained in:
parent
9bef956608
commit
eccff4aafc
2 changed files with 18 additions and 12 deletions
21
index.html
21
index.html
|
@ -1,16 +1,17 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<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>
|
<title>Hello World!</title>
|
||||||
</head>
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||||
<body>
|
</head>
|
||||||
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
We are using Node.js <span id="node-version"></span>,
|
<p>
|
||||||
Chromium <span id="chrome-version"></span>,
|
We are using Node.js <span id="node-version"></span>,
|
||||||
and Electron <span id="electron-version"></span>.
|
Chromium <span id="chrome-version"></span>,
|
||||||
</body>
|
and Electron <span id="electron-version"></span>.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
9
main.js
9
main.js
|
@ -1,8 +1,13 @@
|
||||||
const { app, BrowserWindow } = require('electron')
|
const { app, BrowserWindow } = require('electron')
|
||||||
const createWindow = () => {
|
const path = require('path')
|
||||||
|
|
||||||
|
function createWindow () {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600
|
height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
preload: path.join(__dirname, 'preload.js')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
win.loadFile('index.html')
|
win.loadFile('index.html')
|
||||||
|
|
Loading…
Reference in a new issue