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

MAUI Webview Process Lifecycle/Crash events #12860

Closed
prerakpatel2 opened this issue Jan 23, 2023 · 5 comments · Fixed by #20059
Closed

MAUI Webview Process Lifecycle/Crash events #12860

prerakpatel2 opened this issue Jan 23, 2023 · 5 comments · Fixed by #20059
Assignees
Labels
area-controls-webview WebView fixed-in-9.0.0-preview.7.24407.4 partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with proposal/open t/enhancement ☀️ New feature or request
Milestone

Comments

@prerakpatel2
Copy link

Description

Expose the lifecycle events of browsers through the API. As the Webviews run in separate processes, it is possible that they can crash or be forced to close by the user/OS. We should be able to react to those events so the app can recover the view if the webview processes crash. The lifecycle events would also allow us to hide the loading of the view until the process is ready for rendering.

Public API Changes

Webview view = new();
view.OnViewProcessTerminated += (event) => {
// Logic to stop processing data for the view and reinitialize the view, log error, or notify of successful shutdown
}
view.OnViewProcessReady += (event) => { logic to hide loading screen }
view.OnViewProcessCloseInitiated += (event) => { logic to cleanup view  }
}

Intended Use-Case

Recovering from crashed processes. We should be able to seamlessly recover from the crash, reload the view, and continue from where we left off. This would also enable to preload the webview and know its ready for rendering when opening a webview based tool.

@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jan 23, 2023
@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Jan 23, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jan 26, 2023
@ghost
Copy link

ghost commented Jan 26, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz jsuarezruiz added the t/enhancement ☀️ New feature or request label Jan 26, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 Planning Jan 27, 2023
@Redth
Copy link
Member

Redth commented Jul 7, 2023

We should ensure that the various delegates for WKWebView can be easily passed in as custom instances.

We do this for UIDelegate currently in a mapper. Navigation Delegate would need the same treatment.

Related to #7551

@Redth Redth modified the milestones: .NET 8 Planning, .NET 8 GA Jul 12, 2023
@mgungorchamp
Copy link

This crashed my app - and I cannot do anything about it. Is there a away to prevent this crash?

[chromium] [INFO:CONSOLE(0)] "Access to XMLHttpRequest at 'https://api.rlcdn.com/api/identity/envelope?pid=1258' from origin 'https://weather.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", source: about:srcdoc (0)
[cr_ChildProcessConn] onServiceDisconnected (crash or killed by oom): pid=10174 bindings:W S
[chromium] [ERROR:aw_browser_terminator.cc(156)] Renderer process (10174) crash detected (code 5).
[chromium] [FATAL:crashpad_client_linux.cc(732)] Render process (10174)'s crash wasn't handled by all associated webviews, triggering application crash.
[libc] Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0xcc9e58be in tid 10036 (board.infoboard), pid 10036 (board.infoboard)

@Eilon
Copy link
Member

Eilon commented Jan 22, 2024

BTW here was a sample of how the process terminated event can be used specifically for BlazorWebView scenarios (not regular WebView): #6481 (comment)

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@rmarinho
Copy link
Member

Fixed by #20059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-webview WebView fixed-in-9.0.0-preview.7.24407.4 partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with proposal/open t/enhancement ☀️ New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants