1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00
Files
gitlit/app/main.js
2018-05-18 10:48:24 +02:00

29 lines
690 B
JavaScript

const {app, BrowserWindow} = require('electron');
const path = require('path');
const url = require('url');
const electronLocalshortcut = require('electron-localshortcut');
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 800, height: 600});
win.setMenu(null);
// and load the index.html of the app.
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
electronLocalshortcut.register(win, 'F12', () => {
win.webContents.toggleDevTools();
});
win.webContents.on('did-finish-load', () => {
win.webContents.send('ping', 'whoooooooh!')
});
}
app.on('ready', createWindow);