Skip to main content

Module browser_capture_read

Module browser_capture_read 

Source
Expand description

What a Browser capture reads from the page, and the check on what it read: the part of browser_capture.rs that asks the host, so the handler keeps to what is stored and told.

Three ways to read, all by the host, none of which returns the value to the agent:

  • the element a reference names (its field value, or the one secret in its text);
  • text with no reference of its own, found by the label beside it (near), which the host gives a reference of its own so the saved element can be marked like any other;
  • the pageโ€™s own copy button (copy): the host clicks it with the pageโ€™s copy intercepted, so the value never reaches the system clipboard. A click that commits something waits for the person, as an act click does.

Functionsยง

begin ๐Ÿ”’
A shape is a question about a value the agent canโ€™t read: each capture with one is counted, match or miss, and refused when the agent has used its budget. A capture with no shape is never counted.
check_shape ๐Ÿ”’
The value has the shape the agent gave, or nothing is saved. The answer says only that it did not.
counted ๐Ÿ”’
A capture with a shape that the host could not read a value for (no value beside the label, none with the prefix, two of them) is the same answer as a mismatch, and counts as one: the host tests the shape too, to choose the value, so a failure there says whether one matched.
read_page ๐Ÿ”’
Ask the host for the value: {value, origin, ...}, and the wait that holds a click the person approved until the host has made it. An error is the answer to give the agent.
what_to_read ๐Ÿ”’
What the request reads: its reference (empty when near names the text instead), and the shape the value must have. An error says what to give.