<?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>272382</bug_id>
          
          <creation_ts>2024-04-09 02:40:19 -0700</creation_ts>
          <short_desc>Web Inspector does not show console messages from nested workers</short_desc>
          <delta_ts>2024-04-10 05:03:51 -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>Web Inspector</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=255402</see_also>
          <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="Kimmo Kinnunen">kkinnunen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>qianlangchen</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2027088</commentid>
    <comment_count>0</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2024-04-09 02:40:19 -0700</bug_when>
    <thetext>Web Inspector does not show console messages from nested workers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027089</commentid>
    <comment_count>1</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2024-04-09 02:40:35 -0700</bug_when>
    <thetext>diff --git a/LayoutTests/workers/console-log-nested-worker.js b/LayoutTests/workers/console-log-nested-worker.js
new file mode 100644
index 000000000000..47e9054f3b9d
--- /dev/null
+++ b/LayoutTests/workers/console-log-nested-worker.js
@@ -0,0 +1,4 @@
+onmessage = function(e) {
+    console.log(`log from nested worker: ${e.data.msg}`);
+    self.postMessage(&quot;done from nested worker:&quot; + e.data.msg);
+};
diff --git a/LayoutTests/workers/console-log-worker.js b/LayoutTests/workers/console-log-worker.js
new file mode 100644
index 000000000000..4f24a5c2bc80
--- /dev/null
+++ b/LayoutTests/workers/console-log-worker.js
@@ -0,0 +1,8 @@
+const worker = new Worker(&quot;console-log-nested-worker.js&quot;);
+onmessage = function(e) {
+    console.log(`log from worker: ${e.data.msg}`);
+    worker.postMessage({msg: e.data.msg});
+};
+worker.onmessage = function(e) {
+    self.postMessage(&quot;done from worker:&quot; + e.data);
+}
diff --git a/LayoutTests/workers/console-log.html b/LayoutTests/workers/console-log.html
new file mode 100644
index 000000000000..576c55a7b833
--- /dev/null
+++ b/LayoutTests/workers/console-log.html
@@ -0,0 +1,33 @@
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that worker and nested worker console log is printed&quot;);
+window.jsTestIsAsync = true;
+
+const test = (msg) =&gt; new Promise(resolve =&gt; {
+    const w = new Worker(&quot;console-log-worker.js&quot;);
+    w.postMessage({ msg });
+    w.onmessage = (e) =&gt; {
+        debug(e.data);
+        resolve();
+    };
+});
+async function runTest() {
+    console.log(&quot;log from main&quot;);
+    try {
+        await test(&quot;works 1&quot;);
+        await test(&quot;works 2&quot;);
+        testPassed(&quot;Passes if console messages are logged&quot;);
+    } catch (reason) {
+        testFailed(`Rejected: ${reason}`);
+    }
+    finishJSTest()
+};
+runTest();
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027090</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-04-09 02:40:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/126125157&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027213</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-04-09 11:49:47 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 255402 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2027407</commentid>
    <comment_count>4</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2024-04-10 05:03:51 -0700</bug_when>
    <thetext>Unduping.
The bug 255402 is related.
However, there&apos;s bugs in this area even when that bug is fixed</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>