automated-chrome-profiling icon indicating copy to clipboard operation
automated-chrome-profiling copied to clipboard

Timeline data not populated when using Runtime.runScript

Open ngryman opened this issue 7 years ago • 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!

ngryman avatar Apr 26 '17 16:04 ngryman

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 🎉

ngryman avatar May 01 '17 16:05 ngryman

holy crap this is cool.​

paulirish avatar May 01 '17 19:05 paulirish