1

I'm working with the File System Access API and I have to send a FileSystemDirectoryHandle calling a postMessage(), according to this article it seems to be possible

File handles are serializable, which means that you can save a file handle to IndexedDB, or call postMessage() to send them between the same top-level origin.

I made many try but... noway

In this question @DenverCoder9 proposes a working example for the indexedDb but I can't find anything for the postMessage

Thanks, Davide

Vivadave
  • 15
  • 3

1 Answers1

0

According to this fixed bug transferring file handles via postMessage() is implemented and should work, however, only for same-origin contexts. If it doesn’t work, probably your origins are different.

DenverCoder9
  • 2,024
  • 11
  • 32
  • Ok, thank you, but just a question, the structured cloning algorithm is also used in indexedDb, do you know why it works in that case? – Vivadave Apr 30 '21 at 12:59