mirror of
https://github.com/S2-/gitlit
synced 2025-08-02 20:30:05 +02:00
initial commit
This commit is contained in:
28
app/main.js
Normal file
28
app/main.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
Reference in New Issue
Block a user