|
@@ -22,12 +22,9 @@ In `preload.js` use the [`contextBridge`][] to inject a method `window.electron.
|
|
|
|
|
|
```js
|
|
|
const { contextBridge, ipcRenderer } = require('electron')
|
|
|
-const path = require('node:path')
|
|
|
|
|
|
contextBridge.exposeInMainWorld('electron', {
|
|
|
- startDrag: (fileName) => {
|
|
|
- ipcRenderer.send('ondragstart', path.join(process.cwd(), fileName))
|
|
|
- }
|
|
|
+ startDrag: (fileName) => ipcRenderer.send('ondragstart', fileName)
|
|
|
})
|
|
|
```
|
|
|
|