pub struct ContentWebview {
pub label: String,
pub window_label: String,
pub capabilities: Vec<String>,
pub app_acl_manifest: bool,
}Expand description
A webview that renders opened content and may be inspected under DevToolsPolicy::ContentOnly.
Registration is refused unless the content webview cannot reach the app’s IPC: no capability
the app ships may apply to it, by webview label or by the label of its parent window (Tauri
matches a capability’s windows against the window a webview lives in, so a child webview of
the main window inherits the main window’s capability), and the app must declare an
application ACL manifest (without one Tauri lets local-origin pages call every app command).
Fields§
§label: StringLabel of the content webview, or a prefix pattern such as html-content-* for webviews
created per document at run time.
window_label: StringLabel of the window that hosts it.
capabilities: Vec<String>Every capability document of the app, as JSON text (include_str! of each file under
capabilities/, plus any capability added at runtime).
app_acl_manifest: boolThe app declares an ACL manifest for its own commands (tauri_build::AppManifest with
commands(..) in build.rs). The shell cannot read this at runtime, so the app attests it
and right-release checks build.rs for it.
Implementations§
Source§impl ContentWebview
impl ContentWebview
pub fn new(label: &str, window_label: &str) -> Self
Sourcepub fn capability(self, json: &str) -> Self
pub fn capability(self, json: &str) -> Self
Add one capability document (JSON text).
Sourcepub fn app_acl_manifest(self, declared: bool) -> Self
pub fn app_acl_manifest(self, declared: bool) -> Self
Attest that the app declares an ACL manifest for its commands.