Skip to main content

set_module_origin

Function set_module_origin 

Source
pub fn set_module_origin(state: &HostState, url: &str)
Expand description

Captures the stable origin for a newly loaded module from its URL.

Called by the runtime once per load, before start_app. When the new origin differs from the previous one, per-origin tab state is dropped: session storage is cleared (like sessionStorage across origins in a shared tab) and live media-capture streams are stopped so the new origin can’t read camera frames or microphone samples opened under a grant given to the previous origin.