<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>255637</bug_id>
          
          <creation_ts>2023-04-18 19:18:36 -0700</creation_ts>
          <short_desc>Create a sub worker in worker is not supported</short_desc>
          <delta_ts>2023-05-24 09:29:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit API</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>255402</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeason Xu">jeason.xu93</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1949639</commentid>
    <comment_count>0</comment_count>
    <who name="Jeason Xu">jeason.xu93</who>
    <bug_when>2023-04-18 19:18:36 -0700</bug_when>
    <thetext>If I want to create a sub-worker in a woker, Worker api is not supported.

// worker.js
new Worker(&apos;sub-woker.js&apos;);

// main.js
new Worker(&apos;worker.js&apos;);

worker.js will console.error, &quot;can not find variable Worker&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1949728</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-04-19 07:42:27 -0700</bug_when>
    <thetext>We support nested workers since bug 22723. Are you testing with an older Safari version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951236</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-04-25 19:19:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/108537000&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957574</commentid>
    <comment_count>3</comment_count>
    <who name="Jeason Xu">jeason.xu93</who>
    <bug_when>2023-05-24 01:14:19 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #1)
&gt; We support nested workers since bug 22723. Are you testing with an older
&gt; Safari version?

I test this on lateset 16.4, The Worker api now is not undefined, however. The nested Worker handle can&apos;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 = &quot;let data = \&quot;setInterval(function(){console.log(\\\&quot;hello1\\\&quot;)},10)\&quot;\n&quot; +
        &quot;workerhandle = new Worker(URL.createObjectURL(new Blob([data])));\n&quot; +
		&quot;console.error(\&quot; typeofworker\&quot;,typeof\ Worker)\n&quot;+
        &quot;setInterval(function () {\n&quot; +
        &quot;    console.log(\&quot;hello\&quot;)\n&quot; +
        &quot;},10)&quot;
    workerhandle = new Worker(URL.createObjectURL(new Blob([data])));
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957641</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-05-24 09:29:45 -0700</bug_when>
    <thetext>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 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>