Chrome and 404's

| 3 Comments

So yesterday I bitched about the fact that Chrome, replaced 404 pages with a input box that would let user perform google searches. I did not like the idea , that 404 where replaced by a search box.
Today I downloaded the source of Chrome and had a look inside and found this interesting comment :

// When the frame request first 404's, chrome may replace it with the alternate
// 404 page's contents. It does this using substitute data in the document
// loader, so the original response and url of the request can be preserved.
// We need to avoid replacing the current page, if it has already been
// replaced (otherwise could loop on setting alt-404 page!)
bool is_substitute_data = loader->substituteData().isValid();

// If it's a 404 page, we wait until we get 512 bytes of data before trying
// to load the document. This allows us to put up an alternate 404 page if
// there's short text.

in http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/webframeloaderclient_impl.cc?view=markup&pathrev=1359 around line 252.

This simply means that if you want to keep your 404 pages they need to be 513 byte in length. If they are 513 Chrome considers that the page contains interesting bits of information for the user and does not replace it with a google crafted page.

3 Comments

IE does exactly the same. Maybe google was inspired. They're trying to be smarter then the user.

Thanks a lot for this quick blog post.

I was really puzzled by the fact that my error page showed up in firefox.. but not in chrome !

That's pretty awesome that you took the time to look into your one small complaint. How tiny is a 512byte 404 message? is it like the whole http response or like the error code? this is the tinyest one I've seen in a while. rapidshare.com/nothing

Recent Entries

Mozilla Camp Eu 2011
Last week-end I had the pleasure to attend MozCamp Europe 2011 in Berlin, Germany. As always those events are for…
Test event centered around Thunderbird 10 and Lightning 1.0
It's been a while since we had a testing event. Some of it was probably my fault as I needed…
Free met à jour son infrastructure de mail et offre plus de sécurité
ça y est c'est officiel et c'est testé ! Le fournisseur d'accès à Internet Free, vient de déployer une infrastructure…