Bug 854305 - Force search for all single word queries. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 17 Jul 2014 19:40:17 -0700
changeset 216816 5c43367a720f0de2280fdcdbae9dcf4f27c1743b
parent 216815 3b9f8506d2cf5a6fc30a61e8bc4d546aedd237a5
child 216817 9d1b8acf821dd921dab7a81076cfa6964fcc7581
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs854305
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 854305 - Force search for all single word queries. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1519,18 +1519,18 @@ var BrowserApp = {
         break;
       }
 
       case "Tab:Load": {
         let data = JSON.parse(aData);
         let url = data.url;
         let flags;
 
-        if (!data.engine && /^[0-9]+$/.test(url)) {
-          // If the query is a number and we're not using a search engine,
+        if (!data.engine && /^\w+$/.test(url.trim())) {
+          // If the query is a single word and we're not using a search engine,
           // force a search (see bug 993705; workaround for bug 693808).
           url = URIFixup.keywordToURI(url).spec;
         } else {
           flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
                    Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
         }
 
         // Pass LOAD_FLAGS_DISALLOW_INHERIT_OWNER to prevent any loads from