MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Feature]: Add an IsDestroyed method on WebView2 that tells us if the process behind the control is still around
@Lakshmisha-KS is already working on this.
Since Feb 12, 2025.
- 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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.