UNPKG

713 BJavaScriptView Raw
1const {
2 app,
3 BrowserWindow
4} = require('electron')
5const path = require('path')
6const url = require('url')
7
8let win
9
10function createWindow () {
11 win = new BrowserWindow({
12 width: 1024,
13 height: 800
14 })
15
16 win.loadURL(url.format({
17 pathname: path.resolve(process.cwd(), './coverage/lcov-report/index.html'),
18 protocol: 'file:',
19 slashes: true
20 }))
21
22 // win.webContents.openDevTools();
23
24 win.on('closed', () => {
25 win = null
26 })
27}
28
29app.on('ready', createWindow)
30
31// Quit when all windows are closed.
32app.on('window-all-closed', () => {
33 if (process.platform !== 'darwin') {
34 app.quit()
35 }
36 app.exit(1)
37})
38
39app.on('activate', () => {
40 if (win === null) {
41 createWindow()
42 }
43})