mirror of
https://github.com/jely2002/youtube-dl-gui.git
synced 2021-11-01 22:46:21 +03:00
44 lines
830 B
JavaScript
44 lines
830 B
JavaScript
const { app, BrowserWindow } = require('electron')
|
|
let win
|
|
|
|
function createWindow () {
|
|
app.allowRendererProcessReuse = true
|
|
|
|
win = new BrowserWindow({
|
|
show: false,
|
|
width: 800, //850
|
|
height: 500, //550
|
|
resizable: false,
|
|
frame: false,
|
|
icon: "bin/icon-light.png",
|
|
webPreferences: {
|
|
nodeIntegration: true
|
|
}
|
|
})
|
|
|
|
win.removeMenu()
|
|
//win.webContents.openDevTools()
|
|
win.loadFile('index.html')
|
|
win.on('closed', () => {
|
|
win = null
|
|
})
|
|
|
|
win.once('ready-to-show', () => {
|
|
win.show()
|
|
})
|
|
}
|
|
|
|
app.on('ready', createWindow);
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit()
|
|
}
|
|
});
|
|
|
|
app.on('activate', () => {
|
|
if (win === null) {
|
|
createWindow()
|
|
}
|
|
});
|