From 813efbcdf75a6f9792d5483d2fcb66edd5a19175 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:05:42 -0500 Subject: [PATCH] docs: fix broken code in drag and drop example (#45336) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Niklas Wenzel --- docs/tutorial/native-file-drag-drop.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/tutorial/native-file-drag-drop.md b/docs/tutorial/native-file-drag-drop.md index 2095777eb26d..bf284cbb6da8 100644 --- a/docs/tutorial/native-file-drag-drop.md +++ b/docs/tutorial/native-file-drag-drop.md @@ -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) }) ```