Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly return properties on the netLog module (backport: 4-1-x) #17544

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/browser/api/net-log.js
Expand Up @@ -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)
},
Expand Down