fix flash menu being unresponsive to commands
This commit is contained in:
parent
85ef42d99e
commit
c586806609
5 changed files with 19 additions and 3 deletions
|
@ -277,10 +277,14 @@ WebContents.prototype._init = function () {
|
|||
})
|
||||
|
||||
// Handle context menu action request from pepper plugin.
|
||||
this.on('pepper-context-menu', function (event, params) {
|
||||
this.on('pepper-context-menu', function (event, params, callback) {
|
||||
// Access Menu via electron.Menu to prevent circular require
|
||||
const menu = electron.Menu.buildFromTemplate(params.menu)
|
||||
menu.popup(event.sender.getOwnerBrowserWindow(), params.x, params.y)
|
||||
|
||||
menu.on('closed', () => {
|
||||
callback()
|
||||
})
|
||||
})
|
||||
|
||||
// The devtools requests the webContents to reload.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue