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
|
||||
|
||||
app.commandLine.appendSwitch('--disable-gpu');
|
||||
app.commandLine.appendSwitch('--disable-gpu-compositing');
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', () => {
|
||||
app.quit()
|
||||
|
@ -13,42 +10,19 @@ app.on('window-all-closed', () => {
|
|||
|
||||
exports.load = (appUrl) => {
|
||||
app.on('ready', () => {
|
||||
mainWindow = new BrowserWindow({
|
||||
const options = {
|
||||
width: 800,
|
||||
height: 600,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: '#FFFFFF',
|
||||
useContentSize: true,
|
||||
webPreferences: {
|
||||
offscreen: true,
|
||||
nodeIntegration: false,
|
||||
backgroundThrottling: false
|
||||
}
|
||||
})
|
||||
useContentSize: true
|
||||
}
|
||||
if (process.platform === 'linux') {
|
||||
options.icon = path.join(__dirname, 'icon.png')
|
||||
}
|
||||
|
||||
mainWindow = new BrowserWindow(options)
|
||||
mainWindow.loadURL(appUrl)
|
||||
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()
|
||||
} else {
|
||||
const indexPath = path.join(__dirname, '/index.html')
|
||||
//loadApplicationByUrl(`http://www.e-try.com/black.htm`)
|
||||
loadApplicationByUrl(`http://mrdoob.com/lab/javascript/requestanimationframe/`)
|
||||
loadApplicationByUrl(`file://${indexPath}`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue