mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Access function in methodInBrowserWindow
This commit is contained in:
@@ -82,12 +82,10 @@ const MenuItem = (function () {
|
||||
const methodName = rolesMap[this.role]
|
||||
if (methodInApp[methodName]) {
|
||||
return app[methodName]()
|
||||
} else if (typeof methodInBrowserWindow[methodName] === 'function') {
|
||||
return methodInBrowserWindow[methodName](focusedWindow)
|
||||
} else if (methodInBrowserWindow[methodName]) {
|
||||
if (typeof methodName === 'function') {
|
||||
return methodName(focusedWindow)
|
||||
} else {
|
||||
return focusedWindow[methodName]()
|
||||
}
|
||||
return focusedWindow[methodName]()
|
||||
} else {
|
||||
const {webContents} = focusedWindow
|
||||
return webContents != null ? webContents[methodName]() : void 0
|
||||
|
||||
Reference in New Issue
Block a user