From 1257fc7a4fe7b9d0bfe1ad7ab7255f8dba4b988d Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 2 May 2015 11:34:18 +0100 Subject: Search completion; do not complete URLs. --- background_scripts/search_engines.coffee | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'background_scripts') diff --git a/background_scripts/search_engines.coffee b/background_scripts/search_engines.coffee index 485accc1..5d69d087 100644 --- a/background_scripts/search_engines.coffee +++ b/background_scripts/search_engines.coffee @@ -89,6 +89,12 @@ SearchEngines = complete: (searchUrl, queryTerms, callback) -> return callback [] unless 0 < queryTerms.length + # Don't try to complete general URLs. + return callback [] if 1 == queryTerms.length and Utils.isUrl queryTerms[0] + + # Don't try to complete Javascrip URLs. + return callback [] if 0 < queryTerms.length and Utils.hasJavascriptPrefix queryTerms[0] + engine = @lookupEngine searchUrl url = engine.getUrl queryTerms @get searchUrl, url, (xhr = null) -> -- cgit v1.2.3