You can use ‘onbeforeunload’ native javascript listener to look for reload and refresh changes and call browser SDKs logout API which will terminate ongoing call if any.

More details about logout API is available in our WebSDK docs