Javascript - Check if browser back button was clicked

Reload the page with javascript if browser back button was clicked

if (window.performance && window.performance.navigation && window.performance.navigation.type &&
	window.performance.navigation.type == 2) {
	window.location.reload(false);
}