RESOLVED DUPLICATE of bug 255402 255637
Create a sub worker in worker is not supported
https://bugs.webkit.org/show_bug.cgi?id=255637
Summary Create a sub worker in worker is not supported
Jeason Xu
Reported 2023-04-18 19:18:36 PDT
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
Alexey Proskuryakov
Comment 1 2023-04-19 07:42:27 PDT
We support nested workers since bug 22723. Are you testing with an older Safari version?
Radar WebKit Bug Importer
Comment 2 2023-04-25 19:19:19 PDT
Jeason Xu
Comment 3 2023-05-24 01:14:19 PDT
(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
Comment 4 2023-05-24 09:29:45 PDT
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 ***
Note You need to log in before you can comment on or make changes to this bug.