mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
Add Browser.setWindowBounds
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -10,6 +10,7 @@ const BrowserMethods = enum {
|
|||||||
getVersion,
|
getVersion,
|
||||||
setDownloadBehavior,
|
setDownloadBehavior,
|
||||||
getWindowForTarget,
|
getWindowForTarget,
|
||||||
|
setWindowBounds,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn browser(
|
pub fn browser(
|
||||||
@@ -25,6 +26,7 @@ pub fn browser(
|
|||||||
.getVersion => browserGetVersion(alloc, id, scanner, ctx),
|
.getVersion => browserGetVersion(alloc, id, scanner, ctx),
|
||||||
.setDownloadBehavior => browserSetDownloadBehavior(alloc, id, scanner, ctx),
|
.setDownloadBehavior => browserSetDownloadBehavior(alloc, id, scanner, ctx),
|
||||||
.getWindowForTarget => getWindowForTarget(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.?);
|
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);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user