diff --git a/browser/components/urlbar/UrlbarValueFormatter.jsm b/browser/components/urlbar/UrlbarValueFormatter.jsm index 3ee40052fe75..3211b3e14222 100644 --- a/browser/components/urlbar/UrlbarValueFormatter.jsm +++ b/browser/components/urlbar/UrlbarValueFormatter.jsm @@ -47,6 +47,10 @@ class UrlbarValueFormatter { } update() { + // Cleanup that must be done in any case, even if there's no value. + this.urlbarInput.removeAttribute("domaindir"); + this.scheme.value = ""; + if (!this.inputField.value) { return; } @@ -196,7 +200,6 @@ class UrlbarValueFormatter { } _removeURLFormat() { - this.scheme.value = ""; if (!this._formattingApplied) { return; } @@ -222,7 +225,6 @@ class UrlbarValueFormatter { _formatURL() { let urlMetaData = this._getUrlMetaData(); if (!urlMetaData) { - this.urlbarInput.removeAttribute("domaindir"); return false; }