Use content tracing after app ready
This commit is contained in:
parent
cf694ef32b
commit
7b3e998cc6
1 changed files with 18 additions and 12 deletions
|
@ -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
|
`chrome://tracing/` in a Chrome browser and load the generated file to view the
|
||||||
result.
|
result.
|
||||||
|
|
||||||
```javascript
|
**Note:** You should not use this module until the `ready` event of the app
|
||||||
const {contentTracing} = require('electron')
|
module is emitted.
|
||||||
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const {app, contentTracing} = require('electron')
|
||||||
|
|
||||||
|
app.on('ready', () => {
|
||||||
const options = {
|
const options = {
|
||||||
categoryFilter: '*',
|
categoryFilter: '*',
|
||||||
traceOptions: 'record-until-full,enable-sampling'
|
traceOptions: 'record-until-full,enable-sampling'
|
||||||
|
@ -26,6 +31,7 @@ contentTracing.startRecording(options, () => {
|
||||||
})
|
})
|
||||||
}, 5000)
|
}, 5000)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue