Last Comment Bug 673528 - using Shift to bypass "switch to tab" doesn't work anymore (loads www.domain.com.net)
: using Shift to bypass "switch to tab" doesn't work anymore (loads www.domain....
Status: VERIFIED FIXED
[switch-to-tab]
:
Product: Firefox
Classification: Client Software
Component: Location Bar (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 9
Assigned To: Dão Gottwald [:dao]
:
: Marco Bonardo [::mak]
Mentors:
Depends on: 688395
Blocks: 665580
  Show dependency treegraph
 
Reported: 2011-07-22 13:12 PDT by :Gavin Sharp [email: gavin@gavinsharp.com]
Modified: 2013-05-14 05:54 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed


Attachments
patch (5.41 KB, patch)
2011-07-29 08:53 PDT, Dão Gottwald [:dao]
gavin.sharp: review+
faaborg: ui‑review+
bugzilla: approval‑mozilla‑aurora+
bugzilla: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description :Gavin Sharp [email: gavin@gavinsharp.com] 2011-07-22 13:12:12 PDT
Bug 665580 means that the URL we try to load no longer matches the "URL-like" test in _canonizeURL, so it gets a .net added to it.

STR:
1) Load http://gavinsharp.com/geo.html
2) open new tab, type "gavinsharp.com", notice "switch to tab" entry
3) Press shift to override "switch to tab" (bug 596485), press enter

Expected: http://gavinsharp.com/geo.html loads again.
Actual: www.gavinsharp.com.net/geo.html loads
Comment 1 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-07-28 14:02:40 PDT
This regex is confusing (as most regexes are). I have no idea why it's trying to match what it is.
 
/^\s*(www|https?)\b|\/\s*$/
Comment 2 Dão Gottwald [:dao] 2011-07-28 15:41:06 PDT
Looks like it just tests if the value starts with www. or http: or https:. (I'm not sure about the purpose of |\/.) *Why* it defines URL-likeliness like this is an interesting question, though.
Comment 3 Dão Gottwald [:dao] 2011-07-29 08:53:21 PDT
Created attachment 549388 [details] [diff] [review]
patch

Changed the heuristics to reject foo.bar, which I suspect has a high failure rate. www.foo.bar.net *could* be wanted, but these domains seem rare to start with. I happen to trigger this quite often accidentally.
Comment 4 Dão Gottwald [:dao] 2011-07-29 08:57:32 PDT
This also changes behavior for other stuff that's not switch-to-tab related, like "foo bar", which always tries to load a broken URL right now.
Comment 5 Dão Gottwald [:dao] 2011-07-29 09:08:36 PDT
Comment on attachment 549388 [details] [diff] [review]
patch

unchanged behavior:

>+  ["example", "http://www.example.net/"],
>+  ["ex-ample", "http://www.ex-ample.net/"],
>+  ["  example ", "http://www.example.net/"],
>+  [" example/foo ", "http://www.example.net/foo"],
>+  [" example/foo bar ", "http://www.example.net/foo%20bar"],
>+  ["http://example", "http://example/"],

changed behavior:

>+  ["example.net", "http://example.net/"],
>+  ["example:8080", "http://example:8080/"],
>+  ["ex-ample.foo", "http://ex-ample.foo/"],
>+  ["example.foo/bar ", "http://example.foo/bar"],
>+  ["1.1.1.1", "http://1.1.1.1/"],
>+  ["ftp://example", "ftp://example/"],
>+  ["ftp.example.bar", "ftp://ftp.example.bar/"],
>+  ["ex ample", Services.search.originalDefaultEngine.getSubmission("ex ample").uri.spec],
Comment 6 Dão Gottwald [:dao] 2011-07-30 00:16:59 PDT
(In reply to comment #3)
> I happen to trigger this quite often accidentally.

I've been thinking about how exactly this happens to me. I think it's when I paste something (Ctrl+V) and hit enter immediately.
Comment 7 Dão Gottwald [:dao] 2011-08-05 13:36:42 PDT
(In reply to Dão Gottwald [:dao] from comment #6)
> (In reply to comment #3)
> > I happen to trigger this quite often accidentally.
> 
> I've been thinking about how exactly this happens to me. I think it's when I
> paste something (Ctrl+V) and hit enter immediately.

And I just managed to hit Shift+Enter when I just wanted Enter...
Comment 8 Marco Bonardo [::mak] 2011-08-19 03:01:08 PDT
(In reply to Dão Gottwald [:dao] from comment #6)
> I've been thinking about how exactly this happens to me. I think it's when I
> paste something (Ctrl+V) and hit enter immediately.

To me happens regularly after a paste, looks like it takes a bit more for my finger to leave CTRL before I press ENTER, and I end up with CTRL+ENTER that forces a fixup :(
Comment 9 Dão Gottwald [:dao] 2011-08-20 11:15:52 PDT
http://hg.mozilla.org/mozilla-central/rev/6dc468c41136
Comment 10 christian 2011-08-22 14:53:41 PDT
Dao, can we get a risk assessment on this? Is it fairly self contained?
Comment 11 Dão Gottwald [:dao] 2011-08-22 23:25:46 PDT
(In reply to Christian Legnitto [:LegNeato] from comment #10)
> Dao, can we get a risk assessment on this? Is it fairly self contained?

It's self contained -- this code only runs when hitting Accel/Shift+Enter in the location bar. It's also mostly code removal. The one line that's really new (the regular expression) is covered by a test.
Comment 12 Johnathan Nightingale [:johnath] 2011-08-23 14:36:51 PDT
Comment on attachment 549388 [details] [diff] [review]
patch

Land it on both aurora and beta soon, please!
Comment 14 Trif Andrei-Alin[:AlinT] 2011-08-26 04:46:09 PDT
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Windows NT 6.1; rv:9.0a1) Gecko/20110823 Firefox/9.0a1

After following the steps in the description, i can tell that both beta and Nigthly Firefox works as expected(after pressing shift,FF switches to tab without loading the page).
Setting resolution to Verified Fixed.
Thanks.

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