mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Add Emulation.setDeviceMetricsOverride
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -10,6 +10,7 @@ const stringify = cdp.stringify;
|
||||
const EmulationMethods = enum {
|
||||
setEmulatedMedia,
|
||||
setFocusEmulationEnabled,
|
||||
setDeviceMetricsOverride,
|
||||
};
|
||||
|
||||
pub fn emulation(
|
||||
@@ -24,6 +25,7 @@ pub fn emulation(
|
||||
return switch (method) {
|
||||
.setEmulatedMedia => setEmulatedMedia(alloc, id, scanner, ctx),
|
||||
.setFocusEmulationEnabled => setFocusEmulationEnabled(alloc, id, scanner, ctx),
|
||||
.setDeviceMetricsOverride => setDeviceMetricsOverride(alloc, id, scanner, ctx),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -69,3 +71,17 @@ fn setFocusEmulationEnabled(
|
||||
// TODO: dummy
|
||||
return result(alloc, id, null, null, sessionID);
|
||||
}
|
||||
|
||||
fn setDeviceMetricsOverride(
|
||||
alloc: std.mem.Allocator,
|
||||
id: u64,
|
||||
scanner: *std.json.Scanner,
|
||||
_: *Ctx,
|
||||
) ![]const u8 {
|
||||
|
||||
// input
|
||||
const content = try cdp.getContent(alloc, void, scanner);
|
||||
|
||||
// output
|
||||
return result(alloc, id, null, null, content.sessionID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user