wasmhv

package
v1.3.106 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package wasmhv pkg/wasmhv/embed.go c3-vis-wasm

Package wasmhv pkg/wasmhv/vnet_fallback.go c3-vis-wasm

Index

Constants

This section is empty.

Variables

View Source
var AutoUpdateJS []byte

AutoUpdateJS is pkg/wasmhv/autoupdate.js — the self-update poller for the `hv serve` desk: it compares a /wasm-version fingerprint against the version the page booted with and reloads to a newer build (toast + opt-out). Injected ONLY by hv serve, so it never runs for a native-hosted hypervisor UI.

View Source
var BrowseBootstrapHTML []byte

Real-origin mesh browser, served on the isolated browse origin B (<id>.mesh.localhost) and the visor origin V.

The worker, the bridge protocol and the trust boundary come from github.com/0magnet/realorigin — realorigin.ServiceWorkerJS() and realorigin.ResponderJS(). Only two pieces stay here, and both are ours rather than the substrate's:

BrowseBootstrapHTML — B's navigation shell. The library ships a plain one;
                      this keeps skywire's, which shows the live route-setup
                      log while a mesh route is being built.
BrowseTransportJS   — the transport realorigin calls: dmsg, skynet and
                      skysocks-lite through V's own first-party visor.
View Source
var BrowseJS = browseui.BrowseJS

BrowseJS is the desk bundle (bottle's jsfs + vnet + proc, the skywire seeding and exec glue, the Go-browser launcher) served as /browse.js beside every desk page.

Re-exported from the dependency-free browseui leaf package so pkg/visor can serve the SAME bundle in the native hypervisor UI without an import cycle.

View Source
var BrowseTransportJS []byte
View Source
var CtlBridgeJS []byte

CtlBridgeJS is pkg/wasmhv/ctl-bridge.js — the browser side of the ctlbridge control surface (pkg/wasmhv/ctlbridge). It connects the tab to /ctl/events over SSE so a shell can drive the in-tab wasm-visor. Injected ONLY when the harness control surface is enabled (the dev harness, or `hv serve --harness`), never on the public serving path.

View Source
var FaviconICO []byte

FaviconICO is the wasm-visor's browser-tab favicon: the Skywire mesh-cloud mark tinted violet, so a wasm-visor tab is distinct at a glance from a host-native hypervisor tab. Served at /favicon.ico by ServeWasm.

View Source
var PWAIcon192 []byte

PWAIcon192 / PWAIcon512 are the maskable install icons referenced by the manifest, served at /icon-192.png and /icon-512.png.

View Source
var PWAIcon512 []byte
View Source
var PWAManifest []byte

PWAManifest is pkg/wasmhv/manifest.webmanifest — the Web App Manifest that makes the `hv serve` page installable (name, icons, standalone display). Served at /manifest.webmanifest and linked from the injected <head>. Only meaningful for the served standalone (a service worker needs a real same-origin URL), so it is NOT used by the single-file generator.

View Source
var ServiceWorkerJS []byte

ServiceWorkerJS is pkg/wasmhv/sw.js — the PWA service worker: precaches the app shell and serves cache-first for content-hashed bundles / network-first for everything else (so autoupdate.js stays correct online, offline still launches).

View Source
var WalletConfigHTML = browseui.WalletConfigHTML

WalletConfigHTML is the single wallet-config page, served at wallet/config by the hypervisor and framed by the dashboard's wallet tab. Re-exported from the browseui leaf like BrowseJS.

View Source
var WasmExecJS []byte

WasmExecJS is Go's lib/wasm/wasm_exec.js — the loader every page serves beside the skywire command module and the netview module (pkg/tpviz/netview). It MUST match the Go toolchain that built both, the go.mod version. Refresh it from $(go env GOROOT)/lib/wasm/wasm_exec.js when the toolchain moves.

View Source
var WasmExecTinyGoJS []byte

WasmExecTinyGoJS is the loader for a module TinyGo built, served at /wasm_exec_tinygo.js where bottle looks for it. Empty means none is served.

Functions

func DeskBootJS

func DeskBootJS() []byte

DeskBootJS is the shared desk boot (skywireDeskBoot) behind the desk-first pages — the docs playground and `hv serve`'s /desk. Re-exported from the browseui leaf like BrowseJS.

func ExecWorkerJS

func ExecWorkerJS() []byte

ExecWorkerJS is the worker bundle served beside the desk pages as /skywire-worker.js — the thread every skywire COMMAND runs on, so the visor's Go runtime is not the thing scheduling on the page's main thread. Re-exported from the browseui leaf like BrowseJS.

func ServeVNetFallback added in v1.3.100

func ServeVNetFallback(w http.ResponseWriter, _ *http.Request)

ServeVNetFallback serves vnetFallbackHTML for a /vnet/ path.

func ServiceWorkerFor

func ServiceWorkerFor(build string, precache []string) []byte

ServiceWorkerFor renders sw.js for one serving context: build is the fingerprint that names the cache (a new build ships a byte-different worker, which is what makes the browser re-install it), precache the shell files installed up front — the rest is cached as it is fetched.

func VNetSWJS

func VNetSWJS() []byte

VNetSWJS is bottle's vnet service worker, served beside the desk pages as /vnet-sw.js (a service worker's scope is capped at its script's directory). Re-exported from the browseui leaf like BrowseJS.

Types

This section is empty.

Directories

Path Synopsis
Package browseui pkg/wasmhv/browseui/embed.go c3-vis-wasm Assembles the desk bundle from its promoted home — the OS layer (github.com/0magnet/bottle: jsfs + vnet + proc) — plus the skywire-specific pieces: seed-skywire.js (the package-install filesystem layout), skywire-exec.js (per-command execution of the skywire CLI wasm), and gobrowser-loader.js (the launcher for the netscrape Go browser, which is compiled into the one skywire module as globalThis.skywireBrowser).
Package browseui pkg/wasmhv/browseui/embed.go c3-vis-wasm Assembles the desk bundle from its promoted home — the OS layer (github.com/0magnet/bottle: jsfs + vnet + proc) — plus the skywire-specific pieces: seed-skywire.js (the package-install filesystem layout), skywire-exec.js (per-command execution of the skywire CLI wasm), and gobrowser-loader.js (the launcher for the netscrape Go browser, which is compiled into the one skywire module as globalThis.skywireBrowser).
Package cabundle pkg/wasmhv/cabundle/cabundle.go c3-vis-wasm
Package cabundle pkg/wasmhv/cabundle/cabundle.go c3-vis-wasm
Package ctlbridge pkg/wasmhv/ctlbridge/ctlbridge.go c3-vis-wasm
Package ctlbridge pkg/wasmhv/ctlbridge/ctlbridge.go c3-vis-wasm
Package deskhost pkg/wasmhv/deskhost/browseorigin.go c3-vis-wasm Untagged on purpose, like sameorigin.go: pure string work with no syscall/js, so the rules it encodes — which URLs earn a real isolated origin, and what canonical string names the target — are pinned by tests that actually run in CI.
Package deskhost pkg/wasmhv/deskhost/browseorigin.go c3-vis-wasm Untagged on purpose, like sameorigin.go: pure string work with no syscall/js, so the rules it encodes — which URLs earn a real isolated origin, and what canonical string names the target — are pinned by tests that actually run in CI.
Package execwasm pkg/wasmhv/execwasm/execwasm.go c3-wasm-embed
Package execwasm pkg/wasmhv/execwasm/execwasm.go c3-wasm-embed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL