From 8a6a661859bf371e410e460e350a7e82af9c3ebc Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Wed, 24 Apr 2024 00:28:09 -0500 Subject: [PATCH] fix exclusive if --- .../browser/download/chrome_download_manager_delegate.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chrome/browser/download/chrome_download_manager_delegate.cc b/src/chrome/browser/download/chrome_download_manager_delegate.cc index e73ba824..93661d7c 100644 --- a/src/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/src/chrome/browser/download/chrome_download_manager_delegate.cc @@ -1706,8 +1706,12 @@ bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferredForFile( bool ChromeDownloadManagerDelegate::ShouldBlockFile( download::DownloadItem* item, download::DownloadDangerType danger_type) const { + // Don't block downloads if flag is set + if (base::CommandLine::ForCurrentProcess()->HasSwitch("allow-insecure-downloads")) { + return false; + } // Chrome-initiated background downloads should not be blocked. - if (item && !item->RequireSafetyChecks() || base::CommandLine::ForCurrentProcess()->HasSwitch("allow-insecure-downloads")) { + if (item && !item->RequireSafetyChecks()) { return false; }