I see there is a different handling of history browsing in Chrome and Safari compared to Firefox and IE. When I try to go to a page that protected by an Access Manager, it gets redirected to the Access Manager for authentication. If I click the back button in Chrome and Safari, I would go to the previous page, but if I try to do the same on Firefox and IE, it seems they try to go to the original page and then it's again redirected to the Access Manager page. In other words I cannot get back.
As I have a button in my webpage that replicates what the back button does I implemented the following javascript code in order to make it work:
function goBack() {
if (navigator.userAgent.indexOf('Chrome') != -1 || navigator.userAgent.indexOf('Safari') != -1){
window.history.go(-1);
}
else{
window.history.go(-2);
}
It works nice but I've read that the widely accepted way of identifying the different browsers is by detecting its features.
Is there a feature that I can detect for this?