I tried below codes but that is not consistent.
if (performance.navigation.type == 2) {
alert("Back button clicked");
}
and,
if (performance.getEntriesByType("navigation")[0].type === 'back_forward') {
alert("Back button clicked");
}
Please suggest if any other possible ways to Detect back button in browsers.