restoring default app
This commit is contained in:
parent
8eed91d87a
commit
9872fa0f52
2 changed files with 9 additions and 36 deletions
|
@ -3,9 +3,6 @@ const path = require('path')
|
||||||
|
|
||||||
let mainWindow = null
|
let mainWindow = null
|
||||||
|
|
||||||
app.commandLine.appendSwitch('--disable-gpu');
|
|
||||||
app.commandLine.appendSwitch('--disable-gpu-compositing');
|
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
app.quit()
|
app.quit()
|
||||||
|
@ -13,42 +10,19 @@ app.on('window-all-closed', () => {
|
||||||
|
|
||||||
exports.load = (appUrl) => {
|
exports.load = (appUrl) => {
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
mainWindow = new BrowserWindow({
|
const options = {
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
show: false,
|
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
backgroundColor: '#FFFFFF',
|
backgroundColor: '#FFFFFF',
|
||||||
useContentSize: true,
|
useContentSize: true
|
||||||
webPreferences: {
|
}
|
||||||
offscreen: true,
|
if (process.platform === 'linux') {
|
||||||
nodeIntegration: false,
|
options.icon = path.join(__dirname, 'icon.png')
|
||||||
backgroundThrottling: false
|
}
|
||||||
}
|
|
||||||
})
|
mainWindow = new BrowserWindow(options)
|
||||||
mainWindow.loadURL(appUrl)
|
mainWindow.loadURL(appUrl)
|
||||||
mainWindow.focus()
|
mainWindow.focus()
|
||||||
|
|
||||||
mainWindow.webContents.on('dom-ready', () => {
|
|
||||||
mainWindow.webContents.setFrameRate(10)
|
|
||||||
let ping = true
|
|
||||||
setInterval(() => {
|
|
||||||
if (ping) {
|
|
||||||
mainWindow.webContents.startPainting()
|
|
||||||
} else {
|
|
||||||
mainWindow.webContents.stopPainting()
|
|
||||||
}
|
|
||||||
|
|
||||||
ping = !ping
|
|
||||||
}, 3000)
|
|
||||||
})
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
console.log(mainWindow.webContents.isPainting())
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
mainWindow.webContents.on('paint', (e, rect, data) => {
|
|
||||||
console.log('painting', data.length)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,6 +329,5 @@ if (option.file && !option.webdriver) {
|
||||||
startRepl()
|
startRepl()
|
||||||
} else {
|
} else {
|
||||||
const indexPath = path.join(__dirname, '/index.html')
|
const indexPath = path.join(__dirname, '/index.html')
|
||||||
//loadApplicationByUrl(`http://www.e-try.com/black.htm`)
|
loadApplicationByUrl(`file://${indexPath}`)
|
||||||
loadApplicationByUrl(`http://mrdoob.com/lab/javascript/requestanimationframe/`)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue