(Hidden by Administrator)
Bug 1565672 Comment 14 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Just for the case that someone is struggling with the same situation. Here, a short example how to create a worker without loading a file:
```
'use strict';
var mod = function(){
const
workerData = new Blob(
['var i = 0; setInterval(function(){i++; postMessage(i);},500);'], {type: "text/javascript"}
)
;
var
init = function(){
var
myWorker = new Worker(
window.URL.createObjectURL(workerData)
);
;
myWorker.onmessage = function(e){
console.log(e.data);
}
}
;
return{
init : init
};
}();
```