Add Browser.setWindowBounds

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-04-18 21:52:06 +02:00
parent aec7455151
commit c54b50eb0c

View File

@@ -10,6 +10,7 @@ const BrowserMethods = enum {
getVersion,
setDownloadBehavior,
getWindowForTarget,
setWindowBounds,
};
pub fn browser(
@@ -25,6 +26,7 @@ pub fn browser(
.getVersion => browserGetVersion(alloc, id, scanner, ctx),
.setDownloadBehavior => browserSetDownloadBehavior(alloc, id, scanner, ctx),
.getWindowForTarget => getWindowForTarget(alloc, id, scanner, ctx),
.setWindowBounds => setWindowBounds(alloc, id, scanner, ctx),
};
}
@@ -103,3 +105,14 @@ fn getWindowForTarget(
};
return result(alloc, id, Resp, Resp{}, content.sessionID.?);
}
fn setWindowBounds(
alloc: std.mem.Allocator,
id: u64,
scanner: *std.json.Scanner,
_: *Ctx,
) ![]const u8 {
// NOTE: noop
const content = try cdp.getContent(alloc, void, scanner);
return result(alloc, id, null, null, content.sessionID);
}