Skip to content

Instantly share code, notes, and snippets.

@wisniewski94
Last active March 22, 2020 18:32
Show Gist options
  • Save wisniewski94/20ac0a588d7bde00705d6ac81a27bd0c to your computer and use it in GitHub Desktop.
Save wisniewski94/20ac0a588d7bde00705d6ac81a27bd0c to your computer and use it in GitHub Desktop.
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag -->
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment