Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 1.08 KB

File metadata and controls

45 lines (38 loc) · 1.08 KB

API Reference

Core APIs

BrowserEngine

pub struct BrowserEngine {
    pub fn new() -> Result<Self, EngineError>
    pub fn load_url(&mut self, url: &str) -> Result<(), LoadError>
    pub fn execute_script(&mut self, script: &str) -> Result<JsValue, JsError>
    pub fn render_frame(&mut self) -> Result<(), RenderError>
}

JavaScript Bindings

pub trait JsBinding {
    fn bind_to_context(&self, context: &mut V8Context) -> Result<(), BindError>;
}

PWA Runtime

pub struct PwaRuntime {
    pub fn install_app(&mut self, manifest: &Manifest) -> Result<AppId, PwaError>
    pub fn register_service_worker(&mut self, script: &str) -> Result<WorkerId, PwaError>
}

Web APIs

Serial Port API

const port = await navigator.serial.requestPort();
await port.open({ baudRate: 9600 });
const writer = port.writable.getWriter();
await writer.write(new TextEncoder().encode("Hello"));

Cache API

const cache = await caches.open('v1');
await cache.add('/offline.html');
const response = await cache.match('/offline.html');