This proposes to expose read-only files on the clipboard to renderers using a similar approach to drag-and drop. Renderers will have access to read file paths from the clipboard, but not write paths to the clipboard. For file paths on the clipboard, renderers will have read-only access. async function onPaste(e) { let file = e.clipboardData.files[0]; let contents = await file.text(); }
Motivation
Chrome supports files via DataTransfer for drag and drop, but not for clipboard. It is useful for users to be able to use clipboard keyboard shortcuts such as Ctrl+C, Ctrl+V for a task such as attaching a file to an email rather than only drag and drop.
Documentation
Specification
Status in Chromium
In developer trial (Behind a flag) (tracking bug) in:
- Chrome for desktop release 90
Consensus & Standardization
- Under consideration
- No signal
- Shipped/Shipping
- Positive
Owner
Last updated on 2021-04-08