Skip to content

Conversation

@JeffTsang
Copy link
Contributor

As it turns out, it's still important to handle the termination of the web content process.

@JeffTsang JeffTsang requested a review from a team as a code owner October 11, 2025 05:26
Copy link
Contributor

@pewsheen pewsheen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Looks like the attribute is restricted to macOS and iOS, I think they could be moved to platform platform-specific section in lib.rs:

#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) struct PlatformSpecificWebViewAttributes {
  pub on_web_content_process_terminate_handler: Option<Box<dyn Fn()>>,
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub trait WebViewBuilderExtDarwin {
  fn with_on_web_content_process_terminate_handler(self, handler: impl Fn() + 'static) -> Self;

For curiosity, how do you test whether the method works? Right now I am killing all WebContent processes.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2025

Package Changes Through 3ff8cd4

There are 1 changes which include wry with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.53.4 0.54.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@JeffTsang
Copy link
Contributor Author

I've moved the handler to the platform specific attributes.

It's easiest to test in Simulator by putting the app into the background, killing the WebContent process, and bringing the app back into the foreground.

@pewsheen pewsheen merged commit 84b0ec2 into tauri-apps:dev Oct 15, 2025
19 of 20 checks passed
@JeffTsang JeffTsang deleted the feat/web-content-process-termination branch October 15, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants