[Problem/Bug]: Download fails on JS /w newpage
What happened?
Hi, this occurred in an externally developed app of ours.
here's the examplecode I used: (Here it's a .bin-File but in our Application it is a .doc file, both fail.)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Resource and Open in New Tab</title>
</head>
<body>
<h1>Download and Open in New Tab Example</h1>
<a href="javascript:void(0)" onclick="openInNewTab()">Click me to open the resource in a new tab</a>
<script>
function openInNewTab() {
const url = "https://hil-speed.hetzner.com/100MB.bin";
const a = document.createElement('a');
a.href = url;
a.target = "_blank"; // Opens in a new tab
a.download = "100MB.bin"; // Suggests a filename for download
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
</script>
</body>
</html>
Thanks!
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
135.0.3179.54
SDK Version
1.0.3230-prerelease
Framework
Winforms
Operating System
Windows 11
OS Version
22631.5039
Repro steps
- (Get an example website, if not already available)
- Open WV2 app
- Klick Download link Expected: The page opens & closes automatically + downloads the file in some visible way Actual: The page opens but nothing else seems to happen
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Regression in newer Runtime
Last working version (if regression)
134.0.3124.93
We are seeing the same behavior, and this is highly impactful to users.
Can confirm: Working in 134.0.3124.93 Regression in 135.0.3179.54
Simply installing 135.0.3179.54 causes the issue to manifest.
In our application, one way we are using webview2 is to allow the user to access Sql Server Reporting Services. On clicking 'export to excel', the file download starts but never completes.
@PhilipRieck @MichaeI-GH Are you folks using any specific app framework? Because the provided html worked fine for me in win32 sample app.
v135.0.3179.54
https://github.com/user-attachments/assets/2b54ca46-e262-4884-b381-d73988bc2966
This is how I tested it.
Please check if there are any crashes here. Either visit "edge://crashes" from the webview or find dumps in the User data folder. For more details - https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/crash.md
As mentioned, we are using WinForms. If that's not what you're asking, please elaborate.
The edge://crashes-page does not provide any crashes afterwards.
To me it seems that the new tab opened by JS blocks the download.
We are using the WPF control and seeing the same issue. What seems to happen is that a .tmp extension file is created in the Downloads directory but the process never completes and we are left with a gray window and the user never sees the downloads message. If you rename the .tmp file to the extension you were expecting (xlsx/pdf etc), the file is complete and useable.
Hello,
we have the same experience, we are also using WebView2 to host Reporting services reports; and now Export to Excel stopped working.
WebView2 initialized from Microsoft.WebView2.FixedVersionRuntime.134.0.3124.93.x64.cab works, WebView2 initialized from Microsoft.WebView2.FixedVersionRuntime.135.0.3179.54.x64.cab it does not work.
I was able to reproduce it by running your WebView2WindowsFormsBrowser sample (https://github.com/MicrosoftEdge/WebView2Samples) and navigating it to a public Reporting Services report at https://ssrs.fdot.gov/Reports/report/PDA%20Reports/Public%20Reports/ShortList
Please have a look what has changed and fix it. Thank you very much. Regards Jan
Same issue for us on SDK 1.0.1150.38 and runtime 135.0.3179.54. Issue doesn't occur on runtime 134.0.3124.93.
Same issue for us
Same issue than @janhavel1 here, WPF sdk 135 not work and 134 works
Same issue for us
We're using this in our software products and now have clients hitting this issue and complaining. This is going to start affecting a lot of people so an indication on when this may be fixed would be much appreciated.
@ParadoxZero some information for all of us. What is happening, are you working on the issues and how to continue from now, because our clients complaining about this issue?
Just wanted to add my voice. We have the same problem as @janhavel1 with report server. We host report viewer in a webview2 in WPF. We're starting to get more and more complaints from our clients as the new webview2 version rolls out...
+1 same issue with us unfortunately. We observed it after 135.0.3179.73, but we may have not deployed 135.0.3179.54.
The navigation to download pdf, xls, doc, .. all formats is broken.
Folks, I managed to repro and understand the issue. Thanks a lot for all the help with diagnostics. Will update the thread once the fix has been merged.
The fix is available in version >= 137.0.3269.0. Please help me validate this.
Tested using Canary 137.0.3275.0 and ChannelSearchKind registry key
Work well when downloading PDF files
@ParadoxZero, hello Same problem for me ! Edge need to be updated on my computer ? or WebView2 ? Where can I download WebView2 fixed version ?
Also works for me on Canary, version 137.0.3275.0, using CoreWebView2ChannelSearchKind.LeastStable!
From what I recall, the window usually closes after starting the download & opens the downloads-popup in the original tab (like it does in Edge), which would be nice.
When do you plan on shipping this on stable?
Interestingly I'm able to "view" pdf files.
if html page contains ... <a href="https://demo.com/mydoc.pdf" target="_blank" >mydoc.pdf</a>
However if the ext is .doc or .dotx .docx (Basically any office doc) I don't get download prompt.. just a {guid}.tmp is created in downloads folder
( If I rename the {guid}.tmp file ... to x.doc or what ever the original extension is ... file is valid)
If I right click on link/href tag I'm able to download file w/o issues.
btw CoreWebView2.DownloadStarting doesn't fire.. As other have mentioned.. it work in Edge as expected.
The fix is available in version >= 137.0.3269.0. Please help me validate this.
Verified it works in 137.0.3281.0 (latest canary build at this time) also (download) of .dotx .docx files works.
The fix has been cherry-picked to version >= 136.0.3240.37. It should go out to stable by end of the week. Everyone should be receiving updates by next week.
Closing the issue as fixed.
There seems to be more to it than just this fix.
I have two different versions of our application:
Old version of our application using Microsoft.Web.WebView2 1.0.705.50:
- Canary 137.0.3288.0: Problem occurs
- Stable 135.0.3179.85: Problem occurs
- Old Fixed 134.0.3124.93: Problem does not occur
New version of our application using Microsoft.Web.WebView2 1.0.1418.22
- Canary 137.0.3288.0: Problem does not occur
- Stable 135.0.3179.85: Problem does not occur
- Old Fixed 134.0.3124.93: Problem does not occur
I've verified that the versions given here were actually used when testing (by means of ProcessExplorer, which shows the msedgewebview2.exe-Processes created by our application.
As these versions of our application do not only differ in the version of Microsoft.Web.WebView2 they use, but also in the implementation of WebView2 integration, I do not know whether it is related to the version of Microsoft.Web.WebView2 or some other differences. To narrow it down, I could upgrade the old application version to the newer version of Microsoft.Web.WebView2.
Fortunately, I do not need a fix for the old version of our application.
There seems to be more to it than just this fix.
I have two different versions of our application:
Old version of our application using Microsoft.Web.WebView2 1.0.705.50:
- Canary 137.0.3288.0: Problem occurs
- Stable 135.0.3179.85: Problem occurs
- Old Fixed 134.0.3124.93: Problem does not occur
New version of our application using Microsoft.Web.WebView2 1.0.1418.22
- Canary 137.0.3288.0: Problem does not occur
- Stable 135.0.3179.85: Problem does not occur
- Old Fixed 134.0.3124.93: Problem does not occur
I've verified that the versions given here were actually used when testing (by means of ProcessExplorer, which shows the msedgewebview2.exe-Processes created by our application.
As these versions of our application do not only differ in the version of Microsoft.Web.WebView2 they use, but also in the implementation of WebView2 integration, I do not know whether it is related to the version of Microsoft.Web.WebView2 or some other differences. To narrow it down, I could upgrade the old application version to the newer version of Microsoft.Web.WebView2.
Fortunately, I do not need a fix for the old version of our application.
I do with both versions are not working
Winform Microsoft Web,Webview2 1.0.2535.41 Stable 135.0.3179.85 : Status = problem occurs with new window download file
Winform Microsoft Web,Webview2 1.0.3179.45 Stable 135.0.3179.85 : Status = problem occurs with new window download file
Can anyone confirm if it is fixed in Version 136.0.3240.50? I can still recreate the same download issue where a .tmp file is being created in the downloads folder and not completing the download.
@ParadoxZero
@rishabgt
Version 136.0.3240.64 fixed it for me
I just attempted Version 136.0.3240.64 and it didn't work for me.
Does anyone have a Fixed Version of 134? I can't seem to find one anywhere.
Folks,
Please confirm a few things for me - Is the symptom being experienced is the same as described above? Otherwise please share your individual repro steps to understand if it's a different issue or an extension of the same.
I do not expect a change in SDK version to have an effect here. If it does, it might be a different problem altogether masquerading as the original bug.