Bug 256712 - structuredClone throws for FileSystemHandles (Origin Private File System)
Summary: structuredClone throws for FileSystemHandles (Origin Private File System)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-12 09:48 PDT by Jed Schmidt
Modified: 2023-09-01 08:58 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>