electron/docs/fiddles/native-ui/drag-and-drop/renderer.js

8 lines
246 B
JavaScript

const { ipcRenderer } = require('electron/renderer')
const dragFileLink = document.getElementById('drag-file-link')
dragFileLink.addEventListener('dragstart', event => {
event.preventDefault()
ipcRenderer.send('ondragstart', __filename)
})