MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Feature]: Add an IsDestroyed method on WebView2 that tells us if the process behind the control is still around

Open
#4,342 6 comments 0 reactions 2 assignees View on GitHub

@Lakshmisha-KS is already working on this.

Since Feb 12, 2025.

feature request tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Describe the feature/enhancement you need

Electron has an isDestroyed() that we can call on a webcontents/browserview to check if the process is still around. I'm not seeing a similar API/property in Webview2

I can intercept WindowCloseRequested or better yet ProcessFailed and set some flag saying it's destroyed (though maybe realistically I would just exit the application in this situation), but a property/method check would be nice.

The scenario/use case where you would use this feature

Just extra safety. We have a webview2 control property on the main Form. Would be nice if we can ask if it's still around before donig stuff with it (the BrowserProcessId property still shows the old PID even if that process is now destroyed)

How important is this request to you?

Nice to have. There are other ways to tackle this, but having official API support would be beneficial.

Suggested implementation

Some kind of IsDestroyed property or method would be nice.

What does your app do? Is there a pending deadline for this request?

No response

AB#48857882

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.