Bug 256712

Summary: structuredClone throws for FileSystemHandles (Origin Private File System)
Product: WebKit Reporter: Jed Schmidt <where>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: jozefchutka, karlcow, me, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=273906

Jed Schmidt
Reported 2023-05-12 09:48:00 PDT
Given the following code: > await navigator.storage.getDirectory().then(structuredClone) the expected output would be: > FileSystemDirectoryHandle {kind: 'directory', name: ''} but instead, Safari throws: > 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.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-09-01 08:58:47 PDT
Karl Dubost
Comment 2 2024-11-10 22:01:58 PST
*** Bug 282529 has been marked as a duplicate of this bug. ***
Jozef Chutka
Comment 3 2025-05-22 04:31:38 PDT
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!
Note You need to log in before you can comment on or make changes to this bug.