aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion.coffee
AgeCommit message (Collapse)Author
2017-04-20Firefox: some history entries have no title.Stephen Blott
This causes `o`/`O` to crash (producing no suggestions). As a workaround, set any such title to "".
2016-05-06Fix binary-search OOB.Stephen Blott
This affects binary search in the history cache. The returned index can be one beyond the end of array, and so we get an error when we look it up blindly. So, we need to check.
2016-04-17There's no need for a new suggestion property...Stephen Blott
We do not need "displayUrl", we can re-use "shortUrl" instead. It does what we need already.
2016-04-17Do not deduplicate javascript: URLs.Stephen Blott
2016-04-17For javascript URLs, do not match javascript content.Stephen Blott
We only match the text "javascript:...". The affects only the bookmark completer.
2016-04-09Simplify javascript: URLs in vomnibar.Stephen Blott
Show "javascript:" URLs as "javascript:...". Fixes #961.
2016-02-16Use `for own ... of` instead of `for ... of`mrmr1993
2016-02-09BgUtils; move tabRecency to bg_tiles.coffee.Stephen Blott
Certain background-page utilities are actually shared, and are therefore best placed in place that reflects that. Here, tabRecency is moved to the new gb_utils.coffee in preparation for implementing a go-to-previous-tab command. In particular, it is no longer appropriate that tabRecency be embedded within the completion code. logMessage() from main.coffee is also a candidate for moving to bg_utils.coffee.
2015-09-11Move escaping regex special chars to its own utility functionmrmr1993
2015-06-07Speed up vomnibar load.Stephen Blott
With #1697, the vomnibar used with a custom-search keyword is not initially empty (it shows the primary suggestion for the custom search engine, even if the query is empty). The way things were structured previously, the user nevertheless had to wait until the history cache (which was not actually required) had been fetched before the vomnibar was updated. This commit just flips things around a bit such that, - onComplete() is called immediately if the history is not actually required, and - the history cache is primed before it is needed, so it will (hopefully) be available before the user's next keystroke. This avoids a noticable delay, particularly on start up and with a large history. (This is part of a sequence of vomnibar UX tweaks.)
2015-06-06Merge branch 'rework-completions'Stephen Blott
Conflicts: background_scripts/completion.coffee background_scripts/completion_engines.coffee
2015-06-06Re-work completions: only offer actual search URL matches.Stephen Blott
When filter suggestions from other completers, most notably the history completer, we only keep suggestions which match the current searchUrl and completer. Here, we also *replace* the URL of the suggestion. With duplicate elimination, multiple history entries (e.g. those generated with various "Search Tools" settings on Google) will be collapsed to one. This matters because, with custom search engines, we don't show the URL, so the user can't see differences in the URL. Without this, the user can be presented with a list of apparently identical completions.
2015-06-06Re-work completions: extend engine wrapper to handle prefixes.Stephen Blott
This commit contains the bulk og the material changes for which the previous commits established the basis. 1) Add a general framework for detecting query prefixes in search URLs, adding them to query sent to the completion engine, and stripping them from the resulting suggestions. This allows the user to have a search engine... j: http://www.google.com/search?q=javascript+%s Javascript and have the prefix "javascript" included (automatically) in queries sent to completion engines, which results in substantially better suggestions. 2) Re-work completion for Google Maps in a simpler form.
2015-06-03Only offer suggestions from the current custom search engine.Stephen Blott
When the user changes custom search engine during a single vomnibar activation, we should only offer suggestions which match the current search engine (not the previous one). We now do this not just by checking that the suggestion is a custom search suggestion, but by checking that the actual search URL matches.
2015-06-02De-duplicate Google Maps URLs in vomnibar.Stephen Blott
In Google Maps, we get a new history entry for every pan and every zoom. This removes such duplicates.
2015-05-29Move search-engine parsing to Utils.Stephen Blott
This will allow us to use the same search-engine parsing code in the background page and in content scripts.
2015-05-29Merge branch 'completion-on-custom-search-only' into ↵Stephen Blott
completion-on-custom-search-only-merge Conflicts: background_scripts/completion.coffee
2015-05-28Custom-only: fix long-standing race condition.Stephen Blott
In omni mode, the vomnibar suggestions are updated asynchronously. Therefore, the contents of the primary custom search-engine suggestion may be behind the actual contents of the comnibar input. So, we reconstruct the custom search-engine query on "enter". (This fixes a long-standing race condition.)
2015-05-28Custom-only: remove now unnecessary optimisation.Stephen Blott
This optimisation is now unnecessary, because we will *always* show at least one completion suggestion in top spot.
2015-05-28Custom-only: ensure top-ranking completion is always in top slot.Stephen Blott
This ensures that <Tab> can always be used to complete the top-ranking completion.
2015-05-28Custom-only: remove omniSearchWeightOption.Stephen Blott
This option is no longer needed, since we don't do search completion except for custom searches.
2015-05-28Custom-only: strip non-custom search code.Stephen Blott
2015-05-27Remove unintentionally pushed console.log()s.Stephen Blott
2015-05-27Consistent highlighting of search suggestions.Stephen Blott
Also suppress highlighting of matching text in previous suggestions. (It looks odd to have highlighting in some suggestions but not others, with no apparent difference to the user.)
2015-05-27Fix significant typo.Stephen Blott
Fix incorrect property name from 764d70312f292882abe4940adf9fee3d6e834327.
2015-05-27Do not de-duplicate tabs vomnibar entries.Stephen Blott
2015-05-27Custom-only: fix comment.Stephen Blott
2015-05-27Custom-only: verify match on query terms alone.Stephen Blott
2015-05-27Custom-only: single-line completions for custom search engines.Stephen Blott
2015-05-27Custom-only: always filter for the custom search engine.Stephen Blott
2015-05-27Custom-only: disable default search completion.Stephen Blott
2015-05-26Change vomnibar insert-text indicator.Stephen Blott
Use a rightwards hooked arrow instead of a small greater-than sign, which according to @philc, renders as a large greater-than sign on Macs, See #1651.
2015-05-21Search completion; must return an array from this filter.Stephen Blott
2015-05-20Search completion; tweak appearance of historical search queries (descriptions).Stephen Blott
2015-05-19Search completion; minor code review.Stephen Blott
2015-05-19Add insertText visual indicator.Stephen Blott
Conflicts: background_scripts/completion.coffee
2015-05-19Search completion; tweak appearance of historical search queries.Stephen Blott
2015-05-18Fully fix 3646b8c999a9e4b864e8c529f84b64a3c2c74ff0.Stephen Blott
2015-05-18Search completion; filter out the default search.Stephen Blott
See example in diff. Do not offer a suggestion if it is what the user would get anyway if they just hit <Enter>.
2015-05-18Revert "Search completion; promote the top completion."Stephen Blott
This reverts commit 4309dcd3030687f3ed02b86bbdf7c485baaee4a5. This is a bad idea. It pushes the suggestion at the top of the list out of the way. Users aren't going to like that if it's the one they're looking for. Conflicts: background_scripts/completion.coffee
2015-05-18Search completion; retain previous suggestions (tweak highlighting).Stephen Blott
2015-05-18Search completion; retain previous suggestions (comments and tweaks).Stephen Blott
2015-05-18Search completion; retain previous (matching) suggestions.Stephen Blott
This address "UX Issue 2" from #1651. If the user types "w lake vict" and sees a suggestion "lake victoria perch", and continues "w lake vict pe", then we retain the previous suggestion (which still matches) despite the fact that the completion no longer delivers it. This creates a more consistent, Vimium-like vomnibar UX.
2015-05-18Merge branch 'search-completion-UX-tweaks'Stephen Blott
2015-05-18Merge branch 'vomnibar-insert-history-with-tab'Stephen Blott
Conflicts: background_scripts/completion.coffee
2015-05-18Search completion; remove console.log().Stephen Blott
2015-05-18Search completion; promote the top completion.Stephen Blott
This puts the first (top) completion suggestion at the top of the list: either one or two <Tab>s away, depending upon whether a domain-completer suggestion is present or not.
2015-05-18Search completion; do not adapt completion scoring.Stephen Blott
The relevancy score of completion suggestions should not change as the user continues to type. See "UX Issue 1" in #1651. (The effect of the previous implementation was that search completions would jump, unpredictably, up the suggestion list, often displacing suggestions from other completers for no reason which was apparent to the user.)
2015-05-18Disable relevancy debugging (again).Stephen Blott
Oops. I left this on, again.
2015-05-17use a less brittle approach to decoding URIs.Stephen Blott