fix: correctly return properties on the netLog module (#17525)
This commit is contained in:
parent
336db33d18
commit
34eb5d0815
1 changed files with 4 additions and 0 deletions
|
@ -10,8 +10,12 @@ Object.setPrototypeOf(module.exports, new Proxy({}, {
|
||||||
if (!app.isReady()) return
|
if (!app.isReady()) return
|
||||||
|
|
||||||
const netLog = session.defaultSession.netLog
|
const netLog = session.defaultSession.netLog
|
||||||
|
|
||||||
if (!Object.getPrototypeOf(netLog).hasOwnProperty(property)) return
|
if (!Object.getPrototypeOf(netLog).hasOwnProperty(property)) return
|
||||||
|
|
||||||
|
// check for properties on the prototype chain that aren't functions
|
||||||
|
if (typeof netLog[property] !== 'function') return netLog[property]
|
||||||
|
|
||||||
// Returning a native function directly would throw error.
|
// Returning a native function directly would throw error.
|
||||||
return (...args) => netLog[property](...args)
|
return (...args) => netLog[property](...args)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue