Skip to main content

ChromiumTab

Struct ChromiumTab 

Source
pub struct ChromiumTab { /* private fields */ }
Available on crate feature cdp only.
Expand description

一个 Chromium 标签页(或附着的 Electron 窗口)。克隆共享同一底层标签。

Implementations§

Source§

impl ChromiumTab

Source

pub async fn ax_tree(&self) -> Result<AxTree>

CDP 原生无障碍树(Accessibility.getFullAXTree):角色/可见名来自 Chrome 无障碍引擎,最准确。

用于抗改版断言(按角色+名定位)或喂 LLM(语义树比整页 HTML 小一个数量级)。

Source

pub async fn ax_snapshot(&self) -> Result<AxTree>

DOM 派生的近似无障碍快照(注入 AX_SNAPSHOT_JS 按 ARIA 规则算):跨后端一致、 无需 Accessibility 域。准确度略低于 ax_tree,但任何 run_js 能跑处都可用。

Source

pub async fn ax_find(&self, role: &str) -> Result<Vec<AxNode>>

便捷:在原生无障碍树里按角色找节点(返回克隆,避免借用整树)。

Source§

impl ChromiumTab

Source

pub async fn pass_cloudflare_default(&self) -> Result<bool>

自动通过 Cloudflare 挑战(默认 30s 超时)。见 pass_cloudflare

Source

pub async fn pass_cloudflare(&self, timeout: Duration) -> Result<bool>

timeout 内尝试通过 Cloudflare 挑战(整页托管质询 表单内嵌 Turnstile):

  • 已出有效 Turnstile token / 已不是挑战页 → 立即返回 true;
  • 发现 Turnstile 复选框(含闭合 shadow DOM 里的,经 respbox 定位)→ 拟人移动 + 可信点击,等待放行;
  • 只有非交互式挑战(无复选框)→ 轮询等待其自动放行。

返回是否在超时内通过。非破坏:不是挑战页时等价一次轻量探测后立即返回。 内嵌 Turnstile 过盾后 widget 仍留在 DOM,故以 cf-turnstile-response 是否产出 token 为过盾判据 (不能等“挑战消失“)。

Source

pub async fn is_cloudflare(&self) -> Result<bool>

当前是否处于 Cloudflare 挑战页(轻量探测,不点击)。

Source§

impl ChromiumTab

Source

pub async fn print_to_pdf(&self, opts: &PdfOptions) -> Result<Vec<u8>>

把当前页打印为 PDF 字节(Page.printToPDF,对标 Playwright/Puppeteer page.pdf())。 需无头 Chrome(有头模式 Chrome 不一定返回数据)。

Source

pub async fn save_pdf( &self, path: impl AsRef<Path>, opts: &PdfOptions, ) -> Result<PathBuf>

把当前页打印为 PDF 并保存到 path(自动创建父目录)。返回最终路径。

Source

pub async fn set_content(&self, html: &str) -> Result<()>

直接把页面文档内容设为 html(对标 Playwright/Puppeteer page.set_content)。 优先 Page.setDocumentContent,失败回退 document.open/write/close

Source

pub async fn mhtml(&self) -> Result<String>

抓取当前页的 MHTML 单文件快照字符串(Page.captureSnapshot,对标 DP tab.save())。

Source

pub async fn save_mhtml(&self, path: impl AsRef<Path>) -> Result<PathBuf>

抓取 MHTML 并保存到 path(.mhtml)。返回最终路径。

Source

pub async fn expose_function<F>( &self, name: &str, handler: F, ) -> Result<ExposedFunction>
where F: Fn(Vec<Value>) -> Result<Value> + Send + Sync + 'static,

把一个 Rust 闭包暴露成页面里的全局异步函数 window.<name>(...args)(对标 Playwright/Puppeteer expose_function)。页面 await window.name(a,b) 会回调 handler, 其返回值(JSON)作为 Promise 结果回传页面。

反检测取舍:为收到 Runtime.bindingCalled 事件需开 Runtime.enable(同 console()), 故对极致反检测场景慎用。返回的 ExposedFunction 守卫 drop 即停止回调。

Source

