News for hackers. Stuff that matters.
Re:Show HN: Chunkify.js – A functional API to unblock your J... by DiThi on Sunday October 04, 2015 @10:09PM (#10329619)
I got over that limitation by converting the code to a data URL, like this:

    var blob = new Blob([worker_code_string], {type: 'application/javascript'});
    var worker_uri = (window.URL || window.webkitURL).createObjectURL(blob);
    var worker = new Worker(worker_uri);
The path to the scripts imported with importScript() must be absolute, though. I add the path by modifying worker_code_string. Alternatively they can be fetched and prepended to the code string (or passed in the array of Blob()).
Re:Show HN: Chunkify.js – A functional API to unblock your J... by Kequc on Monday October 05, 2015 @12:21PM (#10332862)
I was reading about that. It seems pretty strange that these heavy security restrictions on origin are in place but you can create a worker from a string.