Tweak CDP startup messages.

1 - When Target.setAutoAttach is called, send the `Target.attachedToTarget`
    event before sending the response. This matches Chrome's behavior and
    it stops playwright from thinking there's no target and making extra calls,
    e.g. to Target.attachedToTarget.

2 - Use the same dummy frameId for all startup messages. I'm not sure why we
    have STARTUP-P and STARTUP-B. Using the same frame (a) makes more sense to
    me (b) doesn't break any existing integration tests, and (c) improves this
    scenario: https://github.com/lightpanda-io/browser/issues/1800
This commit is contained in:
Karl Seguin
2026-03-13 15:21:41 +08:00
parent c3de47de90
commit 867745c71d
2 changed files with 7 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ pub fn CDPT(comptime TypeProvider: type) type {
return command.sendResult(.{
.frameTree = .{
.frame = .{
.id = "TID-STARTUP-B",
.id = "TID-STARTUP",
.loaderId = "LOADERID24DD2FD56CF1EF33C965C79C",
.securityOrigin = URL_BASE,
.url = "about:blank",