Is there a way to call the function when the user leaves the web page?

Currently, I want to call a function when a user leaves a web page.

This function has database delete fucntion.

  • When one user is accessing: Function not executed
  • When the last remaining user leaves the web page: Run the function

However, I cannot find a way to use the feature in streamlit. Is there any solution

Or is there a way around?

I also hope to have such a feature.

1 Like

Hi @aza1200

This sounds like a feature request, perhaps youโ€™d like to open a GitHub issue here: