Closed Bug 581331 Opened 10 years ago Closed 10 years ago

BrowserUI.goToURI should always apply third-party fixup to URI

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mfinkle, Assigned: mfinkle)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Bug 575581 made sure we were applying LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP correctly to incoming URIs, so keyword searching worked better. However, if the incoming URI required a new tab to be created, we skipped the LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP code path.

The result is "Server not found" errors if you type "cnn.com" from the startup page.

This patch works like the BrowserUI.doButtonSearch code, and will always apply the third-party fixup to the incoming URI.
Attachment #459790 - Flags: review?(21)
Comment on attachment 459790 [details] [diff] [review]
patch

>diff --git a/chrome/content/browser-ui.js b/chrome/content/browser-ui.js
>--- a/chrome/content/browser-ui.js
>+++ b/chrome/content/browser-ui.js
>@@ -490,22 +490,23 @@ var BrowserUI = {
>     this._edit.value = aURI;
> 
>     // We need to keep about: pages opening in new "local" tabs. We also want to spawn
>     // new "remote" tabs if opening web pages from a "local" about: page.
>     let currentURI = getBrowser().currentURI;
>     let useLocal = Util.isLocalScheme(aURI);
>     let hasLocal = Util.isLocalScheme(currentURI.spec);
>     if (hasLocal != useLocal) {
>-      Browser.addTab(aURI, true);
>-    } else {
>-      let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
>-      getBrowser().loadURIWithFlags(aURI, loadFlags, null, null);
>+      let tab = Browser.addTab("about:blank", true);
>+      tab.browser.stop();
>     }
> 
>+    let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
>+    getBrowser().loadURIWithFlags(aURI, loadFlags, null, null);
>+
>     // Delay doing the fixup so the raw URI is passed to loadURIWithFlags
>     // and the proper third-party fixup can be done
>     let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
>     let uri = gURIFixup.createFixupURI(aURI, fixupFlags);
>     gHistSvc.markPageAsTyped(uri);
>   },
> 
>   showAutoComplete: function showAutoComplete() {
Attachment #459790 - Flags: review?(21) → review+
pushed:
http://hg.mozilla.org/mobile-browser/rev/d28d52c4b8cf
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Duplicate of this bug: 581451
verified FIXED on build:

Mozilla/5.0 (Android; U; Linux armv71; en-US; rv:2.0b2pre) Gecko/20100726 Namoroka/4.0b2pre Fennec/2.0a1pre
Status: RESOLVED → VERIFIED
bugspam
Assignee: nobody → mark.finkle
You need to log in before you can comment on or make changes to this bug.