diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 6ee333af7cd..363b3bb45c7 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -806,6 +806,10 @@ function gKeywordURIFixup(fixupInfo, topic, data) { asciiHost = asciiHost.slice(0, -1); } + // Ignore number-only things entirely (no decimal IPs for you!) + if (/^\d+$/.test(asciiHost)) + return; + let onLookupComplete = (request, record, status) => { let browser = weakBrowser.get(); if (!Components.isSuccessCode(status) || !browser) diff --git a/browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js b/browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js index 2e636c52cdd..73414274085 100644 --- a/browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js +++ b/browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js @@ -62,6 +62,12 @@ add_task(function* test_navigate_full_domain() { gBrowser.removeTab(tab); }); +add_task(function* test_navigate_numbers() { + let tab = gBrowser.selectedTab = gBrowser.addTab(); + yield* runURLBarSearchTest("1234", true, false); + gBrowser.removeTab(tab); +}); + function get_test_function_for_localhost_with_hostname(hostName, isPrivate) { return function* test_navigate_single_host() { const pref = "browser.fixup.domainwhitelist.localhost";