Bug 1407188 - Don't fail to send locationChange if the next URI has no host. r?walkingice
MozReview-Commit-ID: 6rRQ6K3wPwT
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4483,20 +4483,26 @@ Tab.prototype = {
// clear any URL origin that might have been pinned to this tab.
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
let appOrigin = ss.getTabValue(this, "appOrigin");
if (appOrigin) {
let originHost = "";
try {
originHost = Services.io.newURI(appOrigin).host;
} catch (e if (e.result == Cr.NS_ERROR_FAILURE)) {
- // NS_ERROR_FAILURE can be thrown by nsIURI.host if the URI scheme does not possess a host - in this case
- // we just act as if we have an empty host.
- }
- if (originHost != aLocationURI.host) {
+ // NS_ERROR_FAILURE can be thrown by nsIURI.host if the URI scheme does not possess a host -
+ // in this case we just act as if we have an empty host.
+ }
+ let locationHost = "";
+ try {
+ locationHost = aLocationURI.host;
+ } catch (e if (e.result == Cr.NS_ERROR_FAILURE)) {
+ // Ditto.
+ }
+ if (originHost != locationHost || originHost == "") {
// Note: going 'back' will not make this tab pinned again
ss.deleteTabValue(this, "appOrigin");
}
}
// Update the page actions URI for helper apps.
if (BrowserApp.selectedTab == this) {
ExternalApps.updatePageActionUri(fixedURI);