Skip to main content

Module selectors

Module selectors 

Source
Expand description

Selector-engine injection and element resolution.

The engine JS (INJECTED_SCRIPT) is registered on self.__pwcdpInjected and exposes querySelectorAll(root, selector), querySelector, and elementState(el). Resolution here goes through Runtime.callFunctionOn and returns CDP RemoteObjectIds; we resolve a single node at a time to avoid materializing (and leaking) handles for every match.

Constants§

INJECTED_SCRIPT
The injected selector-engine bundle, embedded at compile time.

Functions§

count
Count elements matching selector in the given execution context.
element_at
Resolve a single element (by index) to its RemoteObjectId, or None if no element exists at that index.