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
feat: add --enable-api-filtering-logging command-line switch #20335
Conversation
2bac259
to
6f6b515
Compare
6f6b515
to
39c0d15
Compare
39c0d15
to
a24ba9c
Compare
I feel as though there is a cleaner and less impactful implementation out there for this. What if we captures the trace inside ipcRenderer.send and attached it to the |
@MarshallOfSound that seems quite intrusive as well, @nornagon what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An environment variable doesn't seem like the right way to expose this functionality.
What problem are you trying to solve?
@nornagon when blocking the remote module, sometimes it's hard to figure out where it's being used from. especially when the renderer process is sandboxed, the preload script cannot be debugged easily to see where the exception is thrown. I didn't want to make the stack available by default as I was concerned about the performance impact. |
From past experience it is generally bad idea to change API's behavior with environment variables. |
@zcbenz I agree with that. My concern is the performance impact of always capturing the stack traces if it's not optional. |
@zcbenz what about not changing the API, but just logging the call stacks when the variable is set? |
a24ba9c
to
bb07519
Compare
1d68619
to
c549bb1
Compare
c549bb1
to
1c75a40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with current approach.
94b34f1
to
c052cea
Compare
c052cea
to
d6823d6
Compare
@nornagon modified |
Release Notes Persisted
|
Description of Change
Add
--enable-api-filtering-logging
command-line switch, which enables caller stack logging for the following APIs (filtering events):desktopCapturer.getSources()
/desktop-capturer-get-sources
remote.require()
/remote-require
remote.getGlobal()
/remote-get-builtin
remote.getBuiltin()
/remote-get-global
remote.getCurrentWindow()
/remote-get-current-window
remote.getCurrentWebContents()
/remote-get-current-web-contents
remote.getGuestWebContents()
/remote-get-guest-web-contents
Checklist
npm test
passesRelease Notes
Notes: Added
--enable-api-filtering-logging
command-line switch, which enables caller stack logging fordesktopCapturer
andremote
APIs that can be blocked or filtered.