Skip to content

Instantly share code, notes, and snippets.

@cs09g
Created August 12, 2020 23:53
Show Gist options
  • Save cs09g/6a676e7aaaa9e82ff0cb67cccc7b0422 to your computer and use it in GitHub Desktop.
Save cs09g/6a676e7aaaa9e82ff0cb67cccc7b0422 to your computer and use it in GitHub Desktop.
Web Worker without creating new .js file
const workerScript = `
// your script here
`;
const blob = new Blob([
workerScript,
], {
type: "text/javascipt"
});
const worker = new Worker(window.URL.createObjectURL(blob));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment