===Sketches===
<gallery>
Image:Linkdoctor places 404.png|A near match has been found (http://www.americas.com) along with the level above (http://news.bbc.co.uk), either via Places or Google
===Sketches===
<gallery>
Image:Dns error 1 suggestion.png|A suggestion is found, via Google or Places, and search is provided
[image:xxxxxxxxxxx Screenshot of a connectionFailure error page]
</gallery>
----------------------------
----------------------------
----------------------------
= Overview =
'''Sprint lead:''' curtis <br/>
'''Sprinters:''' johnath, boriss
'''Description:'''
<blockquote>More useful/helpful set of network error pages that offer tools helping users get to a useful end point via search, analysis of Places DB, or automatic redirects/reloads.</blockquote>
= Status =
== Strings and String Freeze ==
The strings only patch, bug [http://bugzilla.mozilla.org/show_bug.cgi?id=484313 484313], missed string freeze. It's been RESOLVED INVALID, and the patch has been moved to the main bug, [http://bugzilla.mozilla.org/show_bug.cgi?id=482874 482874], per beltzner's request. If the strings patch is to land for 3.5 it will have to go through the exception process. Since the strings are a prerequisite for the new network error pages functionality, it is all effectively gated on the strings exception process.
The downside is that the network error pages functionality proposed here might not make 3.5. The upside is that we have a little more time to work on the UI design. mconnor in particular thinks the existing UI design could benefit from more work.
== Implementation ==
Now have a Firefox patch that directly supports 404 error redirection natively (the 404 prototype extension is no longer needed). This patch also includes a C++ implementation of Levenshtein edit distance, accessible from Sqlite. The alternative URLs query now uses this function. Note that the DNS Not Found error is still using dummy data for alternative URLs although it's using the same new error page as 404 errors (with only slight differences in wording).
= Project steps =
* '''String Freeze for Beta 4''': Mar 19, 2009
* '''Code Freeze for Beta 4''': April 6, 2009
===Completed===
*Open initial bug for 404 handling<br><br>
*:[[Image:250px-Pictogram voting keep.svg.png|20px]] '''Completed:''' [https://bugzilla.mozilla.org/show_bug.cgi?id=482874 Bug 482874] and [https://bugzilla.mozilla.org/show_bug.cgi?id=484313 Bug 484313] (DTD changes).
*Create experimental 404 extension and send it out for comments<br><br>
*:[[Image:250px-Pictogram voting keep.svg.png|20px]] '''Completed,''' comments were:
** Works well for simulated small errors in URLs
** Hard to say how well it works for real errors in the wild.
** Drawing alternatives from the Places DB looks like a practical tool we can use for suggesting alternatives.
* Discuss possible 404 implementation with bzbarsky and others<br><br>
*:[[Image:250px-Pictogram voting keep.svg.png|20px]] '''Completed,''' comments were:
** 404 interception unified with the existing error handling architecture is too deep a change to make for 3.1.
** A less intrusive approach similar to the one the experimental 404 extension uses may be possible -- need to investigate further.
===In progress===
* Discuss with Google Link Doctor team<br><br>
*:[[Image:250px-Pictogram voting wait.svg.png|20px]] '''In progress,''' next: follow up on experimental access to the service.
* Implement Levenshtein Distance algorithm in C++<br><br>
*:[[Image:250px-Pictogram voting keep.svg.png|20px]] '''Completed'''
** Followup: Plug algorithm into Firefox+Sqlite, providing better performance and accuracy compared to the approach used in the extension.<br><br>
**:[[Image:250px-Pictogram voting wait.svg.png|20px]] '''In progress'''
* Proposed a plan for actual implementation<br><br>
*:[[Image:250px-Pictogram voting wait.svg.png|20px]] '''In progress''' (see below)
===To do===
* Follow up with contact on Link Doctor team about experimental access to the Link Doctor service.<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do'''
* Extend the 404 extension to intercept other error types so we can use it to prototype improved error page designs.<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do'''
* Figure out how to plumb 404 interception into Firefox proper (talk to Johnath).<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do'''
* Investigate implementing a proper edit-distance algorithm in C++ that can be used with Sqlite.<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do'''
* Come up with a plan for a production-quality Firefox 3.5 patch.<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do'''
* (Boriss) design a 404 & dnserror explanation website<br><br>
*:[[Image:250px-Pictogram voting delete.svg-1.png|20px]] '''To do''' (and decide if it is part of scope)
= Proposed Plan =
==3.5==
For 3.5, we're only adding a Google search box to the dnsnotfound page.
==Trunk/after 3.5==
'''We're targeting two error types:'''
# 404 errors.
# DnsNotFound errors.
'''Tools to draw on:'''
# Places alternatives: Places DB + Edit Distance -- can be called automatically.
#* Good for errors on URLs that the user has visited before
#* Might be especially useful for misspelled hostnames.
# Google Link Doctor
#* Assuming partner issues are worked out with Google.
#* Can't be called automatically for privacy reasons.
#* Available with one click (similar to pre-loaded Google search box)
# Other easy to implement tools
#* common transformations (www..example.com --> www.example.com, etc.)
#* pre-loaded search box
#* etc.
=404 redirection=
==Design scope==
* Will use 404-specific error page for 3.1 rather than trying to re-use the generic network error page. The goal is to give the user better indication of the problem and provide tools for next steps if needed.
* Will not redirect obvious custom server error pages. To this end, we'd like to use a heuristic beyond simple page size for identifying default 404 pages. Possibilities:
*# Compare to standard Apache and IIS 404 pages, possibly fuzzy (use edit istance?)
*# Use EndDocumentLoad (or other event) + redirect
*# Implement listener in C++, should be able to access 404 status directly from dcument.
*# <s>Deep docshell changes</s> (Not possible for 3.1}
* Will allow original error page to be available at one click
* Will unify with existing error page architecture in v.next.
==Open questions==
* Which tools will be provided?
* Should indication that the error is "404" be provided in the first screen?
* Is it possible to link to a page with more information about the problem?
* How many alternatives should be shown, and how closely should those match user input?
* What distinction should be drawn from the user's perspective between this and a DnsNotFound error?
* Problem: The 404 error page can't be a chrome page, since that could expose us to privilege escalation attacks piggy-backed on XSS attacks.<br><br>
*:[[Image:250px-Pictogram voting keep.svg.png|20px]] '''Solution:''' Use an about: URL to access the 404 error page.
==Resources==
===Sketches===
<gallery>
Image:Linkdoctor places 404.png|A near match has been found (http://www.americas.com) along with the level above (http://news.bbc.co.uk), either via Places or Google
</gallery>
===Notes===
==Most current design==
[[Image:404 error 2.png]]
* Offers the best suggestion prominently
* Links to the domain
* Searches the domain for the directory
* Offers a Google search box filled with the text entry
* Next step: links to a page with an explanation of the error and more details of what might have gone wrong
=DnsNotFound=
==Design scope==
* Will use the DnsNotFound error page to give the user better indication of the problem and provide tools for next steps if needed
* Will provide the user tools via one-click access to Google Link Doctor
* Will provide the user with better link options with data drawn from Places
==Open questions==
* Which tools will be provided?
* Should indication that the error is "DnsNotFound" be provided in the first screen?
* Is it possible to link to a page with more information about the problem?
* How many alternatives should be shown, and how closely should those match user input?
* What distinction should be drawn from the user's perspective between this and a 404 error?
==Resources==
===Sketches===
<gallery>
Image:Dns error 1 suggestion.png|A suggestion is found, via Google or Places, and search is provided
Image:Dns error 2 suggestions.png|Two suggestions might be given if two are clear strong matches
</gallery>
===Notes===
==Most current design==
[[Image:Dns error 2.png]]
* Unfortunately, there don't seem to be many useful tools we can provide here, beyond a suggestion and a search.
* It's been noted that having only one suggestion on this page as a bulleted item is visually jarring. Earlier mockups had this - my logic was that using this standard format means there's consistency between this and the 404 page above it, which could be brought to the other warnings. Also, this simple bullet list of "tools" can be easily expanded as new link tools may be added. However, I moved it back in this version and lined up the search box. Basically I thought that with only four elements it was too much to vary the indentation and spacing of them all. So if there were more than one "suggestion" it would go back to the 404 format above, but here there's only one (searching Google), so all is left aligned.
* Next step: links to a page with an explanation of the error and more details of what might have gone wrong
[[Image:New spacing dns.png]]
This is a design taking into account some recent decisions based on what could be done for the code freeze vs trunk:
* The middle block of text can't be altered except as a whole piece, and since there's not enough time to make a separate website explaining DNS error, removing it could leave a newer lost - it's kept in this mockup
* Google search can be added - it's given as a prominent option and the most visually distinctive of the options
* Try again is still present. I experimented making it a button much like it is now and like "Search" is after Google search, but that didn't really work into the style of a bullet list well
<hr>
<hr>
<hr>
=References=
*Bugs:
**[http://bugzilla.mozilla.org/show_bug.cgi?id=479922 Bug 479922] - Network error pages should give me tools instead of asking me questions
*Mozilla-Central:
**[[http://mxr.mozilla.org/mozilla-central/source/docshell/base/nsDocShell.cpp#3031 nsDocShell::DisplayLoadError] -- dispatches various error pages
**[http://mxr.mozilla.org/mozilla-central/source/docshell/resources/content/netError.xhtml netError.xhtml]
**[http://mxr.mozilla.org/mozilla-central/source/browser/components/certerror/aboutCertError.js aboutCertError.js]
*About pages:
**''about:neterror''
**''about:config'' -- urlclassifier.alternate_error_page default string = "blocked" -- for example -- tells nsDocShell::DisplayLoadError to use the "blocked" page instead of the default generic page.
*Triggers:
**[https://johnath.com/ https://johnath.com/] - triggers a "Secure Connection Failed" error page.
**[http://example.example.com/ http://example.example.com/] - triggers an "Address Not Found" error page.
**[http://example.cmm triggers dnsNotFound error page]
**[http://127.0.0.1:81 triggers connectionFailure error page]
* [[Firefox3.1/Sprints/Network Error Pages/Error types|List of possible error to address]] (old)
* [https://wiki.mozilla.org/Firefox:1.5_Network_Error_Messages Summary of error types (FF 1.5)]
* Johnathan Zittrain - [http://www.herdict.org/web/ HerdictWeb] talk in building K - had ideas about integrating it into Firefox's error pages. Instead of Firefox just telling you the site is unreachable, maybe it could tell you whether it has been gone for minutes or months, and whether it is broken for everyone or only for certain ISPs or countries.
* [http://jboriss.wordpress.com/2009/03/10/improving-everyones-favorite-feature-404/ Boriss' 1st blog post]
* Images:
<gallery>
Image:GoogleChrome404ScreenShot.png|Google Chrome's Friendly 404 Error Page
[image:xxxxxxxxxxx Screenshot of a connectionFailure error page]
</gallery>
= Notes =
Can we use Places autocomplete for link correction? A mis-typed link will often be in error in only the last couple of characters -- we can truncate the last 2 or 3 characters and rely on Places auto-complete to give us recommendations...
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/autocomplete/
A related alternative would be to construct an edit-distance function and register it with SqlLite. We can then do a query on minimal edit distance (async of course) to get the best link correction matches.
Problem is, how do we hook link correction into the error page? We'd like to provide suggestions inside the web page similar to Google's "did you mean" on the search results page.
''Google Chrome LinkDoctor Service (linkhelp.clients.google.com)''
wget -U "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13" "http://linkhelp.clients.google.com/tbproxy/lh/fixurl?sourceid=navclient%20&hl=en&sd=com&error=http404&url=http://news.speeple.com/sunflowers"
wget -U "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13" "http://www.google.com"