diff --git a/mobile/chrome/content/bindings/browser.xml b/mobile/chrome/content/bindings/browser.xml index 7442685fee81..1fb4ef1b394e 100644 --- a/mobile/chrome/content/bindings/browser.xml +++ b/mobile/chrome/content/bindings/browser.xml @@ -429,7 +429,9 @@ goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); }, gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); }, loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) { - this._currentURI = this._browser._ios.newURI(aURI, null, null); + try { + this._currentURI = this._browser._ios.newURI(aURI, null, null); + } catch(e) {} this._browser._contentTitle = ""; this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags}); }, diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index 2649b1bdd762..bb886be22354 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -446,12 +446,9 @@ var BrowserUI = { }, getDisplayURI: function(browser) { - if (!this._URIFixup) - this._URIFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); - let uri = browser.currentURI; try { - uri = this._URIFixup.createExposableURI(uri); + uri = gURIFixup.createExposableURI(uri); } catch (ex) {} return uri.spec; @@ -492,21 +489,22 @@ var BrowserUI = { this._edit.value = aURI; - let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP; - let uri = gURIFixup.createFixupURI(aURI, fixupFlags); - // 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(uri.spec); + let useLocal = Util.isLocalScheme(aURI); let hasLocal = Util.isLocalScheme(currentURI.spec); if (hasLocal != useLocal) { - Browser.addTab(uri.spec, true); + Browser.addTab(aURI, true); } else { let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP; - getBrowser().loadURIWithFlags(uri.spec, loadFlags, null, null); + 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); },