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: sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=273906

Description Jed Schmidt 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.
Comment 1 Radar WebKit Bug Importer 2023-09-01 08:58:47 PDT
<rdar://problem/114823273>