Crate workflow_dom

Source
Expand description

github crates.io docs.rs license

DOM manipulation utilities.

Provides DOM injection functionality allowing injecting buffer slices into DOM as Blob objects and loading them as <script> or <style> elements. This crate is useful for embedding JavaScript sources and stylesheets directly into WASM files or loading JavaSctipt code from external resources such as a WebSocket.

Example:

use workflow_dom::inject::{inject_blob, Content};

let DATA: &[u8] = include_bytes!("source.js");
inject_blob(Content::Script(None, data)).await?;

Modules§

clipboard
download
error
Errors return by the workflow_dom module
inject
DOM injection utilities, allowing injection of script and style elements from Rust buffers using Blob objects.
link
loader
result
Result type used by the workflow_dom module
utils
Helper functions for accessing DOM environment