mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
drats, zig fmt again
This commit is contained in:
@@ -37,7 +37,6 @@ pub fn processMessage(cmd: anytype) !void {
|
|||||||
.performSearch => return performSearch(cmd),
|
.performSearch => return performSearch(cmd),
|
||||||
.getSearchResults => return getSearchResults(cmd),
|
.getSearchResults => return getSearchResults(cmd),
|
||||||
.discardSearchResults => return discardSearchResults(cmd),
|
.discardSearchResults => return discardSearchResults(cmd),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,8 +180,8 @@ pub const NodeSearchList = std.ArrayList(NodeSearch);
|
|||||||
// https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-performSearch
|
// https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-performSearch
|
||||||
fn performSearch(cmd: anytype) !void {
|
fn performSearch(cmd: anytype) !void {
|
||||||
const params = (try cmd.params(struct {
|
const params = (try cmd.params(struct {
|
||||||
query: []const u8,
|
query: []const u8,
|
||||||
includeUserAgentShadowDOM: ?bool = null,
|
includeUserAgentShadowDOM: ?bool = null,
|
||||||
})) orelse return error.InvalidParams;
|
})) orelse return error.InvalidParams;
|
||||||
|
|
||||||
// retrieve the root node
|
// retrieve the root node
|
||||||
@@ -210,7 +209,7 @@ fn performSearch(cmd: anytype) !void {
|
|||||||
// https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-discardSearchResults
|
// https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-discardSearchResults
|
||||||
fn discardSearchResults(cmd: anytype) !void {
|
fn discardSearchResults(cmd: anytype) !void {
|
||||||
const params = (try cmd.params(struct {
|
const params = (try cmd.params(struct {
|
||||||
searchId: []const u8,
|
searchId: []const u8,
|
||||||
})) orelse return error.InvalidParams;
|
})) orelse return error.InvalidParams;
|
||||||
|
|
||||||
var state = cmd.cdp;
|
var state = cmd.cdp;
|
||||||
@@ -256,7 +255,5 @@ fn getSearchResults(cmd: anytype) !void {
|
|||||||
if (params.fromIndex >= items.len) return error.BadFromIndex;
|
if (params.fromIndex >= items.len) return error.BadFromIndex;
|
||||||
if (params.toIndex > items.len) return error.BadToIndex;
|
if (params.toIndex > items.len) return error.BadToIndex;
|
||||||
|
|
||||||
return cmd.sendResult(.{
|
return cmd.sendResult(.{ .nodeIds = ns.?.coll.items[params.fromIndex..params.toIndex] }, .{});
|
||||||
.nodeIds = ns.?.coll.items[params.fromIndex..params.toIndex]
|
|
||||||
}, .{});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,8 +265,7 @@ fn navigate(cmd: anytype) !void {
|
|||||||
try cmd.sendEvent("Page.lifecycleEvent", life_event, .{ .session_id = session_id });
|
try cmd.sendEvent("Page.lifecycleEvent", life_event, .{ .session_id = session_id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try cmd.sendEvent("DOM.documentUpdated", null, .{ .session_id = session_id });
|
||||||
try cmd.sendEvent("DOM.documentUpdated", null, .{.session_id = session_id});
|
|
||||||
|
|
||||||
// frameNavigated event
|
// frameNavigated event
|
||||||
try cmd.sendEvent("Page.frameNavigated", .{
|
try cmd.sendEvent("Page.frameNavigated", .{
|
||||||
|
|||||||
Reference in New Issue
Block a user