electron/default_app/default_app.js
2016-07-18 16:16:23 +02:00

31 lines
732 B
JavaScript

const {app, BrowserWindow} = require('electron')
var mainWindow = null
// Quit when all windows are closed.
app.on('window-all-closed', () => {
app.quit()
})
exports.load = (appUrl) => {
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
autoHideMenuBar: true,
backgroundColor: '#FFFFFF',
useContentSize: true
})
mainWindow.loadURL(appUrl)
mainWindow.focus()
mainWindow.webContents.on('dom-ready', () => {
mainWindow.webContents.beginFrameSubscription(() => {
console.log("asd")
})
})
mainWindow.webContents.on('paint', (e, rect, w, h, data) => {
console.log('ELECTRON EVENT', rect, w, h, data)
})
})
}