feat: Use frame.collectJavaScriptCallStack()
for renderer ANR in Electron >= v34
#1105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
frame.collectJavaScriptCallStack()
for renderer ANR #1060Previously, renderer process "App Not Responding" events captured stack traces via the Electron debugging API.
Since Electron v34, the
frame.collectJavaScriptCallStack()
API has been added which lets us capture stack traces via the same code used for Chromium's proposed Crash Reporting API.This PR:
StackFrame[]
from a renderercaptureRendererStackFrames(webContents: WebContents): Promise<StackFrame[]>
unresponsive
events rather than our own ANR detection?enableRendererStackCapture
that enables this Chromium feature and injects the requiredDocument-Policy
headersTo enable this feature for renderer ANR:
Main process:
Renderer process:
Why a new top-level option?
I would rather have zero configuration for this feature but since it requires headers to be injected before the page loads, I felt that this was the only reasonable option. We already have a top level option to enable js-profiling because this also requires injection of headers.
Should
captureStackTrace
default to true?Since this feature no longer uses the debugger, we might want to
captureStackTrace: true
the default in this case? When would you not want stack traces?