pub async fn har_record(&self) -> Result<HarRecorder>

开始录制 HAR(HTTP Archive,含响应体)。在导航前调用;stop()HarLog 落盘。 对标 Playwright record_har

Source

pub async fn har_record_with(&self, capture_bodies: bool) -> Result<HarRecorder>

har_record,capture_bodies=false 则不抓响应体(更省、更快)。

Source§

impl ChromiumTab

Source

pub async fn route_from_har( &self, path: impl AsRef<Path>, opts: &HarReplayOptions, ) -> Result<HarPlayer>

用一个 .har 文件回放网络:命中的请求直接用 HAR 里录的响应满足,不走真实网络 (对标 Playwright route_from_har)。在导航前调用。返回 HarPlayer 守卫。

Source

pub async fn route_from_har_log( &self, log: &HarLog, opts: &HarReplayOptions, ) -> Result<HarPlayer>

用内存里的 HarLog(如刚 har_record().stop() 拿到的)回放网络。

Source§

impl ChromiumTab

Source

pub async fn attach_oopifs(&self, settle: Duration) -> Result<Vec<ChildTarget>>

开启对子 target(OOPIF 跨域 iframe / 专用 worker)的自动附着,收集 settle 时间窗内 已附着的全部子 target;每个都带一个可独立逆向的 ChromiumTab

站点隔离下,跨域 iframe(如 Cloudflare Turnstile)跑在独立进程、主 target 进不去;本方法用 Target.setAutoAttach{flatten:true} 拿到它们的独立 sessionId,从而能在 iframe 内部 scripts()(dump challenge 脚本)/ debugger()(下断点)/ hook()(偷 key)/ listen()(抓包)。

语义:先订阅事件再开启 auto-attach —— 开启那一刻会对当前已存在的子 target 补发 attachedToTarget,故能拿到调用时刻已存在的子 target;settle 是等这些事件汇齐的静默窗 (典型 1–2s)。调用时机:应在「目标 iframe 已出现」之后(如触发 Turnstile、页面渲染完)再调。 嵌套 OOPIF 直接对返回项的 child.tab().attach_oopifs(..) 继续下钻即可。

Source

pub async fn wait_oopif( &self, url_substr: &str, timeout_dur: Option<Duration>, ) -> Result<Option<ChildTarget>>

等待一个 URL 含 url_substr 的子 target 被附着(如等 Turnstile 的 challenges.cloudflare.com iframe 出现),返回其可逆向 tab。超时返回 None。 会先开启 auto-attach;timeout_durNone 时用本标签默认超时。

Source§

impl ChromiumTab

Source

pub fn recorder(&self) -> ChromiumRecorder

录制器句柄(对标 Playwright codegen):录一遍页面操作 → 生成可运行 Rust 代码。

let rec = tab.recorder();
rec.start().await?;          // 导航前起录
tab.get("https://example.com").await?;
// ... 人工(或程序)操作页面 ...
let script = rec.stop().await?;
println!("{}", script.to_rust());   // 可运行 Rust(DP 风格选择器)
Source§

impl ChromiumTab

Source

pub async fn slider_gap(&self, cfg: &SliderConfig) -> Result<SliderGap>

Available on crate feature slider only.

纯视觉:按 SliderConfig 读图、自动选缺口算法,算出拼图需要水平移动的距离(SliderGap)。 要求验证图已显示。读图失败 / 无有效结果返回 Err

Source

pub async fn solve_slider(&self, cfg: &SliderConfig) -> Result<SliderResult>

Available on crate feature slider only.

一把梭:弹出→匹配→闭环拟人拖动→判定→非通过换图重试。返回 SliderResult

Source

pub async fn geetest_slide_gap(&self) -> Result<SliderGap>

Available on crate feature slider only.

极验 v4 滑块缺口(预设 SliderConfig::geetest_v4slider_gap)。

Source

pub async fn solve_geetest_slide(&self) -> Result<SliderResult>

Available on crate feature slider only.

一把梭求解极验 v4 滑块(预设 SliderConfig::geetest_v4solve_slider)。 要调尝试次数等用 solve_slider(&SliderConfig::geetest_v4().max_attempts(8))

