As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 707567 - prepend http:// to URL copy selection only if (at least) full hostname is selected
: prepend http:// to URL copy selection only if (at least) full hostname is sel...
Product: Firefox
Classification: Client Software
Component: Location Bar (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Firefox 12
Assigned To: Dão Gottwald [:dao]
: Marco Bonardo [::mak]
Depends on:
  Show dependency treegraph
Reported: 2011-12-04 14:15 PST by Waldir
Modified: 2012-01-09 16:58 PST (History)
4 users (show)
dao+bmo: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (2.68 KB, patch)
2011-12-18 16:43 PST, Dão Gottwald [:dao]
no flags Details | Diff | Splinter Review
patch (2.69 KB, patch)
2011-12-18 16:49 PST, Dão Gottwald [:dao]
dietrich: review+
Details | Diff | Splinter Review

Description User image Waldir 2011-12-04 14:15:16 PST
This issue was raised in comments to other bugs:
- bug 666964, comment 13
- bug 689342, comment 8
But neither bug tackled this issue directly, so those comments kinda drowned in the discussion surrounding the somewhat controversial hiding of the http:// from the location bar.

Thus I'm opening a bug specifically for this effect, since bug 666964, which got implemented, mentions adding the http:// "if the first character is included in the selection", and it seems straightforward to extend this to a slightly more rigid condition (and a more logical one): to add the http:// only if at least the full hostname is selected.
Comment 1 User image Dão Gottwald [:dao] 2011-12-18 16:43:04 PST
Created attachment 582718 [details] [diff] [review]
Comment 2 User image Dão Gottwald [:dao] 2011-12-18 16:49:01 PST
Created attachment 582720 [details] [diff] [review]

hopefully with proper English this time
Comment 3 User image Dietrich Ayala (:dietrich) 2012-01-08 22:06:58 PST
Comment on attachment 582720 [details] [diff] [review]

Review of attachment 582720 [details] [diff] [review]:

::: browser/base/content/test/browser_urlbarCopying.js
@@ +65,1 @@
>    },

worth adding a test for "<example>.com/foo"? or is that case covered elsewhere?

::: browser/base/content/urlbarBindings.xml
@@ +519,5 @@
> +          if (selectedVal.indexOf("/") == -1) {
> +            let remainder = inputVal.replace(selectedVal, "");
> +            if (remainder != "" && remainder[0] != "/")
> +              return selectedVal;
> +          }

please add a comment summarizing the criteria for determining whether the full domain has been selected or not.
Comment 5 User image Ed Morley [:emorley] 2012-01-09 15:09:15 PST
Comment 6 User image Waldir 2012-01-09 16:58:45 PST
Thanks guys, you are awesome :D

Note You need to log in before you can comment on or make changes to this bug.