android-components / mozilla.components.browser.search.provider / AssetsSearchEngineProvider

AssetsSearchEngineProvider

class AssetsSearchEngineProvider : SearchEngineProvider (source)

SearchEngineProvider implementation to load the included search engines from assets.

A SearchLocalizationProvider implementation is used to customize the returned search engines for the language and country of the user/device.

Optionally SearchEngineFilter instances can be provided to remove unwanted search engines from the loaded list.

Optionally additionalIdentifiers to be loaded can be specified. A search engine identifier corresponds to the search plugin XML file name (e.g. duckduckgo -> duckduckgo.xml).

Constructors

Name Summary
<init> AssetsSearchEngineProvider(localizationProvider: SearchLocalizationProvider, filters: List<SearchEngineFilter> = emptyList(), additionalIdentifiers: List<String> = emptyList())
SearchEngineProvider implementation to load the included search engines from assets.

Functions

Name Summary
loadSearchEngines suspend fun loadSearchEngines(context: <ERROR CLASS>): SearchEngineList
Load search engines from this provider.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.