diff options
| author | Stephen Blott | 2014-11-06 08:50:59 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2014-11-06 08:50:59 +0000 | 
| commit | 46ee1444e08815cd3ec4d1f008d62d13b35ad777 (patch) | |
| tree | 0a2cb24a0a036925eea3c4e52eb891cc60a451bf /background_scripts | |
| parent | c08d03e36e3c6a08fe9eaa493fb2a3262f77b74b (diff) | |
| download | vimium-46ee1444e08815cd3ec4d1f008d62d13b35ad777.tar.bz2 | |
Include scheme for domain suggestions; tighter test for valid domain.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion.coffee | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 0a936459..b75ebb87 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -238,8 +238,8 @@ class DomainCompleter        onComplete()    onPageVisited: (newPage) -> -    domain = @parseDomain(newPage.url) -    if domain and not Utils.hasChromePrefix 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.        slot.entry = newPage if slot.entry.lastVisitTime < newPage.lastVisitTime @@ -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 | 
