paulirish/automated-chrome-profiling

Timeline data not populated when using Runtime.runScript

ngryman opened this issue · 2 comments

Hi Paul,

Awesome resource again!

I would like to trace several scripts. Instead of using Page.navigate I prefer to inject them on the fly. I'm doing so like this:

const frameworkCode = // loaded source
const testCode = // loaded source

Runtime.compileScript({
  expression: `
    ${frameworkCode}
    ${testCode}
  `,
  sourceURL: 'mount-long-sequence.js',
  persistScript: true
})
.then(Runtime.runScript)

But when I use Tracing to fetch timeline data, I don't have any event related to the JavaScript execution 😢 I've tried to play with categories and finally came to the conclusion that for some reason Tracing doesn't catch JavaScript code executed like this. But I may be wrong.

Do you know if it's possible? Am I missing something?

Thanks!

I created this project based on your resources: https://github.com/ngryman/speedracer.
If I could drop the need of a server it would be awesome 🎉