mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Add Page.addScriptToEvaluateOnNewDocument
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -10,6 +10,7 @@ const PageMethods = enum {
|
||||
enable,
|
||||
getFrameTree,
|
||||
setLifecycleEventsEnabled,
|
||||
addScriptToEvaluateOnNewDocument,
|
||||
};
|
||||
|
||||
pub fn page(
|
||||
@@ -25,6 +26,7 @@ pub fn page(
|
||||
.enable => enable(alloc, id, scanner, ctx),
|
||||
.getFrameTree => getFrameTree(alloc, id, scanner, ctx),
|
||||
.setLifecycleEventsEnabled => setLifecycleEventsEnabled(alloc, id, scanner, ctx),
|
||||
.addScriptToEvaluateOnNewDocument => addScriptToEvaluateOnNewDocument(alloc, id, scanner, ctx),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,3 +58,15 @@ fn setLifecycleEventsEnabled(
|
||||
// TODO: dummy
|
||||
return result(alloc, id, null, null);
|
||||
}
|
||||
|
||||
fn addScriptToEvaluateOnNewDocument(
|
||||
alloc: std.mem.Allocator,
|
||||
id: u64,
|
||||
_: *std.json.Scanner,
|
||||
_: *Ctx,
|
||||
) ![]const u8 {
|
||||
const Res = struct {
|
||||
identifier: []const u8 = "1",
|
||||
};
|
||||
return result(alloc, id, Res, .{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user