Browser History:Redirects

From MozillaWiki
Jump to navigation Jump to search

Rationale

The current history implementation does not handle redirects well. If you visit http://google.com, you will get redirected to http://www.google.com. The redirect page does not have a favicon or a title, and only clutters history views with unhelpful information.

This type of problem will be much more significant when planned enhancements are made with the places system. For example, if there is an easy-to-use bookmark button that shows the bookmark state of the current page, this button will be broken if a bookmark redirects. You will also not get proper favicons associated with the bookmark, and any notes or other annotations on the page will be ambiguous.

We will therefore need to pay special attention to redirects and provide some type of canonicalization to URLs to determine if they are bookmarked or what we should display in history views.

Note that this problem is not generally solvable. First, some types of redirects are not detectable as redirects, such as navigations done by JavaScript on the web page. Second, it is always possible to construct cases where it is not well-defined what the correct answer is. For example, different combinations of redirect destinations changing temporally, multiple pages redirecting to the same page, multiple levels of redirects, and annotations associated mean in some cases it is not well-defined what set of data should be shown for the page. As a result, the goal is to do something that catches reasonable cases of redirection, and doesn't give ansers that are clearly wrong.

Scenarios

Typed Permanent Redirect

This is probably the most common case. The user types a common URL, such as "http://google.com/" or "http://amazon.com/" and is 301 (moved permanently) redirected to "http://www.google.com/" or "http://www.amazon.com/exec/obidos/subst/home/home.html".

In these cases, there would be some advatage of showing the original URl with the title and other properties of the destination URL. Since the user has typed it, they have given some indication that this is what they're comfortable with. The redirected URLs ususally are more complicated.

Link Permanent Redirect

This is identical to the above case, but the redirected page was visited by clicking a link on another page. We may or may not want to handle these cases differently.

Bookmark Permanent Redirect

If you follow a bookmark and get a permanent redirect, should the bookmark be updated automatically? But, this might be annoying to some users. See bugs 103610, 8648, and 213467

Typed temporary redirect

Link temporary redirect

Bookmark temporary redirect

Approach