Skip to content

Commit 98809d8

Browse files
authored
fix: honor user-defined Downloads directory (electron#29938)
1 parent 372ecf3 commit 98809d8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

shell/browser/electron_browser_client.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,12 +1017,10 @@ ElectronBrowserClient::GetPlatformNotificationService(
10171017
}
10181018

10191019
base::FilePath ElectronBrowserClient::GetDefaultDownloadDirectory() {
1020-
// ~/Downloads
1021-
base::FilePath path;
1022-
if (base::PathService::Get(base::DIR_HOME, &path))
1023-
path = path.Append(FILE_PATH_LITERAL("Downloads"));
1024-
1025-
return path;
1020+
base::FilePath download_path;
1021+
if (base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &download_path))
1022+
return download_path;
1023+
return base::FilePath();
10261024
}
10271025

10281026
scoped_refptr<network::SharedURLLoaderFactory>

0 commit comments

Comments
 (0)