This commit is contained in:
Kevin Sawicki 2016-06-22 14:14:32 -07:00
parent 58c1d38c96
commit ece319a687

View file

@ -125,21 +125,21 @@ exports.execute = function (role, focusedWindow) {
return true return true
} }
if (focusedWindow != null) { if (windowMethod && focusedWindow != null) {
if (windowMethod) { if (typeof windowMethod === 'function') {
if (typeof windowMethod === 'function') { windowMethod(focusedWindow)
windowMethod(focusedWindow) } else {
} else { focusedWindow[windowMethod]()
focusedWindow[windowMethod]()
}
return true
} else if (webContentsMethod) {
const {webContents} = focusedWindow
if (webContents) {
webContents[webContentsMethod]()
}
return true
} }
return true
}
if (webContentsMethod && focusedWindow != null) {
const {webContents} = focusedWindow
if (webContents) {
webContents[webContentsMethod]()
}
return true
} }
return false return false