Access function in methodInBrowserWindow
This commit is contained in:
parent
35097b244e
commit
3505e98a46
1 changed files with 3 additions and 5 deletions
|
@ -82,12 +82,10 @@ const MenuItem = (function () {
|
||||||
const methodName = rolesMap[this.role]
|
const methodName = rolesMap[this.role]
|
||||||
if (methodInApp[methodName]) {
|
if (methodInApp[methodName]) {
|
||||||
return app[methodName]()
|
return app[methodName]()
|
||||||
|
} else if (typeof methodInBrowserWindow[methodName] === 'function') {
|
||||||
|
return methodInBrowserWindow[methodName](focusedWindow)
|
||||||
} else if (methodInBrowserWindow[methodName]) {
|
} else if (methodInBrowserWindow[methodName]) {
|
||||||
if (typeof methodName === 'function') {
|
return focusedWindow[methodName]()
|
||||||
return methodName(focusedWindow)
|
|
||||||
} else {
|
|
||||||
return focusedWindow[methodName]()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const {webContents} = focusedWindow
|
const {webContents} = focusedWindow
|
||||||
return webContents != null ? webContents[methodName]() : void 0
|
return webContents != null ? webContents[methodName]() : void 0
|
||||||
|
|
Loading…
Reference in a new issue