/
main.js
43 lines (34 loc) · 927 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const electron = require('electron'),
{app} = electron,
{BrowserWindow} = electron,
open = require('open');
let win;
function createWindow () {
win = new BrowserWindow({
width: 1000,
height: 700,
minWidth: 1000,
minHeight: 700,
icon: process.platform === 'linux' && __dirname + '/images/appicon.png'
});
win.loadURL('file://' + __dirname + '/bower_components/glyphr-studio/dev/Glyphr_Studio_Autohacked_For_Electron.html');
let webContents = win.webContents;
webContents.on('new-window', function(event, url){
event.preventDefault();
open(url);
});
// webContents.openDevTools()
win.on('closed', function () {
win = null;
});
}
app.on('ready', createWindow);
app.on('window-all-closed', function () {
if (process.platform != 'darwin')
app.quit();
});
app.on('activate', function () {
if (win === null) {
createWindow();
}
});