💄 Use spread operator instead of arguments object
This commit is contained in:
parent
236810a923
commit
fd9c9c3be7
1 changed files with 17 additions and 16 deletions
|
@ -101,6 +101,7 @@ BrowserWindow.getFocusedWindow = () => {
|
|||
for (let window of BrowserWindow.getAllWindows()) {
|
||||
if (window.isFocused()) return window
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
BrowserWindow.fromWebContents = (webContents) => {
|
||||
|
@ -118,20 +119,20 @@ BrowserWindow.fromDevToolsWebContents = (webContents) => {
|
|||
// Helpers.
|
||||
|
||||
Object.assign(BrowserWindow.prototype, {
|
||||
loadURL () {
|
||||
return this.webContents.loadURL.apply(this.webContents, arguments)
|
||||
loadURL (...args) {
|
||||
return this.webContents.loadURL.apply(this.webContents, args)
|
||||
},
|
||||
getURL () {
|
||||
getURL (...args) {
|
||||
return this.webContents.getURL()
|
||||
},
|
||||
reload () {
|
||||
return this.webContents.reload.apply(this.webContents, arguments)
|
||||
reload (...args) {
|
||||
return this.webContents.reload.apply(this.webContents, args)
|
||||
},
|
||||
send () {
|
||||
return this.webContents.send.apply(this.webContents, arguments)
|
||||
send (...args) {
|
||||
return this.webContents.send.apply(this.webContents, args)
|
||||
},
|
||||
openDevTools () {
|
||||
return this.webContents.openDevTools.apply(this.webContents, arguments)
|
||||
openDevTools (...args) {
|
||||
return this.webContents.openDevTools.apply(this.webContents, args)
|
||||
},
|
||||
closeDevTools () {
|
||||
return this.webContents.closeDevTools()
|
||||
|
@ -145,8 +146,8 @@ Object.assign(BrowserWindow.prototype, {
|
|||
toggleDevTools () {
|
||||
return this.webContents.toggleDevTools()
|
||||
},
|
||||
inspectElement () {
|
||||
return this.webContents.inspectElement.apply(this.webContents, arguments)
|
||||
inspectElement (...args) {
|
||||
return this.webContents.inspectElement.apply(this.webContents, args)
|
||||
},
|
||||
inspectServiceWorker () {
|
||||
return this.webContents.inspectServiceWorker()
|
||||
|
|
Loading…
Reference in a new issue