Skip to content

Web APIs

19 Web platform APIs implemented for GJS using native GNOME libraries (plus @gjsify/web-polyfills meta).

PackageGNOME LibsImplements
abort-controllerAbortController, AbortSignal (.abort, .timeout, .any)
compression-streamsGioCompressionStream, DecompressionStream (gzip/deflate/deflate-raw)
dom-eventsEvent, CustomEvent, EventTarget
dom-exceptionDOMException (WebIDL)
domparserDOMParser.parseFromString with minimal DOM (excalibur-tiled-sized)
eventsourceSoup 3.0EventSource (Server-Sent Events), TextLineStream
fetchSoup 3.0, Gio, GLibfetch(), Request (raw-body via set_request_body_from_bytes), Response, Headers
formdataFormData, File, multipart encoding
gamepadManette 0.2Gamepad, GamepadButton, GamepadEvent, GamepadHapticActuator (dual-rumble)
streamsReadableStream, WritableStream, TransformStream, TextEncoder/DecoderStream
web-globalsMeta-register for every Web API global
webaudioGst 1.0, GstApp 1.0AudioContext (GStreamer decodebin + playback chain), AudioBufferSourceNode, GainNode, AudioParam
webcryptoGLibSubtleCrypto (AES, RSA-OAEP/PSS, ECDSA, HMAC, PBKDF2, HKDF, ECDH), CryptoKey, getRandomValues, randomUUID
webrtcGst 1.0, GstWebRTC 1.0, GstSDP 1.0Full W3C WebRTC (RTCPeerConnection, RTCDataChannel, RTCRtpSender/Receiver/Transceiver, MediaStream/Track, getUserMedia, RTCDTMFSender, RTCCertificate)
webrtc-nativeGst 1.0, GstWebRTC 1.0Vala/GObject prebuild — main-thread signal bridges consumed by @gjsify/webrtc
websocketSoup 3.0WebSocket, MessageEvent, CloseEvent (NUL-byte-safe text frames, Autobahn-validated)
webstorageGiolocalStorage, sessionStorage
xmlhttprequestSoup 3.0, GLibXMLHttpRequest (responseType: arraybuffer / blob / json / text / document), FakeBlob + temp-file plumbing for URL.createObjectURL
PackageNotes
@gjsify/adwaita-webWeb Components (AdwWindow, AdwHeaderBar, AdwPreferencesGroup, AdwCard, AdwSwitchRow, AdwComboRow, AdwSpinRow, AdwToastOverlay, AdwOverlaySplitView) + SCSS partials
@gjsify/adwaita-fontsAdwaita Sans TTF files + @font-face CSS
@gjsify/adwaita-iconsAdwaita symbolic icons as importable SVG strings
PackagePurpose
@gjsify/web-polyfillsUmbrella 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 hood
const response = await fetch('https://api.example.com/data');
const data = await response.json();
// WebSocket via Soup.WebsocketConnection
const ws = new WebSocket('wss://echo.example.com');
ws.onmessage = (event) => console.log(event.data);
// WebRTC via GStreamer webrtcbin
const pc = new RTCPeerConnection();
const offer = await pc.createOffer();
await pc.setLocalDescription(offer);