ctrl+w=close window & minor fixes
This commit is contained in:
parent
97c504e79a
commit
e1eb6b5df1
5 changed files with 26 additions and 19 deletions
|
|
@ -57,16 +57,8 @@ module.exports = function(options={}) {
|
|||
shell.openExternal(url)
|
||||
})
|
||||
|
||||
// window.webContents.on('dom-ready', ()=>{
|
||||
// window.webContents.executeJavaScript(`
|
||||
// window.ELECTRON = true
|
||||
// `)
|
||||
// })
|
||||
|
||||
if (options.zoom === false) {
|
||||
window.webContents.setVisualZoomLevelLimits(1, 1)
|
||||
}
|
||||
|
||||
window.webContents.setVisualZoomLevelLimits(1, 1)
|
||||
|
||||
window.on('closed', function() {
|
||||
window = null
|
||||
|
|
@ -76,6 +68,13 @@ module.exports = function(options={}) {
|
|||
|
||||
window.loadURL(options.address)
|
||||
|
||||
if (process.platform !== 'darwin') {
|
||||
// already registered in app menu on macOs
|
||||
shortcut.register(window,'CmdOrCtrl+W',function(){
|
||||
window.close()
|
||||
})
|
||||
}
|
||||
|
||||
if (options.shortcuts) {
|
||||
|
||||
shortcut.register(window,'CmdOrCtrl+R',function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue