web_task_bridge library
The browser plumbing the family plugins share: one worker per task, created from the family's worker script, with requests and disposal in order; the page's scripts; and the WebGPU adapter. Web only, and not for applications.
Classes
- WebTaskWorker
-
One of Google's tasks on its own worker, from the family's
assets/worker.js.
Functions
-
loadPackageScript(
String package, String asset) → Future< void> -
Adds
package'sasset(such asassets/bridge.js) to the page as a script, once. A failed load is forgotten, so the next call retries it rather than failing every later task. -
readWebGpuAdapter(
) → Future< String?> -
The adapter Google's browser runtimes ask WebGPU for, named for
TaskPlatform.gpuasWebGPUand its vendor, architecture and description, with a fallback adapter marked as such; null without WebGPU. A family whose browser runtime needs WebGPU sets it astaskPlatformGpuReaderwhen its plugin registers.