browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

api.FileSystemFileHandle.move available in Chrome

Open jozefchutka opened this issue 7 months ago • 2 comments

What type of issue is this?

Incorrect support data (example: BrowserX says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

FileSystemHandle API: move is reported as not supported for Chrome, however it exists and works in runtime.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet)

What did you expect to see?

Expected to see it is supported

Did you test this? If so, how?

FileSystemFileHandle.prototype.move
// -- > ƒ move() { [native code] }

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://github.com/mdn/browser-compat-data/blob/main/api/FileSystemHandle.json https://caniuse.com/mdn-api_filesystemhandle_move https://github.com/whatwg/fs/pull/10

Do you have anything more you want to share?

It somehow went off radar of chromium devs even though it was delivered in past. It is hard to find any traces: https://chromestatus.com/feature/5640802622504960 https://chromestatus.com/feature/6271579653144576

MDN URL

No response

MDN metadata

No response

jozefchutka avatar May 22 '25 13:05 jozefchutka

  • I can reproduce that the FileSystemHandle prototype exposes the move method in Chrome 136.
  • Chrome 95 added FileSystemHandle::move() and FileSystemHandle::rename(): https://github.com/chromium/chromium/commit/89be8a84bf5c962fa363bd093f4f125ac923838c
  • It looks like they're behind the FileSystemAccessAPIExperimental runtime flag though (--enable-blink-features=FileSystemAccessAPIExperimental): https://github.com/chromium/chromium/blob/fdbfa4b5f674400c93cad38a4a27b1a62a1b8dce/third_party/blink/renderer/modules/file_system_access/file_system_handle.idl#L35-L50
  • Moving directories appears to not be supported yet, see Chromium bug 40198035, which references several related changes, and comment 15 mentions:

    Moving files is currently only supported within the OPFS, for which permission requests are automatically granted.

Overall, it is not obvious to me what's really supported.

@jozefchutka Could you try what works on https://file-system-terminal.glitch.me/ without enabling the experimental features flags? It might be that the method is exposed, but doesn't work.

caugner avatar May 23 '25 09:05 caugner

move works for me in chrome 136 with both FS and OPFS using glitch.me demo

I am using the following ts type in my code which works with chrome, safari and firefox

declare global {
	interface FileSystemFileHandle {
		readonly move:(directory:FileSystemDirectoryHandle, newName:string) => Promise<void>;
	}
}

jozefchutka avatar May 23 '25 10:05 jozefchutka