error handling, launcher ui, read-only mode, rm plot/smooth

This commit is contained in:
bordun 2020-03-09 19:12:43 +01:00
parent cee4cb81b7
commit 4f31985930
59 changed files with 1299 additions and 781 deletions

View file

@ -20,17 +20,22 @@ module.exports = function(options={}) {
useContentSize: true,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: !!options.node
nodeIntegration: !!options.node,
},
show: false,
})
window.once('ready-to-show', ()=>{
if (options.fullscreen) {
window.setFullScreen(true)
}
window.show()
})
window.webContents.once('page-title-updated', ()=>{
if (options.fullscreen) {
window.webContents.sendInputEvent({keyCode: 'F11', type: 'keyDown'})
}
})
window.webContents.on('will-prevent-unload', (event)=>{
var choice = dialog.showMessageBoxSync(window, {
@ -79,10 +84,6 @@ module.exports = function(options={}) {
window.reload()
})
if (options.fullscreen) shortcut.register(window,'F11',function(){
window.setFullScreen(!window.isFullScreen())
})
shortcut.register(window,'F12',function(){
window.toggleDevTools()
})