Bug 1657237 - Address Bar flashes punycode when loading page.r=mak

Differential Revision: https://phabricator.services.mozilla.com/D192696
This commit is contained in:
Marc Seibert
2023-11-10 09:51:36 +00:00
parent 11c0cde120
commit e621f5f210
3 changed files with 63 additions and 1 deletions

View File

@@ -2762,12 +2762,18 @@ export class UrlbarInput {
) {
// No point in setting these because we'll handleRevert() a few rows below.
if (openUILinkWhere == "current") {
// Make sure URL is formatted properly (don't show punycode).
let formattedURL = url;
try {
formattedURL = new URL(formattedURL).URI.displaySpec;
} catch {}
this.value =
lazy.UrlbarPrefs.get("showSearchTermsFeatureGate") &&
lazy.UrlbarPrefs.get("showSearchTerms.enabled") &&
resultDetails?.searchTerm
? resultDetails.searchTerm
: url;
: formattedURL;
browser.userTypedValue = this.value;
}