Replace custom function with Object.values()
This commit is contained in:
parent
5240352326
commit
3c64062f69
1 changed files with 2 additions and 7 deletions
|
@ -7,11 +7,6 @@ const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const url = require('url')
|
const url = require('url')
|
||||||
|
|
||||||
// TODO(zcbenz): Remove this when we have Object.values().
|
|
||||||
const objectValues = function (object) {
|
|
||||||
return Object.keys(object).map(function (key) { return object[key] })
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mapping between extensionId(hostname) and manifest.
|
// Mapping between extensionId(hostname) and manifest.
|
||||||
const manifestMap = {} // extensionId => manifest
|
const manifestMap = {} // extensionId => manifest
|
||||||
const manifestNameMap = {} // name => manifest
|
const manifestNameMap = {} // name => manifest
|
||||||
|
@ -110,7 +105,7 @@ const removeBackgroundPages = function (manifest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendToBackgroundPages = function (...args) {
|
const sendToBackgroundPages = function (...args) {
|
||||||
for (const page of objectValues(backgroundPages)) {
|
for (const page of Object.values(backgroundPages)) {
|
||||||
page.webContents.sendToAll(...args)
|
page.webContents.sendToAll(...args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,7 +292,7 @@ app.on('web-contents-created', function (event, webContents) {
|
||||||
|
|
||||||
hookWebContentsEvents(webContents)
|
hookWebContentsEvents(webContents)
|
||||||
webContents.on('devtools-opened', function () {
|
webContents.on('devtools-opened', function () {
|
||||||
loadDevToolsExtensions(webContents, objectValues(manifestMap))
|
loadDevToolsExtensions(webContents, Object.values(manifestMap))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue