Gist eeac85f83bbc682a4f2d
✓ Published0🌍 Public
PPhilippe Rivière
Last edited Apr 11, 2015
Created on Apr 11, 2015
This example demonstrates how to run a simple inline Web Worker that greets a user by name, with a fallback to executing the worker script on the main thread when the browser lacks necessary APIs. It uses a `<script type="javascript/worker">` block for the worker code and the `runWorkerJs` helper, which checks for `Blob`, `BlobBuilder`, `URL.createObjectURL`, and `Worker` support. If those are available, it creates a worker from the script’s text and posts a parameter object; otherwise, it evals the script in a proxy scope. The result updates the page body text.
AI-generated description