Source

pub async fn dingxiang_slide_gap(&self, index: u32) -> Result<SliderGap>

Available on crate feature slider only.

顶象滑块缺口(预设 SliderConfig::dingxiangslider_gap,index=实例后缀)。

Source

pub async fn solve_dingxiang_slide( &self, index: u32, open: Option<&str>, ) -> Result<SliderResult>

Available on crate feature slider only.

一把梭求解顶象滑块(预设 SliderConfig::dingxiang)。弹出式传 open 触发按钮(如 #btn-popup)。 注:顶象 demo 对自动化拖动有轨迹/IP 行为风控会弹回(与缺口算法无关);本方法只保证缺口找得准 + 拖到位。要自定义尝试次数等改用 solve_slider(&SliderConfig::dingxiang(i)...)

Source§

impl ChromiumTab

Source

pub async fn storage_state(&self) -> Result<StorageState>

导出当前登录态:全部 cookie + 当前源的 localStorage / sessionStorage。 对齐 camoufox Tab::storage_state

Source

pub async fn save_storage_state(&self, path: &str) -> Result<()>

导出并存盘(JSON)。对齐 camoufox Tab::save_storage_state

Source

pub async fn load_storage_state(&self, path: &str) -> Result<()>

从磁盘读回并应用(cookie 全量;storage 仅应用与当前源匹配的那组)。 对齐 camoufox Tab::load_storage_state

Source

pub async fn apply_storage_state(&self, state: &StorageState) -> Result<()>

应用一个 StorageState:cookie 全量;localStorage / sessionStorage 仅应用与当前源匹配的那组。 对齐 camoufox Tab::apply_storage_state

Source§

impl ChromiumTab

Source

pub fn set_timeout(&self, d: Duration)

设置默认超时(影响 ele 等待 / 监听 / 拦截)。

Source

pub fn dump_env(&self) -> ChromiumEnvDumper

通用吐环境入口(对齐 camoufox Tab::dump_env):链式指定目标参数(query/header/cookie)与范围后 start() 注入探针。详见 crate::envkit

let mut probe = tab.dump_env().target_query("a_bogus")
    .match_url("aweme/v1/web/aweme/detail").start().await?;
tab.get(url).await?;
let dump = probe.collect().await?;
dump.write_to("./dump-env")?;
Source

pub async fn close(&self) -> Result<()>

关闭本标签(Target.closeTarget);若是 new_tab_with 带代理建的独立 BrowserContext, 一并销毁该上下文(对齐 camoufox Tab::close,池任务结束回收用)。

Source

pub fn timeout(&self) -> Duration

当前默认超时。

Source

pub async fn get(&self, url: &str) -> Result<bool>

导航到 url 并等待 load 事件(最多默认超时)。返回是否在超时内加载完成 (对齐 camoufox Tab::getResult<bool>;超时返回 false,不报错)。

Source

pub async fn get_with(&self, url: &str, opts: &GetOptions) -> Result<bool>

带选项导航(retry/interval/timeout/load_mode/referer),对齐 camoufox Tab::get_with

Source

pub async fn reload(&self) -> Result<()>

重新加载当前页(等到 complete 或超时)。对齐 camoufox Tab::reload

Source

pub async fn back(&self) -> Result<()>

后退一步历史(对齐 camoufox Tab::back)。

Source

pub async fn forward(&self) -> Result<()>

前进一步历史(对齐 camoufox Tab::forward)。

Source

pub async fn stop_loading(&self) -> Result<()>

停止加载(对齐 camoufox Tab::stop_loading)。

Source

pub async fn ready_state(&self) -> Result<String>

当前 document.readyState(loading/interactive/complete)。

Source

pub async fn wait_loaded(&self) -> Result<bool>

在默认超时内等待 document.readyState === 'complete';返回是否就绪(超时 false,不报错)。

Source

pub fn url_available(&self) -> bool

最近一次 get 是否加载成功(同步读,对齐 camoufox Tab::url_available)。

Source

pub async fn user_agent(&self) -> Result<String>

页面 User-Agent(navigator.userAgent)。

Source

pub async fn handle_next_dialog( &self, accept: bool, prompt_text: Option<&str>, ) -> Result<DialogInfo>

接管下一个 JS 对话框(alert/confirm/prompt),accept 是否确认、prompt_text 为 prompt 输入。 对话框会阻塞页面 JS,必须与触发动作并发(tokio::join! 触发 + 本方法)。对齐 camoufox。

Source

pub async fn set_download_path(&self, dir: impl AsRef<Path>) -> Result<()>

设下载目录并允许下载(Browser.setDownloadBehavior,对齐 camoufox 下载落盘)。 同时记录到内核,使后续 downloads()start() 可直接读取。

Source

pub fn downloads(&self) -> ChromiumDownloads

下载管理句柄(对标 DP tab.downloads / 对齐 camoufox Tab::downloads):多任务并发跟踪 + 任务列表 + 进度 + 重命名。基于 CDP 原生下载事件。需先设下载目录 (ChromiumOptions::download_pathset_download_path)。

Source

pub async fn wait_download(&self, timeout: Duration) -> Result<DownloadInfo>

等待一次下载开始并完成(需先 set_download_path),返回信息。 必须与触发下载的动作并发。对齐 camoufox Tab::wait_download

Source

pub async fn run_js(&self, expression: &str) -> Result<Value>

在页面执行 JS 表达式,返回结果值(Runtime.evaluate,自动 await Promise)。

Source

pub async fn title(&self) -> Result<String>

页面标题。

Source

pub async fn url(&self) -> Result<String>

当前 URL。

Source

pub async fn html(&self) -> Result<String>

页面 HTML(documentElement.outerHTML)。

Source

pub async fn ele(&self, selector: &str) -> Result<ChromiumElement>

查找第一个匹配元素(DP 定位语法);未找到立即返回 Error::ElementNotFound

Source

pub async fn wait_ele( &self, selector: &str, timeout: Option<Duration>, ) -> Result<ChromiumElement>

查找第一个匹配元素,在默认超时内轮询等待它出现;超时返回 Error::ElementNotFound

Source

pub async fn eles(&self, selector: &str) -> Result<Vec<ChromiumElement>>

查找所有匹配元素。

Source

pub async fn ele_text(&self, selector: &str) -> Result<Option<String>>

元素可见文本(CSS/xpath 定位);未找到返回 None。便捷封装。

Source

pub async fn s_root(&self) -> Result<StaticElement>

解析当前页面 HTML 为静态根元素(对齐 camoufox Tab::s_root)。

Source

pub async fn s_ele(&self, selector: &str) -> Result<StaticElement>

静态查找第一个匹配元素(离线解析,极快;对齐 camoufox Tab::s_ele)。

Source

pub async fn s_eles(&self, selector: &str) -> Result<Vec<StaticElement>>

静态查找所有匹配元素(对齐 camoufox Tab::s_eles)。

Source

pub async fn get_frame(&self, selector: &str) -> Result<ChromiumFrame>

selector 命中的 <iframe> 的内容帧用于帧内查找(对齐 camoufox Tab::get_frame)。

Source

pub async fn exists(&self, selector: &str) -> Result<bool>

元素是否存在(轻量:只查一次、不等待)。对标 Camoufox 后端 Tab::exists

Source

pub async fn click(&self, selector: &str) -> Result<()>

可信点击定位到的元素(底层走元素句柄的原生点击)。未找到返回 Error::ElementNotFound(对齐 camoufox Tab::clickResult<()>)。

Source

pub async fn input(&self, selector: &str, text: &str) -> Result<()>

给输入框填值(一次性插入)。未找到返回 Error::ElementNotFound (对齐 camoufox Tab::inputResult<()>)。

Source

pub async fn mouse_move(&self, x: f64, y: f64) -> Result<()>

移动鼠标到视口坐标 (x, y)(未按下)。

Source

pub async fn mouse_down(&self, x: f64, y: f64) -> Result<()>

(x, y) 按下左键。

Source

pub async fn mouse_up(&self, x: f64, y: f64) -> Result<()>

(x, y) 松开左键。

Source

pub async fn mouse_drag(&self, x: f64, y: f64) -> Result<()>

按住左键移动到 (x, y)(拖拽中的 move,buttons=1)。

Source

pub fn mouse_move_fast(&self, x: f64, y: f64) -> Result<()>

不等往返移动鼠标(拟人密集采样用,节奏交给调用方 sleep)。对齐 camoufox mouse_move_fast

Source

pub fn mouse_drag_fast(&self, x: f64, y: f64) -> Result<()>

不等往返按住左键移动(拖拽密集采样)。对齐 camoufox mouse_drag_fast

Source

pub async fn wheel_at( &self, x: f64, y: f64, delta_x: f64, delta_y: f64, ) -> Result<()>

在视口坐标 (x, y) 派发滚轮事件(可信 mouseWheel)。对齐 camoufox wheel_at

Source

pub async fn wheel(&self, delta_x: f64, delta_y: f64) -> Result<()>

在视口一个固定可见点派发滚轮事件(wheel_at 的便捷版)。对齐 camoufox wheel

Source

pub async fn scroll_by(&self, x: f64, y: f64) -> Result<()>

直接滚动文档 window.scrollBy(x, y)(对齐 camoufox scroll_by)。

Source

pub async fn press_key(&self, key: &str) -> Result<()>

敲一个键(普通字符或特殊键名,见 Keys)。

Source

pub async fn key_combo(&self, keys: &[&str]) -> Result<()>

修饰组合键 / 热键:最后一项为主键,其余为修饰键(Control/CtrlShiftAltMeta/Cmd)。CDP 原生 modifiers 位掩码,页面读得到 e.ctrlKey/metaKey 等为 true。 作用于当前焦点(先 ele.click()/focus() 选中目标);元素级用 ChromiumElement::shortcut

use drission::prelude::*;
tab.key_combo(&[Keys::CONTROL, "a"]).await?; // 全选
tab.key_combo(&[Keys::CONTROL, Keys::SHIFT, "z"]).await?; // 重做
Source

pub async fn type_keys(&self, parts: &[KeyInput]) -> Result<()>

序列输入(文本片段直接插入、特殊键派发按键)。需先聚焦目标(如先 ele.click())。

Source

pub async fn screenshot_bytes(&self) -> Result<Vec<u8>>

可视区截图(PNG 字节)。

Source

pub async fn screenshot_full_bytes(&self) -> Result<Vec<u8>>

整页截图(PNG 字节,captureBeyondViewport)。

Source

pub async fn get_screenshot( &self, path: impl AsRef<Path>, full_page: bool, ) -> Result<PathBuf>

截图存盘(full_page=true 整页);自动建父目录。对标 Camoufox 后端 Tab::get_screenshot

Source

pub async fn screenshot(&self, opts: &ShotOpts) -> Result<Vec<u8>>

全能力截图(区域 / 整页 / 格式 / 质量)。对齐 camoufox Tab::screenshot(&ShotOpts)

Source

pub async fn screenshot_base64(&self, full_page: bool) -> Result<String>

截图返回 base64 字符串(full_page 整页)。对齐 camoufox Tab::screenshot_base64

Source

pub async fn size(&self) -> Result<(f64, f64)>

可视视口尺寸 (innerWidth, innerHeight)。对齐 camoufox Tab::size

Source

pub async fn page_size(&self) -> Result<(f64, f64)>

整页内容尺寸 (scrollWidth, scrollHeight)。对齐 camoufox Tab::page_size

Source

pub async fn rect(&self) -> Result<PageRect>

页面尺寸 + 滚动 + dpr 综合信息。对齐 camoufox Tab::rect

Source

pub async fn get_cookies(&self) -> Result<Vec<Value>>

全部 cookie(原始 CDP Storage.getCookies 结果,含 httpOnly)。

每项含 name/value/domain/path/expires/httpOnly/secure 等字段。 用于把登录态交接给 SessionPage(纯 HTTP 接力)或存盘复用。

Source

pub async fn cookies(&self) -> Result<Vec<Cookie>>

取全部 cookie 为类型化 Cookie(对齐 camoufox Tab::cookies)。

Source

pub async fn set_cookies(&self, cookies: Vec<CookieParam>) -> Result<()>

批量设置 cookie(对齐 camoufox Tab::set_cookies)。每项至少 name/value + urldomain

Source

pub async fn ocr_image(&self, selector: &str) -> Result<String>

Available on crate feature ocr only.

识别图片验证码:<img> 的 data:URL 直接解码、否则元素截图,再走 OCR。需 --features ocr。 对齐 camoufox Tab::ocr_image:识别走共享识别器 crate::ocr::set_default_ocr热替换槽 优先、否则懒加载默认 ddddocr,故自训模型对本方法即时生效。

Source

pub async fn ocr_calc(&self, selector: &str) -> Result<String>

Available on crate feature ocr only.

一步解计算题验证码:取图(同 ocr_image)→ 识别算术式 → 求值 → 答案字符串 (如 "8")。对齐 camoufox Tab::ocr_calc;识别不出算术式则报错。需 --features ocr

Source

pub fn actions(&self) -> ChromiumActions

动作链句柄(对标 DP tab.actions):链式串鼠标/键盘动作,perform().await 执行。

Source

pub fn scroll(&self) -> ChromiumScroll

滚动句柄(对标 DP tab.scroll):to_top/to_bottom/by/to_location/to_see

Source

pub fn set(&self) -> ChromiumSetTab

设置句柄(对标 DP tab.set):timeout/user_agent/cookies/window()

Source

pub fn wait(&self) -> ChromiumWait

等待句柄(对标 DP tab.wait):doc_loaded/ele_displayed/ele_deleted/title_contains/url_contains

Source

pub async fn paginate<F, Fut, T>( &self, next_selector: &str, max_pages: usize, f: F, ) -> Result<Vec<T>>
where F: FnMut(&ChromiumTab) -> Fut, Fut: Future<Output = Result<T>>,

翻页采集(对齐 camoufox Tab::paginate):每页回调 f 收集结果,点 next_selector 直到按钮不存在/不可点/达 max_pages

Source

pub fn console(&self) -> ChromiumConsole

控制台监听句柄(对标 DP tab.console)。注意:start() 会开 Runtime.enable(反检测取舍)。

Source

pub fn websocket(&self) -> ChromiumWsListener

WebSocket 帧监听句柄(对标 DP 增强):基于 Network 域,不涉及 Runtime.enable

Source

pub fn screencast(&self) -> ChromiumScreencast

录像/连拍句柄(对标 DP tab.screencast):后台按帧间隔截图存 PNG 帧。

Source

pub fn listen(&self) -> CdpListen

网络监听句柄(对标 DP tab.listen):start/wait/wait_count/stop

Source

pub fn debugger(&self) -> ChromiumDebugger

调试器句柄(逆向「主动定位」重武器):XHR/事件断点 + 调用栈 + 断点上下文求值/局部变量 + resume/step + blackbox。详见 ChromiumDebugger注意:会开 Debugger.enable(反检测取舍),按需用、用完即停。

Source

pub fn scripts(&self) -> ChromiumScripts

脚本源码句柄:dump 全部 JS、全文搜索签名字样、纯 Rust 美化混淆代码。 详见 ChromiumScripts。会开 Debugger.enable(反检测取舍)。

Source

pub fn hook(&self) -> ChromiumHook

JS Hook 工具箱句柄(crypto tap):一键 hook 常见 sink,命中回传参数 + 调用栈; hook crypto.subtle/CryptoJS 直接偷 key/iv/明文。详见 ChromiumHook。 复用 expose_function 同款基建(Runtime.enable + addBinding,反检测取舍)。

Source

pub async fn anti_anti_debug(&self) -> Result<()>

反「无限 debugger」:导航前注入 defuse 脚本,致残 setInterval(debugger) / Function("debugger")() 等反调试,使断点跟栈不被打断。在导航前调用。 等价 tab.debugger().anti_anti_debug(), 但不开 Debugger(自包含、零反检测代价)。

Source

pub fn intercept(&self) -> CdpIntercept

请求拦截句柄(对标 DP 拦截增强):start/next/stop,请求级 resume/fulfill/abort

Trait Implementations§

Source§

impl Clone for ChromiumTab

Source§

fn clone(&self) -> ChromiumTab

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl EnvBackend for ChromiumTab

Source§

fn add_init_script(&self, script: &str) -> impl Future<Output = Result<()>>

Available on crate features camoufox or cdp only.
导航前注入脚本(每个新文档最早期执行),并尽量在当前文档也执行一次。
Source§

fn run_js(&self, expr: &str) -> impl Future<Output = Result<Value>>

Available on crate features camoufox or cdp only.
在页面执行 JS 表达式,返回结果值。
Source§

impl FingerprintProbe for ChromiumTab

Source§

fn fp_eval<'life0, 'life1, 'async_trait>( &'life0 self, js: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

底层求值(各后端委托给固有 run_js)。
Source§

fn fingerprint_snapshot<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FingerprintSnapshot>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

读取当前页面的实时 FingerprintSnapshotRead more
Source§

fn identity_report<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<IdentityReport>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

读取当前页面指纹并生成身份一致性诊断报告。
Source§

impl Humanize for ChromiumTab

Source§

fn hm_move<'life0, 'async_trait>( &'life0 self, x: f64, y: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

底层:可信移动 / 按下 / 抬起 / 求值(各后端委托给固有方法)。
Source§

fn hm_move_fast<'life0, 'async_trait>( &'life0 self, x: f64, y: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

不等往返的密集移动(拟人轨迹用)。默认回退到 hm_move(等往返),CDP/Camoufox 覆盖为 fire 快路径——这是轨迹“时间密度“的关键:等往返会把每点间隔抻到 ~20–40ms(行为风控破绽), fire 由 sleep 控节奏可达 ~50–100Hz,逼近真人(见里程碑 32/61)。
Source§

fn hm_down<'life0, 'async_trait>( &'life0 self, x: f64, y: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn hm_up<'life0, 'async_trait>( &'life0 self, x: f64, y: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn hm_eval<'life0, 'life1, 'async_trait>( &'life0 self, js: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn image_view<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ImageView>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

selector 元素的 ImageView(显示 rect + 自然尺寸 + src),用于像素→页面映射与取源图。
Source§

fn human_click<'life0, 'life1, 'async_trait>( &'life0 self, points: &'life1 [(f64, f64)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

依次拟人点击多个页面坐标点(默认参数)。
Source§

fn human_click_with<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, points: &'life1 [(f64, f64)], opts: &'life2 HumanClickOpts, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

human_click,可定制 HumanClickOpts。点间走连续曲线轨迹(密集 mousemove)+ 落点微停 + 可信按下/抬起;首点之前从其上方一随机点移入(模拟从别处移过来)。
Source§

impl SliderTab for ChromiumTab

Available on crate feature slider only.
Source§

fn sl_run_js(&self, js: &str) -> impl Future<Output = Result<Value>>

在页面里执行 JS 表达式并回传其值(缺口像素重活都在此)。
Source§

async fn sl_ele_screenshot(&self, css_selector: &str) -> Result<Vec<u8>>

浏览器级截图某元素(CSS 选择器,taint-proof;顶象拼图跨域 taint 时用)。
Source§

async fn sl_ele_click(&self, css_selector: &str)

best-effort 点击某元素(CSS 选择器;找不到则静默)。
Source§

fn sl_mouse_move(&self, x: f64, y: f64) -> impl Future<Output = Result<()>>

鼠标移动到视口坐标。
Source§

fn sl_mouse_down(&self, x: f64, y: f64) -> impl Future<Output = Result<()>>

鼠标按下(在视口坐标)。
Source§

fn sl_mouse_drag(&self, x: f64, y: f64) -> impl Future<Output = Result<()>>

按住拖动到视口坐标(会等待往返,作节奏“屏障“)。
Source§

fn sl_mouse_drag_fast(&self, x: f64, y: f64) -> Result<()>

按住拖动到视口坐标(同步、不等往返,主滑行密集 fire 用)。
Source§

fn sl_mouse_up(&self, x: f64, y: f64) -> impl Future<Output = Result<()>>

鼠标松开(在视口坐标)。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more