<?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>256712</bug_id>
          
          <creation_ts>2023-05-12 09:48:00 -0700</creation_ts>
          <short_desc>structuredClone throws for FileSystemHandles (Origin Private File System)</short_desc>
          <delta_ts>2025-05-22 04:31:38 -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>WebCore Misc.</component>
          <version>Safari 16</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=273906</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jed Schmidt">where</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jozefchutka</cc>
    
    <cc>karlcow</cc>
    
    <cc>me</cc>
    
    <cc>sihui_liu</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1955015</commentid>
    <comment_count>0</comment_count>
    <who name="Jed Schmidt">where</who>
    <bug_when>2023-05-12 09:48:00 -0700</bug_when>
    <thetext>Given the following code:

&gt; await navigator.storage.getDirectory().then(structuredClone)

the expected output would be:

&gt; FileSystemDirectoryHandle {kind: &apos;directory&apos;, name: &apos;&apos;}

but instead, Safari throws:

&gt; DataCloneError: The object cannot be cloned.

Among other things, this lack of serializability means that file system handles cannot be passed to workers to enable write operations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1975011</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-09-01 08:58:47 -0700</bug_when>
    <thetext>&lt;rdar://problem/114823273&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2074204</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-11-10 22:01:58 -0800</bug_when>
    <thetext>*** Bug 282529 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2118951</commentid>
    <comment_count>3</comment_count>
    <who name="Jozef Chutka">jozefchutka</who>
    <bug_when>2025-05-22 04:31:38 -0700</bug_when>
    <thetext>Hi! I wanted to follow up on this issue. I am still encountering this error in Safari Version 18.5 (20621.2.5.11.8):

`DataCloneError: The object can not be cloned.`

It occurs when trying to use FileSystemDirectoryHandle with `structuredClone()` or `postMessage()` to a Worker. This behavior diverges from Chrome and Firefox, which support structured cloning for FileSystemDirectoryHandle.

Any updates or thoughts on prioritizing a fix would be greatly appreciated. Thanks for all your work on WebKit!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>