From 9a7b46ae59ed3a745e76e8f86c213fee631574d6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 20 Apr 2017 14:46:28 +0100 Subject: Firefox: some history entries have no title. This causes `o`/`O` to crash (producing no suggestions). As a workaround, set any such title to "". --- background_scripts/completion.coffee | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 66ad2e38..987ba8a4 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -763,6 +763,8 @@ HistoryCache = return @callbacks.push(callback) if @callbacks @callbacks = [callback] chrome.history.search { text: "", maxResults: @size, startTime: 0 }, (history) => + # On Firefox, some history entries do not have titles. + history.map (entry) -> entry.title ?= "" history.sort @compareHistoryByUrl @history = history chrome.history.onVisited.addListener(@onPageVisited.bind(this)) @@ -778,6 +780,8 @@ HistoryCache = # When a page we've seen before has been visited again, be sure to replace our History item so it has the # correct "lastVisitTime". That's crucial for ranking Vomnibar suggestions. onPageVisited: (newPage) -> + # On Firefox, some history entries do not have titles. + newPage.title ?= "" i = HistoryCache.binarySearch(newPage, @history, @compareHistoryByUrl) pageWasFound = (@history[i]?.url == newPage.url) if pageWasFound -- cgit v1.2.3