MicrosoftEdge / MicrosoftEdge/WebView2Feedback

CapturePreview completion handler only fires when webview visible

Open
#579 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority-low tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
CapturePreview returns S_OK but never calls the CapturePreviewCompletedHandler if:

a) put_IsVisible( FALSE ) has been called on the controller; or
b) WS_VISIBLE wasn't specified on the parent hWnd passed to CreateCoreWebViewController

This causes problems in headless use cases. Workaround is moving window offscreen but this can cause issues with accessibility tools like screen readers.

Version
SDK: 1.0.622.22
Runtime: Release runtime 86.0.622.51
Framework: Win32
OS: Win10 version 1909

Repro Steps

  1. Run WebView2APISample
  2. Choose Toggle Visibility from View menu to hide web view
  3. Choose Save Screenshot from File menu - the Save As dialog appears but the Preview Captured message box doesn't appear
  4. Wait a couple of minutes then choose Toggle Visibility from View menu to show the web view
  5. The CapturePreviewCompletedHandler now fires and the Preview Captured message box appears

AB#29999309

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WebView2APISample and reproduce the issue using Toggle Visibility and Save Screenshot. Trace the CapturePreview call and its CapturePreviewCompletedHandler while the webview or parent window is hidden; done means the handler fires without making the webview visible.

Written by the indexing model from the issue text.

Assessment

Domain
api, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.