I want to conditionally warn the user if they attempt to close the page-tab or the browser.
The wix editor does exactly this. Ie. If you make a change without saving and then click the ‘X’ to close the page-tab (in Chrome for example), A box is displayed saying: “Leave site? Changes you made may not be saved. [Leave] [Cancel]”. I want to be able to do pretty much the same from Corvid code.
I found the following forum article that suggests it’s not possible but I figure if the wix editor can do it, we should be able to do it too, right?? https://www.wix.com/corvid/forum/community-discussion/logging-off-users-automatically-when-they-close-the-browser-tab-or-window
There has been some follow-up forum discussion from the above entry with a solution to log users out if they leave by using the session data store to identify that the user has left the building. In my case this doesn’t work because I want to stop them leaving the building in the first place