Bug 41670 - Pages that perform a redirect can break back navigation
Summary: Pages that perform a redirect can break back navigation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-06 02:33 PDT by Ben Murdoch
Modified: 2010-08-18 08:32 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Murdoch 2010-07-06 02:33:50 PDT
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
Comment 1 Darin Adler 2010-07-06 08:16:58 PDT
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?
Comment 2 Ben Murdoch 2010-07-06 12:00:17 PDT
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.

Cheers, Ben
Comment 3 Mihai Parparita 2010-08-18 08:32:03 PDT
http://trac.webkit.org/changeset/65340 from bug 42861 fixes this (verified in the most recent nightly build).