diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js --- a/toolkit/components/places/UnifiedComplete.js +++ b/toolkit/components/places/UnifiedComplete.js @@ -506,11 +506,13 @@ */ function looksLikeUrl(str, ignoreAlphanumericHosts = false) { // Single word including special chars. return !REGEXP_SPACES.test(str) && (["/", "@", ":", "["].some(c => str.includes(c)) || - (ignoreAlphanumericHosts ? /(.*\..*){3,}/.test(str) : str.includes("."))); + (ignoreAlphanumericHosts ? + /^([\[\]A-Z0-9.:-]+[\.:]){3,}[\[\]A-Z0-9.:-]+$/i.test(str) : + str.includes("."))); } /** * Returns whether the passed in string looks like an origin. */