From 6b441ed63804c15249de3b879c879a48f8e18b4a Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sat, 23 Mar 2019 22:40:27 -0700 Subject: [PATCH] fix: correctly return properties on the netLog module --- lib/browser/api/net-log.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/browser/api/net-log.js b/lib/browser/api/net-log.js index 4d1b1eb5cd804..0807f571834e8 100644 --- a/lib/browser/api/net-log.js +++ b/lib/browser/api/net-log.js @@ -10,8 +10,12 @@ Object.setPrototypeOf(module.exports, new Proxy({}, { if (!app.isReady()) return const netLog = session.defaultSession.netLog + 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. return (...args) => netLog[property](...args) },