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 {
|
const EmulationMethods = enum {
|
||||||
setEmulatedMedia,
|
setEmulatedMedia,
|
||||||
setFocusEmulationEnabled,
|
setFocusEmulationEnabled,
|
||||||
|
setDeviceMetricsOverride,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn emulation(
|
pub fn emulation(
|
||||||
@@ -24,6 +25,7 @@ pub fn emulation(
|
|||||||
return switch (method) {
|
return switch (method) {
|
||||||
.setEmulatedMedia => setEmulatedMedia(alloc, id, scanner, ctx),
|
.setEmulatedMedia => setEmulatedMedia(alloc, id, scanner, ctx),
|
||||||
.setFocusEmulationEnabled => setFocusEmulationEnabled(alloc, id, scanner, ctx),
|
.setFocusEmulationEnabled => setFocusEmulationEnabled(alloc, id, scanner, ctx),
|
||||||
|
.setDeviceMetricsOverride => setDeviceMetricsOverride(alloc, id, scanner, ctx),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,3 +71,17 @@ fn setFocusEmulationEnabled(
|
|||||||
// TODO: dummy
|
// TODO: dummy
|
||||||
return result(alloc, id, null, null, sessionID);
|
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