Skip to content

Instantly share code, notes, and snippets.



Created Nov 22, 2013
What would you like to do?
var blob = new Blob([
"onmessage = function(e) { postMessage('msg from worker'); }"]);
// Obtain a blob URL reference to our worker 'file'.
var blobURL = window.URL.createObjectURL(blob);
var worker = new Worker(blobURL);
worker.onmessage = function(e) {
// == 'msg from worker'
worker.postMessage(); // Start the worker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment