start inspector when the js env starts

This commit is contained in:
Pierre Tachoire
2024-12-29 10:22:46 +01:00
parent c149f65158
commit 4c9a24c64e
3 changed files with 22 additions and 6 deletions

View File

@@ -351,8 +351,16 @@ fn createTarget(
// create the page
const p = try ctx.browser.session.createPage();
ctx.state.executionContextId += 1;
// start the js env
try p.start();
const auxData = try std.fmt.allocPrint(
alloc,
// NOTE: we assume this is the default web page
"{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}",
.{ctx.state.frameID},
);
defer alloc.free(auxData);
try p.start(auxData);
// send targetCreated event
const created = TargetCreated{