Skip to content
1 min read · 170 words

Interface: BrowserWorkerOptions

Defined in: src/batteries/isolation/browser.ts:48

Minimal subset of the DOM WorkerOptions dictionary this module forwards verbatim to new Worker(url, options) — used ONLY for the string | URL spawn form (a caller-supplied WorkerResolver constructs its own Worker however it likes, this dictionary never applies there). Classic scripts are the default (type omitted) — matching this repo's own LiteRT-LM Worker prototype (docs/.vitepress/theme/components/agent/litert_lm_worker_proxy.ts), which deliberately avoids { type: 'module' } because Emscripten-style glue calls importScripts(), illegal in a module worker. Pass { type: 'module' } explicitly when the guest script is an ES module.

Properties

PropertyTypeDescriptionDefined in
credentials?"omit" | "same-origin" | "include"Worker credentials mode, forwarded verbatim.src/batteries/isolation/browser.ts:52
name?stringA developer-facing name for the worker (surfaced in devtools).src/batteries/isolation/browser.ts:54
type?"classic" | "module"'classic' (default when omitted) or 'module'.src/batteries/isolation/browser.ts:50