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

조회 수: 14 (최근 30일)
deniz
deniz 2025년 4월 29일
댓글: deniz 2025년 6월 6일
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

답변 (1개)

Deepak
Deepak 2025년 6월 6일
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
deniz
deniz 2025년 6월 6일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Web App Server에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by