Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: Printing page to PDF bypasses download/saveAs event handlers, may cause browser crash #5039

Open
Kay-Burchardt opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Kay-Burchardt
Copy link

What happened?

Our application registers handlers for both the DownloadStarting and SaveAsUiShowing events. Both handlers should suppress the default UI since we implemented our own download UI. This is mostly working as expected, but there is one use case where neither of these handlers is called and the default SaveAs and Download UI is displayed instead:

  • Open any arbitrary page.
  • Use shortcut CTRL+P or context menu "Print" to open the print page UI.
  • In the device selection combo, choose "Save as PDF file"
    --> first the default "Save as" dialog is shown and then the default download popup in the top right corner of the canvas.

If the user tries to close the browser tab containing the download popup, the whole browser process crashes. See bug #5035. The crash can be mitigated by closing the download popup before attempting to close the tab. Luckily Webview2 has an API to programmatically check and close open default download UIs, so I could implement a workaround.

However, we expect that the described use case is also covered by the DownloadStarting and SaveAsUiShowing events so it blends with our custom UI.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

131.0.0.0

SDK Version

1.0.2903.40

Framework

Win32

Operating System

Windows 11

OS Version

No response

Repro steps

  • Open any arbitrary page.
  • Use shortcut CTRL+P or context menu "Print" to open the print page UI.
  • In the device selection combo, choose "Save as PDF file"
    --> first the default "Save as" dialog is shown and then the default download popup in the top right corner of the canvas.

Expected: Our application registers handlers for both the DownloadStarting and SaveAsUiShowing events. Both handlers should suppress the default UI since we implemented our own download UI.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

@Kay-Burchardt Kay-Burchardt added the bug Something isn't working label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Hi, @Kay-Burchardt!

It seems that your issue contains the word "crash". If you have not already, could you attach a crash dump as a comment?

WV2 crash dumps are located in a subfolder of the app's user data folder (UDF): <UDF>\EBWebView\Crashpad\reports\. By default, the user data folder is created in the app's folder with a name like <App Exe Name>.exe.WebView2. Refer to Crash Diagnostics for more information.

Thank you for your cooperation!

@Kay-Burchardt
Copy link
Author

No crashpad report/dump is created for this crash!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant