This issue is most easily reproducible with Wikipedia's mobile site.
- Change your user agent in Safari to Mobile Safari
- Navigate to Wikipedia.org, click through to an article
- Now try to navigate back - you will be unable to leave Wikipedia as back takes you to a page that performs a redirect.
It looks like Firefox adds a history entry for the page that has the redirect, but seems to skip it for back navigation.
This may be related to https://bugs.webkit.org/show_bug.cgi?id=30224
The title of the bug says “are added to the history” and “break back navigation”. It seems to me that it’s only the latter part that’s a bug. It is probably OK to have the redirect added to the global history, and as you say, Firefox does.
What about IE, by the way?
I'm not sure what IE does as I don't know how to set it's UA to a mobile browser to trigger the problem on Wikipedia. I've been struggling a bit to find a desktop site that has this odd behavior.
Wikipedia loads this script: http://bits.wikimedia.org/w/extensions/WikimediaMobile/MobileRedirect.js?2
which triggers the problematic redirect. I've been trying to write a reduced test case to avoid the need to load mobile wikipedia to repro the bug, but haven't been able to yet. That redirect script looks pretty simple, I'm not sure why it seems to be causing this odd behaviour. Maybe someone more experienced with the history navigation code may have some ideas.
http://trac.webkit.org/changeset/65340 from bug 42861 fixes this (verified in the most recent nightly build).