When closing Web App, the browser ask for : leave site? ... How to disable it?

3 vues (au cours des 30 derniers jours)
deniz
deniz le 29 Avr 2025
Commenté : deniz le 6 Juin 2025
Hi,
I think my problem has no answers but I'd like to state the problem.
I deployed a web app on the internet and whenever a user tries to close it using the cross symbol on the tab. The browser asks : Leave site? The changes you made may not be saved. There is nothing to be saved in the app and I believe there should be a feature in Matlab that will stop producing that warning.
Deniz

Réponses (1)

Deepak
Deepak le 6 Juin 2025
Hi @deniz,
I understand that you are encountering the “Leave site? Changes you made may not be saved.” warning when users close your deployed MATLAB Web App, even though there is no data to be saved. This behavior is actually triggered by the browser itself — not MATLAB — when it detects that a webpage might be managing unsaved data, often due to JavaScript event handlers like "onbeforeunload".
Currently, MATLAB Web App Server automatically includes such handlers to prevent accidental session termination, which can be useful in cases where long-running computations or inputs are involved. However, there is no supported way to disable this browser prompt from within the MATLAB Web App framework.
If this prompt is affecting user experience, a potential workaround is to deploy your app as a standalone desktop application using MATLAB Compiler rather than as a web app, where this browser behavior will not apply.
I hope this helps.
  1 commentaire
deniz
deniz le 6 Juin 2025
I was discussing this issue with AI, I also read something on the web that people encountered similar issues when deploying a site (not Matlab), it is related to the browser indeed, specifically JavaScript I believe, on the other hand, for Matlab users, there seems to be no workaround for this issue. AI says that there needs to be a feature put in place by Matlab to prevent it. It doesn’t bother me much because it is not a serious web app but I’d like to report it at least.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Web App Server dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by