Firefox/URL Bar Algorithm: Difference between revisions

Line 40: Line 40:
## Get the prefix to use from the <code>browser.fixup.alternate.prefix</code> preference; default is "www.".  Some locales set this preference.
## Get the prefix to use from the <code>browser.fixup.alternate.prefix</code> preference; default is "www.".  Some locales set this preference.
## Get the suffix to use from the <code>browser.fixup.alternate.suffix</code> preference; default is ".com".  Some locales set this preference.
## Get the suffix to use from the <code>browser.fixup.alternate.suffix</code> preference; default is ".com".  Some locales set this preference.
## If the hostname includes no '.' characters, prepend the prefix and append the suffix.  Else if it has a single '.' and the part ending on the '.' is equal to our prefix, append the suffix.  Else if it has a single '.' and tour suffix is nonempty prepend the prefix.  For the default pref values, this means the <tt>foo</tt> will become <tt>www.foo.com</tt>, as will <tt>foo.com</tt> and <tt>www.foo</tt>.  <tt>foo.org</tt> will become <tt>www.foo.org</tt>.  <tt>web.foo</tt> and <tt>x.y.foo</tt> won't be changed.
## If the hostname includes no '.' characters, prepend the prefix and append the suffix.  Else if it has a single '.' and the part ending on the '.' is equal to our prefix, append the suffix.  Else if it has a single '.' and tour suffix is nonempty prepend the prefix.  For the default pref values, this means the <tt>"foo"</tt> will become <tt>"www.foo.com"</tt>, as will <tt>"foo.com"</tt> and <tt>"www.foo"</tt>.  Similarly, <tt>"foo.org"</tt> will become <tt>"www.foo.org"</tt>.  On the other hand, <tt>"web.foo"</tt> and <tt>"x.y.foo"</tt> won't be changed.
# If either of the two steps above produced a URI different from the URI whose load failed, load that new URI.
# If either of the two steps above produced a URI different from the URI whose load failed, load that new URI.
308

edits