aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion.coffee
diff options
context:
space:
mode:
authorStephen Blott2014-11-08 07:40:49 +0000
committerStephen Blott2014-11-08 07:40:49 +0000
commit3d647c9d062a84082d0337ac0b0004d31eb64969 (patch)
tree9ff193d27f26d931b06018e36662cde2faef2a91 /background_scripts/completion.coffee
parent8e4e95c87d2ea06fcc0d9d354a180dfa1f31cdd2 (diff)
parent56565a021ae421d648a3b4180fdd255270245421 (diff)
downloadvimium-3d647c9d062a84082d0337ac0b0004d31eb64969.tar.bz2
Merge branch 'smblott-github-domains-only-domains'
Diffstat (limited to 'background_scripts/completion.coffee')
-rw-r--r--background_scripts/completion.coffee8
1 files changed, 5 insertions, 3 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index 23696185..b75ebb87 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -238,7 +238,7 @@ class DomainCompleter
onComplete()
onPageVisited: (newPage) ->
- domain = @parseDomain(newPage.url)
+ domain = @parseDomainAndScheme newPage.url
if domain
slot = @domains[domain] ||= { entry: newPage, referenceCount: 0 }
# We want each entry in our domains hash to point to the most recent History entry for that domain.
@@ -250,11 +250,13 @@ class DomainCompleter
@domains = {}
else
toRemove.urls.forEach (url) =>
- domain = @parseDomain(url)
+ domain = @parseDomainAndScheme url
if domain and @domains[domain] and ( @domains[domain].referenceCount -= 1 ) == 0
delete @domains[domain]
- parseDomain: (url) -> url.split("/")[2] || ""
+ # Return something like "http://www.example.com" or false.
+ parseDomainAndScheme: (url) ->
+ Utils.hasFullUrlPrefix(url) and not Utils.hasChromePrefix(url) and url.split("/",3).join "/"
# Suggestions from the Domain completer have the maximum relevancy. They should be shown first in the list.
computeRelevancy: -> 1