Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Web worker from local function
function testFunction () {
console.log('webworker success')
}
var worker = new Worker(URL.createObjectURL(new Blob(['(' + testFunction.toString() + ')()'], {type: 'application/javascript'})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment