Rename page.id to page._frame_id

This field was recently added and is used to generate correct frameIds in CDP
messages. They remain the same during a navigation event, so calling them
page.id might cause surprises since navigation events create new pages, but
retain the original id. Hence, frame_id is more accurate and hopefully less
surprising.

(This is a small cleanup prior to doing some iframe navigation work).
This commit is contained in:
Karl Seguin
2026-03-02 16:21:29 +08:00
parent 552831364d
commit 10ad5d763e
11 changed files with 70 additions and 70 deletions

View File

@@ -177,7 +177,7 @@ fn createTarget(cmd: anytype) !void {
const page = try bc.session.createPage();
// the target_id == the frame_id of the "root" page
const frame_id = id.toFrameId(page.id);
const frame_id = id.toFrameId(page._frame_id);
bc.target_id = frame_id;
const target_id = &bc.target_id.?;
{
@@ -421,7 +421,7 @@ fn setAutoAttach(cmd: anytype) !void {
if (bc.target_id == null) {
if (bc.session.currentPage()) |page| {
// the target_id == the frame_id of the "root" page
bc.target_id = id.toFrameId(page.id);
bc.target_id = id.toFrameId(page._frame_id);
try doAttachtoTarget(cmd, &bc.target_id.?);
}
}