I want to restrict the page refresh only when we doing this by clicking the refresh icon at the top left side of the browser.
I have tried more available options like,
'beforeunload' event, which can fire on each time of unloading(refresh, navigation, close) the browser.
Inside the event, I have tried 'window.performance.navigation.type'
and window. performance.getEntrieaByType('navigation').map(nav=>nav.type)
options. But both aren't giving the correct result. On each actions like "refresh", "navigation" and "close" getting the same result. Also sometimes getting different result. So I amn't trusting the options.
So can anyone help me to get the correct option to detect the refresh action done by browser refresh icon?
I am using react application.