Accessing device and system APIs.
share_target
navigator.registerProtocolHandler()
SpeechRecognition
PaymentRequest
Access files and directories on the user's local device and create writable files that can be updated.
const handle = await window.showSaveFilePicker(); const writable = await handle.createWritable(); await writable.write("Hello, world!"); await writable.close();
Exposes a mechanism for sharing content to various user-selected targets.
navigator.share(shareData)
Lets a PWA receive data (text, files, URLs) shared from other apps via the system share dialog.
"share_target": { "action": "/share", "method": "POST", "enctype": "multipart/form-data", "params": { "title": "title", "text": "text", "url": "url", "files": [{ "name": "image", "accept": ["image/*"] }] } }
Allows PWAs to register themselves as handlers for certain file types.
"file_handlers": [{ "action": "/open-file", "accept": { "image/svg+xml": ".svg", "image/png": ".png" } }]
Lets a web app register itself as the handler for certain protocols (like mailto: or web+custom:).
mailto:
web+custom:
navigator.registerProtocolHandler("mailto", "https://fancywebmail.com/?compose=%s");
Connect to and communicate with nearby Bluetooth Low Energy (BLE) devices.
const device = await navigator.bluetooth.requestDevice({ filters: [{ services: ["heart_rate"] }] });
Directly communicate with USB devices, enabling data exchange without drivers or native apps.
const device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x2341 }] }); await device.open();
API that converts microphone input to text.
const rec = new SpeechRecognition(); rec.lang = "en-US"; rec.addEventListener("result", e => console.log(e.results[0][0].transcript)); rec.start();
Enables a consistent, secure way for websites to request payments using the browser’s native UI.
const request = new PaymentRequest( [{ supportedMethods: "basic-card" }], { total: { label: "Total", amount: { currency: "USD", value: "9.99" } } } ); let response = await request.show(); response.complete("success"));
Read from and write to NFC tags using a device’s built-in NFC reader.
const reader = new NDEFReader(); await reader.scan(); reader.onreading = e => console.log(e.message.records);