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
fullPageis asked of a platform that can only give the composited viewport. - INERT_
IN_ RELEASE - What
reticle_captureanswers 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.