setting edge://settings/downloads flyout menu in code

Springer Rider 6 Reputation points
2022-08-21T17:02:56.383+00:00

Executive Summary: I need to find a way to NOT have the Downloads menu (as shown below) to not appear when my Javascript writes a file to the harddrive. The Edge settings work with a regular Edge browser but those settings do not seem to effect the browser I create in code.
233119-image.png
I am a SW developer. I work predominantly in Delphi. I had written an app that used TWebBrowser but that only works with IE. I now use TEdgeBrowser. Edge does not support calling Active X from Javascript. I have designed a work-around but hit a glitch to it. I want to be able to save a test file to the desktop as below. The prototype code does work.

The problem is when I call it from my instance of TEdgeBrowser, it always opens the fly out menu:
Image

No matter what I have the settings for. It actually worked a few months back but I think an Edge update has changed. The settings work for the desktop browsers but not my instance.

Obviously, these settings are stored somewhere. I can't find it in the registry and have looked through the group policies.

I am on Windows11Pro

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<table>
<tr><td>Text to Save:</td></tr>
<td><button onclick="saveTextAsFile('N:34.00C, S:34.00D, E:8400C, W:8359A', 'ShowBounds')">Save Text to File</button></td>
</table>

<script type="text/javascript">
function saveTextAsFile(textToWrite, fileNameToSaveAs)
{
var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'});
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
if (window.webkitURL != null)
{
downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);
}
downloadLink.click();
}

</script>
</body>
</html>

Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.