mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
first version of AXTree
This commit is contained in:
@@ -289,6 +289,7 @@ pub fn CDPT(comptime TypeProvider: type) type {
|
||||
|
||||
pub fn BrowserContext(comptime CDP_T: type) type {
|
||||
const Node = @import("Node.zig");
|
||||
const AXNode = @import("AXNode.zig");
|
||||
|
||||
return struct {
|
||||
id: []const u8,
|
||||
@@ -465,6 +466,16 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn axnodeWriter(self: *Self, root: *const Node, opts: AXNode.Writer.Opts) !AXNode.Writer {
|
||||
const page = self.session.currentPage() orelse return error.PageNotLoaded;
|
||||
_ = opts;
|
||||
return .{
|
||||
.page = page,
|
||||
.root = root,
|
||||
.registry = &self.node_registry,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn getURL(self: *const Self) ?[:0]const u8 {
|
||||
const page = self.session.currentPage() orelse return null;
|
||||
const url = page.url;
|
||||
|
||||
Reference in New Issue
Block a user