[Bug 878375] [NEW] Enabling protocol-less URLs messes up named hosts resolution

Unas 878375 at bugs.launchpad.net
Wed Oct 19 17:50:20 UTC 2011


Public bug reported:

Problem appeared with Firefox 7.0, which added the protocol-less URL feature. As far as I can see, it's still present on Fx8 betas as well.
Basically, handling of URLs using named hosts (for example, "localhost") instead of IP or DNS is unreliable, because Firefox strips the protocol from the URL and then confuses the resulting URL with normal text to search for.

I've noticed two manifestations of it so far.

1) First case when this happens : using a bookmark set to a page on
localhost.

Steps to reproduce :
- Make sure you have the browser.urlbar.trimURLs config variable to true (default value)
- Have a localhost web server on your machine.
- Visit a page on this localhost and bookmark it.
- Try to load the page from the bookmark.

Instead of loading the page, Firefox loads a Google search for the stripped URL.
e.g., if you bookmark the page at http://localhost/myProject/index.php, accessing the bookmark in Firefox will redirect to the Google search for "localhost/myProject/index.php".

2) Second case : using a relative path in JS core functions.
For example, visiting a page that uses a Worker, itself calling the importScript function with a relative path.
It works fine when using either an IP or a real domain name in the URL, but not when using "localhost": in that case the page will fail and throw an exception "Couldn't find domain".

For the moment, setting browser.urlbar.trimURLs to false in Firefox 7
fixes those problems, but still : the default mode of a web browser
should not mess with the URL resolution process... :-/

** Affects: firefox (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Problem appeared with Firefox 7.0, which added the protocol-less URL feature. As far as I can see, it's still present on Fx8 betas as well.
  Basically, handling of URLs using named hosts (for example, "localhost") instead of IP or DNS is unreliable, because Firefox strips the protocol from the URL and then confuses the resulting URL with normal text to search for.
  
  I've noticed two manifestations of it so far.
  
  1) First case when this happens : using a bookmark set to a page on
  localhost.
  
  Steps to reproduce :
  - Make sure you have the browser.urlbar.trimURLs config variable to true (default value)
  - Have a localhost web server on your machine.
  - Visit a page on this localhost and bookmark it.
  - Try to load the page from the bookmark.
  
- Instead of loading the page, Firefox loads a Google search for the stripped URL. 
- e.g., if you bookmark the page at localhost/myProject/index.php, accessing the bookmark in Firefox will redirect to the Google search for "localhost/myProject/index.php".
+ Instead of loading the page, Firefox loads a Google search for the stripped URL.
+ e.g., if you bookmark the page at http://localhost/myProject/index.php, accessing the bookmark in Firefox will redirect to the Google search for "localhost/myProject/index.php".
  
  2) Second case : using a relative path in JS core functions.
  For example, visiting a page that uses a Worker, itself calling the importScript function with a relative path.
  It works fine when using either an IP or a real domain name in the URL, but not when using "localhost": in that case the page will fail and throw an exception "Couldn't find domain".
  
- 
  For the moment, setting browser.urlbar.trimURLs to false in Firefox 7
  fixes those problems, but still : the default mode of a web browser
  should not mess with the URL resolution process... :-/

-- 
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/878375

Title:
  Enabling protocol-less URLs messes up named hosts resolution

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/878375/+subscriptions




More information about the Ubuntu-mozillateam-bugs mailing list