Created
November 14, 2018 18:05
-
-
Save eddieantonio/32a6d22a2eedc867a9b6d72e6271b8b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var url = URL.createObjectURL(new Blob(['(', MyWebWorker.toString(), '())'], { | |
type: 'text/javascript' | |
})); | |
console.log(url); | |
var worker = new Worker(url); | |
worker.onmessage = function (event) { | |
console.log("from worker:", event); | |
} | |
function MyWebWorker() { | |
postMessage('hello'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment