I need to store a window size and position for multiple windows in tauri. And restore it after open. For example there was opened 3 windows and they have located in different parts of desktop. And when i'll open an application again app will restore all three windows(windows are the same) and restore their positions and size. Is it possible?
Tauri has a plugin for exactly this: https://github.com/tauri-apps/tauri-plugin-window-state (recommended solution). You don't necessarily have to use this but its code should serve as good inspiration.
A JS-only solution is a bit tricky because there is no exit-requested event for the event loop on the JS side, only close-requested for the windows.
This wouldn't be an issue if you have a specific point in time where you want to save the windows. In that case you could just save a json file to disk containing the size/position and the window labels which you then read on app start to re-size/re-position the window.