I’m currently looking for a way to prevent a Theia tab (displaying a Webview) from closing (in case there is some unsaved changes within it).
From my research, I found out that VSCode API cannot provide such mechanism, since a VSCode extension cannot prevent a tab from closing.
What I’m trying to achieve is :
If user tries to close the tab and we detect somehow from within the Webview that there are some unsaved changes, we prevent it and display a confirmation dialog. Then the user can either effectively close it and lose the changes or cancel the closing and save it from within the Webview.
I was wondering if there is any Contribution Point on Theia I could implement to achieve this ?
Thanks in advance for your help !