Use spread syntax instead of function apply
This commit is contained in:
parent
f72942bff1
commit
c8ff67ab75
12 changed files with 30 additions and 34 deletions
|
@ -74,7 +74,7 @@ var BrowserWindowProxy = (function () {
|
|||
}
|
||||
|
||||
BrowserWindowProxy.prototype['eval'] = function (...args) {
|
||||
ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, 'executeJavaScript'].concat(args))
|
||||
ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, 'executeJavaScript', ...args)
|
||||
}
|
||||
|
||||
return BrowserWindowProxy
|
||||
|
@ -207,11 +207,11 @@ ipcRenderer.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (event, sourceId, m
|
|||
|
||||
// Forward history operations to browser.
|
||||
var sendHistoryOperation = function (...args) {
|
||||
ipcRenderer.send.apply(ipcRenderer, ['ELECTRON_NAVIGATION_CONTROLLER'].concat(args))
|
||||
ipcRenderer.send('ELECTRON_NAVIGATION_CONTROLLER', ...args)
|
||||
}
|
||||
|
||||
var getHistoryOperation = function (...args) {
|
||||
return ipcRenderer.sendSync.apply(ipcRenderer, ['ELECTRON_SYNC_NAVIGATION_CONTROLLER'].concat(args))
|
||||
return ipcRenderer.sendSync('ELECTRON_SYNC_NAVIGATION_CONTROLLER', ...args)
|
||||
}
|
||||
|
||||
window.history.back = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue