Skip to main content

Crate reticle_tauri

Crate reticle_tauri 

Source
Expand description

Reticle support for a Tauri app: screenshots, and a headless mode that actually stays awake.

Tauri has no preload stage, so there is nowhere to install a JavaScript shim before app code runs. Everything here is therefore Rust-side, and the browser SDK finds it on its own: it invokes reticle_capture through Tauri’s internals when no preload channel exists. An app wires this up with two lines in main.rs and nothing at all in its frontend.

tauri::Builder::default()
    .invoke_handler(tauri::generate_handler![reticle_tauri::reticle_capture])
    .on_page_load(reticle_tauri::on_page_load)

Constants§

ACTIVE
Whether this build does anything at all: debug builds, or a release build with in-release.
FULL_PAGE_UNSUPPORTED
Returned when fullPage is asked of a platform that can only give the composited viewport.
INERT_IN_RELEASE
What reticle_capture answers in a release build.

Functions§

inert_refusal
The refusal for a build where this crate is inert, else none.
on_page_load
Keep the window drivable behind other windows, and hide it when RETICLE_HEADLESS=1.
reticle_capture
Capture the webview and return the path of the PNG written to the OS temp directory.