Skip to content

Commit 67a5e99

Browse files
committed
Add omnibox default suggestion handling
1 parent dc0b200 commit 67a5e99

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

extension/background/omnibox.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,21 @@ chrome.omnibox.onInputChanged.addListener(
7575
// TODO: Provide user the option to choose which of the following two options will be used to provide suggestions.
7676
// TODO: Use StackOverflow api to get list of questions and sort them based on relevance.
7777
// TODO: Use filters provided by user to show suggestions
78+
79+
chrome.storage.sync.get({
80+
questionsWithCodeFilter: false,
81+
communityWikisFilter: false,
82+
excludeDuplicateQuestionsFilter: false,
83+
answerTypeFilter: 0,
84+
customFilter: ""
85+
}, function(items) {
86+
87+
var filterString = getFilterString(
88+
items.questionsWithCodeFilter,
89+
items.communityWikisFilter,
90+
items.excludeDuplicateQuestionsFilter,
91+
items.answerTypeFilter,
92+
items.customFilter);
93+
chrome.omnibox.setDefaultSuggestion({ description: filterString + query });
7894
}
7995
)

0 commit comments

Comments
 (0)