Merge pull request #8572 from electron/content-tracing-app-ready

Document using content tracing after app ready
This commit is contained in:
Kevin Sawicki 2017-02-03 09:53:53 -08:00 committed by GitHub
commit 2f3578679f

View file

@ -9,9 +9,14 @@ This module does not include a web interface so you need to open
`chrome://tracing/` in a Chrome browser and load the generated file to view the
result.
```javascript
const {contentTracing} = require('electron')
**Note:** You should not use this module until the `ready` event of the app
module is emitted.
```javascript
const {app, contentTracing} = require('electron')
app.on('ready', () => {
const options = {
categoryFilter: '*',
traceOptions: 'record-until-full,enable-sampling'
@ -26,6 +31,7 @@ contentTracing.startRecording(options, () => {
})
}, 5000)
})
})
```
## Methods