XML file downloads are blocked
While using InPrivate mode, downloading XML files triggers a security pop-up showing the file download blocked message.
I used the following options but they didn't work. I didn't find any documentation regarding this.
var options = new EdgeOptions();
options.AddArgument("--safebrowsing-disable-download-protection");
options.AddUserProfilePreference("download.prompt_for_download", false);
options.AddUserProfilePreference("savefile.default_directory", OutputFilePath);

options.AddUserProfilePreference("savefile.prompt_for_download", false);
Hi @RajeshPoola
I’m facing the exact same issue as you with XML files being blocked during download. I would love to know how you managed to solve this issue? Any tips or guidance would be greatly appreciated.
Thanks in advance for your response!
Hi @RajeshPoola
I’m facing the exact same issue as you with XML files being blocked during download. I would love to know how you managed to solve this issue? Any tips or guidance would be greatly appreciated.
Thanks in advance for your response!
@Ssloan18 If you have admin access on your machine you can try this. Call this method before setting up driver
private static void AllowEdgeToDownloadXmlFiles()
{
// Define the registry path and value
const string regPath = @"SOFTWARE\Policies\Microsoft\Edge";
const string regName = "ExemptFileTypeDownloadWarnings";
const string regValue = "[ { \"file_extension\": \"xml\", \"domains\": [\"azurefd.net\"] } ]";
try
{
// Open or create the registry key
using var key = Registry.LocalMachine.CreateSubKey(regPath);
if (key != null)
{
// Set the registry value
key.SetValue(regName, regValue, RegistryValueKind.String);
Console.WriteLine("Registry key set successfully.");
}
else
{
throw new ApplicationException("Failed to create or open the registry key.");
}
}
catch (UnauthorizedAccessException)
{
throw new ApplicationException(
"Access to the registry key is denied. Please run the program as an administrator.");
}
catch (Exception ex)
{
throw new UnauthorizedAccessException("An error occurred: " + ex.Message);
}
}