"suggest.wikipedia", "suggest.quicksuggest.all", ]; } get primaryUserControlledPreferences() { return ["suggest.wikipedia"]; } get merinoProvider() { return "wikipedia"; } get rustSuggestionType() { return "Wikipedia"; } isSuggestionSponsored() { return false; } getSuggestionTelemetryType(suggestion) { // Previously online Wikipedia suggestions were not managed by this feature // and they had a separate telemetry type, so we carry that forward here. return suggestion.source == "merino" ? "wikipedia" : "adm_nonsponsored"; } makeResult(queryContext, suggestion) { let { value: title, highlights: titleHighlights } = lazy.QuickSuggest.getFullKeywordTitleAndHighlights({ tokens: queryContext.tokens, highlightType: lazy.UrlbarUtils.HIGHLIGHT.SUGGESTED, // Merino uses snake_case, so this will be `full_keyword` for it. fullKeyword: suggestion.fullKeyword ?? suggestion.full_keyword, title: suggestion.title, }); return new lazy.UrlbarResult({ type: lazy.UrlbarUtils.RESULT_TYPE.URL, source: lazy.UrlbarUtils.RESULT_SOURCE.SEARCH, payload: { url: suggestion.url, title, isBlockable: true, isManageable: true, }, highlights: { title: titleHighlights, }, }); } onEngagement(queryContext, controller, details, _searchString) { let { result } = details; // Handle commands. These suggestions support the Dismissal and Manage // commands. Dismissal is the only one we need to handle here. `UrlbarInput` // handles Manage. if (details.selType == "dismiss") { lazy.QuickSuggest.dismissResult(result); controller.removeResult(result); } } } PK