Skip to content

Conversation

@sjorsdonkers
Copy link
Contributor

  • dom.querySelector
  • dom.querySelectorAll

For use in chromedp/click


// Dispatch setChildNodesEvents to inform the client of the subpart of node tree covering the results.
var array = [1]*parser.Node{selected_node};
try dispatchSetChildNodes(cmd, array[0..]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try dispatchSetChildNodes(cmd, array[0..]);
try dispatchSetChildNodes(cmd, &.{selected_node});

This this will work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not been able to find the right incantation..
try dispatchSetChildNodes(cmd, &.{selected_node});
results in:

error: expected type '[]*cimport.struct_dom_node_internal', found '*const [1]*cimport.struct_dom_node_internal'
    try dispatchSetChildNodes(cmd, &.{selected_node});
                                   ^~~~~~~~~~~~~~~~~
src/cdp/domains/dom.zig:216:36: note: cast discards const qualifier
src/cdp/domains/dom.zig:103:47: note: parameter type declared here
fn dispatchSetChildNodes(cmd: anytype, nodes: []*parser.Node) !void {

@sjorsdonkers sjorsdonkers mentioned this pull request May 21, 2025
@sjorsdonkers sjorsdonkers merged commit 2cdfc3f into main May 21, 2025
9 checks passed
@sjorsdonkers sjorsdonkers deleted the dom.querySelector branch May 21, 2025 10:36
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants