Add webContents.sendToAll to send message to all frames

This commit is contained in:
Cheng Zhao 2016-05-27 16:58:49 +09:00
parent c1facec5a6
commit 9ab76fb884
7 changed files with 58 additions and 18 deletions

View file

@ -78,6 +78,14 @@ let wrapWebContents = function (webContents) {
return this._send(channel, args)
}
// WebContents::sendToAll(channel, args..)
webContents.sendToAll = function (channel, ...args) {
if (channel == null) {
throw new Error('Missing required channel argument')
}
return this._sendToAll(channel, args)
}
// The navigation controller.
controller = new NavigationController(webContents)
ref1 = NavigationController.prototype