Bug 255637
Summary: | Create a sub worker in worker is not supported | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jeason Xu <jeason.xu93> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Jeason Xu
If I want to create a sub-worker in a woker, Worker api is not supported.
// worker.js
new Worker('sub-woker.js');
// main.js
new Worker('worker.js');
worker.js will console.error, "can not find variable Worker"
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
We support nested workers since bug 22723. Are you testing with an older Safari version?
Radar WebKit Bug Importer
<rdar://problem/108537000>
Jeason Xu
(In reply to Alexey Proskuryakov from comment #1)
> We support nested workers since bug 22723. Are you testing with an older
> Safari version?
I test this on lateset 16.4, The Worker api now is not undefined, however. The nested Worker handle can't be built successfully, seems the workes api implemention has bugs.
Here is simple demo code for nested worker:
// worker.js
function Create_Worker() {
let data = "let data = \"setInterval(function(){console.log(\\\"hello1\\\")},10)\"\n" +
"workerhandle = new Worker(URL.createObjectURL(new Blob([data])));\n" +
"console.error(\" typeofworker\",typeof\ Worker)\n"+
"setInterval(function () {\n" +
" console.log(\"hello\")\n" +
"},10)"
workerhandle = new Worker(URL.createObjectURL(new Blob([data])));
}
Alexey Proskuryakov
Console logging not working is a known issue, tracked as bug 255402.
Please test the actual effects of the scripts for now, presumably by posting messages from the nested worker.
If you still see issues, please file a new bug - that way, it will be easier for people working on it to see what it is about without digging through old discussions.
*** This bug has been marked as a duplicate of bug 255402 ***