main: add --fullscreen option (issue #164)
This commit is contained in:
parent
1dc144cb44
commit
d7375ab060
7 changed files with 30 additions and 12 deletions
|
|
@ -17,7 +17,8 @@ module.exports = function(options={}) {
|
|||
title: options.title || settings.read('appName'),
|
||||
icon: path.resolve(__dirname + '/../browser/logo.png'),
|
||||
backgroundColor: options.color || bgColor,
|
||||
type:options.type,
|
||||
type: options.type,
|
||||
fullscreen: options.fullscreen,
|
||||
webPreferences: {
|
||||
nodeIntegration: !!options.node
|
||||
}
|
||||
|
|
@ -37,6 +38,16 @@ module.exports = function(options={}) {
|
|||
}
|
||||
})
|
||||
|
||||
if (options.fullscreen) {
|
||||
window.webContents.on('dom-ready', ()=>{
|
||||
window.webContents.executeJavaScript(`
|
||||
window.ELECTRON_FULLSCREEN = true
|
||||
`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
window.on('closed', function() {
|
||||
window = null
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue