

I follow the guide of window.WebviewWindow ( https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow ), everything is OK.
But if I change the event from 'tauri://created' to 'tauri://close-requested' (or tauri://destroyed), the event handler won't be invoked.
What I want to do is to save working data and close other hidden windows after user click 'close' button of the main window.
I have tried listen 'tauri://close-requested' , ' tauri://destroyed' and set window.onbeforeunload, none of them works.
Please help.
I follow the guide of window.WebviewWindow ( https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow ), everything is OK.
But if I change the event from 'tauri://created' to 'tauri://close-requested' (or tauri://destroyed), the event handler won't be invoked.
What I want to do is to save working data and close other hidden windows after user click 'close' button of the main window.
I have tried listen 'tauri://close-requested' , ' tauri://destroyed' and set window.onbeforeunload, none of them works.
Please help.