Skip to main content

Module manifest

Module manifest 

Source
Expand description

App manifests: optional TOML metadata shipped next to a .wasm module.

For a module at https://host/apps/app.wasm the browser looks for https://host/apps/app.toml (same URL, .wasm.toml). The manifest is optional — apps without one keep the legacy behavior (no metadata, every sensitive API may prompt).

name = "Media Capture Demo"
description = "Camera preview, mic meter, and screenshots"
version = "0.1.0"
permissions = ["camera", "microphone", "screen-capture"]

When a manifest is present it acts as a capability declaration: sensitive APIs not listed in permissions are denied without prompting (the prompt is only shown for declared permissions). Valid permission names are the PermissionKind::name values: camera, microphone, geolocation, screen-capture.

Structs§

AppManifest
Parsed app manifest. All fields except name are optional in the TOML.

Functions§

fetch_manifest
Fetches the manifest for a module URL (HTTP/HTTPS or file://).
load_local_manifest
Loads the sibling manifest for a local .wasm file.
manifest_allows
Whether the current app may request kind.
manifest_path_for
Sibling manifest path for a local .wasm file path.
manifest_url_for
Manifest URL for a .wasm module URL (…/app.wasm…/app.toml).

Type Aliases§

SharedManifest
Shared handle stored in HostState; None when the current app has no manifest.