diff --git a/index.js b/index.js index 700b5ea..65ff0dd 100644 --- a/index.js +++ b/index.js @@ -67,7 +67,8 @@ function registerListener(session, options, callback = () => {}) { const window_ = majorElectronVersion() >= 12 ? BrowserWindow.fromWebContents(webContents) : getWindowFromWebContents(webContents); - const directory = options.directory || app.getPath('downloads'); + let directory = options.directory || app.getPath('downloads'); + directory = path.resolve(directory); // converts any relative path to absolute path let filePath; if (options.filename) { filePath = path.join(directory, options.filename);