-
-
Save matthiasak/e7a7761a8d695c3f4ad39fc7c191243c to your computer and use it in GitHub Desktop.
Revisions
-
SunboX created this gist
Jun 24, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ function worker() { setInterval(function() { postMessage({foo: "bar"}); }, 1000); } var code = worker.toString(); code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}")); var blob = new Blob([code], {type: "application/javascript"}); var worker = new Worker(URL.createObjectURL(blob)); worker.onmessage = function(m) { console.log("msg", m); };