From dee9095f9f4412c683d50fec6fc13a65bab8b550 Mon Sep 17 00:00:00 2001 From: "matt%netscape.com" Date: Thu, 3 May 2001 01:42:22 +0000 Subject: [PATCH] adding for url parsing bug 73974 and bug 77261 r=mcafee and sr=brendan --- xpfe/browser/resources/content/navigator.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 4c7c2b88ef0..c783d962219 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -538,7 +538,9 @@ function OpenBookmarkURL(node, datasources) function OpenSearch(tabName, forceDialogFlag, searchStr) { + //This function needs to be split up someday. + var autoOpenSearchPanel = false; var defaultSearchURL = null; var fallbackDefaultSearchURL = gNavigatorRegionBundle.getString("fallbackDefaultSearchURL"); @@ -547,10 +549,11 @@ function OpenSearch(tabName, forceDialogFlag, searchStr) // var url = getWebNavigation().currentURI.spec; var url = _content.location.href; - //Check to see if search string contains "://" or ".". + //Check to see if search string contains "://" or "ftp." or white space. //If it does treat as url and match for pattern - var urlmatch= /:\/\/|\./ ; - var result = urlmatch.test(searchStr); + + var urlmatch= /(:\/\/|^ftp\.)[^ \S]+$/ + var forceAsURL = urlmatch.test(searchStr); try { autoOpenSearchPanel = pref.GetBoolPref("browser.search.opensidebarsearchpanel"); @@ -576,7 +579,7 @@ function OpenSearch(tabName, forceDialogFlag, searchStr) //Check to see if location bar field is a url //If it is a url go to URL. A Url is "://" or "." as commented above //Otherwise search on entry - if (result) { + if (forceAsURL) { BrowserLoadURL() } else { var searchMode = 0;