mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Add some optional params in methods
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -27,13 +27,28 @@ pub fn emulation(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MediaFeature = struct {
|
||||||
|
name: []const u8,
|
||||||
|
value: []const u8,
|
||||||
|
};
|
||||||
|
|
||||||
fn setEmulatedMedia(
|
fn setEmulatedMedia(
|
||||||
alloc: std.mem.Allocator,
|
alloc: std.mem.Allocator,
|
||||||
id: u64,
|
id: u64,
|
||||||
_: *std.json.Scanner,
|
scanner: *std.json.Scanner,
|
||||||
_: *Ctx,
|
_: *Ctx,
|
||||||
) ![]const u8 {
|
) ![]const u8 {
|
||||||
return result(alloc, id, null, null, null);
|
// input
|
||||||
|
const Params = struct {
|
||||||
|
media: ?[]const u8 = null,
|
||||||
|
features: ?[]MediaFeature = null,
|
||||||
|
};
|
||||||
|
_ = try getParams(alloc, Params, scanner);
|
||||||
|
const sessionID = try cdp.getSessionID(scanner);
|
||||||
|
|
||||||
|
// output
|
||||||
|
// TODO: dummy
|
||||||
|
return result(alloc, id, null, null, sessionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setFocusEmulationEnabled(
|
fn setFocusEmulationEnabled(
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ fn addScriptToEvaluateOnNewDocument(
|
|||||||
const Params = struct {
|
const Params = struct {
|
||||||
source: []const u8,
|
source: []const u8,
|
||||||
worldName: ?[]const u8 = null,
|
worldName: ?[]const u8 = null,
|
||||||
|
includeCommandLineAPI: bool = false,
|
||||||
|
runImmediately: bool = false,
|
||||||
};
|
};
|
||||||
_ = try getParams(alloc, Params, scanner);
|
_ = try getParams(alloc, Params, scanner);
|
||||||
const sessionID = try cdp.getSessionID(scanner);
|
const sessionID = try cdp.getSessionID(scanner);
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ const SessionID = "9559320D92474062597D9875C664CAC0";
|
|||||||
const TargetID = "CFCD6EC01573CF29BB638E9DC0F52DDC";
|
const TargetID = "CFCD6EC01573CF29BB638E9DC0F52DDC";
|
||||||
const BrowserContextID = "65618675CB7D3585A95049E9DFE95EA9";
|
const BrowserContextID = "65618675CB7D3585A95049E9DFE95EA9";
|
||||||
|
|
||||||
|
const TargetFilter = struct {
|
||||||
|
type: []const u8,
|
||||||
|
exclude: bool,
|
||||||
|
};
|
||||||
|
|
||||||
fn tagetSetAutoAttach(
|
fn tagetSetAutoAttach(
|
||||||
alloc: std.mem.Allocator,
|
alloc: std.mem.Allocator,
|
||||||
id: u64,
|
id: u64,
|
||||||
@@ -40,7 +45,8 @@ fn tagetSetAutoAttach(
|
|||||||
const Params = struct {
|
const Params = struct {
|
||||||
autoAttach: bool,
|
autoAttach: bool,
|
||||||
waitForDebuggerOnStart: bool,
|
waitForDebuggerOnStart: bool,
|
||||||
flatten: ?bool = null,
|
flatten: bool = true,
|
||||||
|
filter: ?[]TargetFilter = null,
|
||||||
};
|
};
|
||||||
const params = try getParams(alloc, Params, scanner);
|
const params = try getParams(alloc, Params, scanner);
|
||||||
std.log.debug("params {any}", .{params});
|
std.log.debug("params {any}", .{params});
|
||||||
|
|||||||
Reference in New Issue
Block a user