When browser is refreshed how do I know that

Our Root instance has following property set

this.getApplication().setRootPreserved(true);

Now when I refresh the browser, nothing gets called (like init etc). But I need to capture some event to perform some operations whenever browser is refreshed.

What is the mechanism to capture the refresh event when the above property is set?

If I’m reading the docs correctly, the root will be cleaned up and new one created on refresh:

“Refreshing a browser window WILL cause Root cleanup”
. Does this mean a close event will be fired? I don’t know, it’s unclear. But you can test for it.

Wait, it is clear. Read down further on that page for the code.