drop_file
Simulate file drop operations in Electron apps by dispatching synthetic drag/drop events with file contents for testing and automation purposes.
Instructions
Simulate dropping a file onto a target element by dispatching synthetic drag/drop events with a DataTransfer containing the file contents. Works for apps that read File via web APIs (FileReader, File.text, etc.). Does NOT populate file.path — apps that rely on webUtils.getPathForFile() or legacy file.path must use eval_main to invoke their IPC directly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to a local file. | |
| selector | No | CSS selector of the drop target. Defaults to document.body. | |
| mimeType | No | MIME type for the synthesized File object. Default text/plain. |