Web APIs
19 Web platform API packages (plus @gjsify/webrtc-native Vala bridge and @gjsify/web-polyfills meta) implemented for GJS using native GNOME libraries.
Web Platform Coverage
34 of 59 web standards
Coverage of relevant W3C and WHATWG standards, including 10 APIs that are explicitly out of scope for desktop GTK apps (Service Worker, FS Access, Web Bluetooth, …).
58% 32 full 2 partial 15 planned 10 out of scope
| Package | GNOME Libs | Implements |
|---|---|---|
abort-controller | — | AbortController, AbortSignal (.abort, .timeout, .any) |
compression-streams | Gio | CompressionStream, DecompressionStream (gzip/deflate/deflate-raw) |
dom-events | — | Event, CustomEvent, EventTarget |
dom-exception | — | DOMException (WebIDL) |
domparser | — | DOMParser.parseFromString with minimal DOM (excalibur-tiled-sized) |
eventsource | Soup 3.0 | EventSource (Server-Sent Events), TextLineStream |
fetch | Soup 3.0, Gio, GLib | fetch(), Request (raw-body via set_request_body_from_bytes), Response, Headers |
formdata | — | FormData, File, multipart encoding |
gamepad | Manette 0.2 | Gamepad, GamepadButton, GamepadEvent, GamepadHapticActuator (dual-rumble) |
message-channel | — | MessageChannel, MessagePort (W3C Channel Messaging; backs @gjsify/iframe WebKit bridge and worker_threads cross-process IPC) |
streams | — | ReadableStream, WritableStream, TransformStream, TextEncoder/DecoderStream |
web-globals | — | Meta-register for every Web API global |
webaudio | Gst 1.0, GstApp 1.0 | AudioContext (GStreamer decodebin + playback chain), AudioBufferSourceNode, GainNode, AudioParam |
webcrypto | GLib | SubtleCrypto (AES, RSA-OAEP/PSS, ECDSA, HMAC, PBKDF2, HKDF, ECDH), CryptoKey, getRandomValues, randomUUID |
webrtc | Gst 1.0, GstWebRTC 1.0, GstSDP 1.0 | Full W3C WebRTC (RTCPeerConnection, RTCDataChannel, RTCRtpSender/Receiver/Transceiver, MediaStream/Track, getUserMedia, RTCDTMFSender, RTCCertificate) |
webrtc-native | Gst 1.0, GstWebRTC 1.0 | Vala/GObject prebuild — main-thread signal bridges consumed by @gjsify/webrtc |
websocket | Soup 3.0 | WebSocket, MessageEvent, CloseEvent (NUL-byte-safe text frames, Autobahn-validated) |
webassembly | — | WebAssembly.compile/instantiate/validate/compileStreaming/instantiateStreaming — Promise-API polyfill wrapping SpiderMonkey’s synchronous constructors; auto-detected by --globals auto |
webstorage | Gio | localStorage, sessionStorage |
xmlhttprequest | Soup 3.0, GLib | XMLHttpRequest (responseType: arraybuffer / blob / json / text / document), FakeBlob + temp-file plumbing for URL.createObjectURL |
Adwaita for browser targets
Section titled “Adwaita for browser targets”| Package | Notes |
|---|---|
@gjsify/adwaita-web | Web Components (AdwWindow, AdwHeaderBar, AdwPreferencesGroup, AdwCard, AdwSwitchRow, AdwComboRow, AdwSpinRow, AdwToastOverlay, AdwOverlaySplitView) + SCSS partials |
@gjsify/adwaita-fonts | Adwaita Sans TTF files + @font-face CSS |
@gjsify/adwaita-icons | Adwaita symbolic icons as importable SVG strings |
| Package | Purpose |
|---|---|
@gjsify/web-polyfills | Umbrella dep — pulls every Web polyfill for scaffolding templates |
Web APIs are available as bare specifiers in GJS builds. The Rolldown plugin handles the aliasing automatically:
// This works in GJS — Soup.Session under the hoodconst response = await fetch('https://api.example.com/data');const data = await response.json();
// WebSocket via Soup.WebsocketConnectionconst ws = new WebSocket('wss://echo.example.com');ws.onmessage = (event) => console.log(event.data);
// WebRTC via GStreamer webrtcbinconst pc = new RTCPeerConnection();const offer = await pc.createOffer();await pc.setLocalDescription(offer);