Bug 1254503 - ignore exceptions from trying to fix up obviously broken URIs, r?mak
MozReview-Commit-ID: 7fdJZmtc1zK
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -746,19 +746,19 @@ function trimURL(aURL) {
// remove http://
if (!url.startsWith("http://")) {
return url;
}
let urlWithoutProtocol = url.substring(7);
let flags = Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
- let fixedUpURL = Services.uriFixup.createFixupURI(urlWithoutProtocol, flags);
- let expectedURLSpec;
+ let fixedUpURL, expectedURLSpec;
try {
+ fixedUpURL = Services.uriFixup.createFixupURI(urlWithoutProtocol, flags);
expectedURLSpec = makeURI(aURL).spec;
} catch (ex) {
return url;
}
if (fixedUpURL.spec == expectedURLSpec) {
return urlWithoutProtocol;
}
return url;