Skip to content

Instantly share code, notes, and snippets.

@CharlieHess
Last active September 21, 2020 21:13
Show Gist options
  • Save CharlieHess/8c62b41c01bafb275072a7748584d8ce to your computer and use it in GitHub Desktop.
Save CharlieHess/8c62b41c01bafb275072a7748584d8ce to your computer and use it in GitHub Desktop.
Missing separator at end of items list
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>
const {app, BrowserWindow, Menu} = require('electron')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
mainWindow.loadFile('index.html')
Menu.setApplicationMenu(Menu.buildFromTemplate([
{
type: 'submenu',
label: 'File',
submenu: [
{
type: 'normal',
label: 'Foo',
id: 'foo'
},
{
type: 'normal',
label: 'Bar',
id: 'bar'
},
{
type: 'separator',
before: 'bar'
},
]
},
]))
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment