Go back to top

vivaldi.searchEngines Modders API Reference

API for accessing Chromium's TemplateURLService.

Types

#DefaultType

ENUM

⚠ NO DESCRIPTION PROVIDED

  • defaultSearch
  • defaultPrivate
  • defaultSearchField
  • defaultSearchFieldPrivate
  • defaultSpeeddials
  • defaultSpeeddialsPrivate
  • defaultImage
  • #TemplateURL

    Represents a specific search engine. Urls and post params should only be used when editing the properties of a TemplateURL

    Properties:

    guid
    string

    ⚠ NO DESCRIPTION PROVIDED

    readOnly
    boolean

    Search engines are marked as read only if they are provided by extensions, or early on if they come from the set available before the service is fully loaded

    extensionId
    string

    For regular search engines, this string is empty. Otherwise it contains the id of the extension that provided the search.

    name
    string

    ⚠ NO DESCRIPTION PROVIDED

    keyword
    string

    ⚠ NO DESCRIPTION PROVIDED

    faviconUrl
    string

    ⚠ NO DESCRIPTION PROVIDED

    url
    string

    ⚠ NO DESCRIPTION PROVIDED

    postParams
    string

    ⚠ NO DESCRIPTION PROVIDED

    suggestUrl
    string

    ⚠ NO DESCRIPTION PROVIDED

    suggestPostParams
    string

    ⚠ NO DESCRIPTION PROVIDED

    imageUrl
    string

    ⚠ NO DESCRIPTION PROVIDED

    imagePostParams
    string

    ⚠ NO DESCRIPTION PROVIDED

    prepopulateId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    starterPackId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    isActive
    integer

    0 is unspecified, 1 is active, 2 is inactive.

    #AllTemplateURLs

    ⚠ NO DESCRIPTION PROVIDED

    Properties:

    templateUrls

    ⚠ NO DESCRIPTION PROVIDED

    Array of:

    • TemplateURL
    starterPackEngines

    ⚠ NO DESCRIPTION PROVIDED

    Array of:

    • TemplateURL
    defaultSearch
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultPrivate
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultSearchField
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultSearchFieldPrivate
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultSpeeddials
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultSpeeddialsPrivate
    string

    ⚠ NO DESCRIPTION PROVIDED

    defaultImage
    string

    ⚠ NO DESCRIPTION PROVIDED

    systemDefaultSearchChanged
    boolean

    ⚠ NO DESCRIPTION PROVIDED

    #SearchRequest

    ⚠ NO DESCRIPTION PROVIDED

    Properties:

    url
    string

    ⚠ NO DESCRIPTION PROVIDED

    contentType
    string

    ⚠ NO DESCRIPTION PROVIDED

    postParams
    string

    ⚠ NO DESCRIPTION PROVIDED

    #SwitchPromptData

    ⚠ NO DESCRIPTION PROVIDED

    Properties:

    shouldPrompt
    boolean

    True if the user should be prompted to switch search engines.

    promptType
    string

    Type of the dialog that should be displayed.

    currentSearchEngine
    TemplateURL

    ⚠ NO DESCRIPTION PROVIDED

    partnerSearchEngines

    ⚠ NO DESCRIPTION PROVIDED

    Array of:

    • TemplateURL

    Listeners

    How to use listeners

    Each listener type has the same functions, used for each listener API in the same way:

    .addListener(function callback)

    Adds a function to a listener for an event

    .removeListener(function callback)

    Removes a function to a listener for an event

    .hasListener(function callback)

    Returns a boolean if a function is attached to a listener for an event

    .hasListeners()

    Returns a boolean if a listener has any attached functions

    .dispatch()

    Returns array of promises dispatched to the listener

    #onTemplateUrlsChanged

    Informs that template URLs have changed

    Methods

    #getKeywordForUrl

    Obtains the default keyword for a given search URL

    Parameters:

    url
    string

    ⚠ NO DESCRIPTION PROVIDED

    #getTemplateUrls

    Retrieves data about all template URLS.

    #addTemplateUrl

    Adds a template url.

    Parameters:

    templateUrl
    TemplateURL

    ⚠ NO DESCRIPTION PROVIDED

    #removeTemplateUrl

    Removes a template url.

    Parameters:

    guid
    string

    ⚠ NO DESCRIPTION PROVIDED

    #updateTemplateUrl

    Changes a template url.

    Parameters:

    templateUrl
    TemplateURL

    ⚠ NO DESCRIPTION PROVIDED

    #moveTemplateUrl

    reorders by moving a search engine before another one

    Parameters:

    guid
    string

    The search engine to move

    successor_guid
    (optional)
    string

    The search engine will be moved before the one with this guid or to the end if omitted. Must be different from guid.

    #setDefault

    Sets a default template url.

    Parameters:

    defaultType
    DefaultType

    ⚠ NO DESCRIPTION PROVIDED

    guid
    string

    ⚠ NO DESCRIPTION PROVIDED

    #getSearchRequest

    Provides the request info to use for performing a search

    Parameters:

    guid
    string

    ⚠ NO DESCRIPTION PROVIDED

    searchTerms
    string

    ⚠ NO DESCRIPTION PROVIDED

    #repairPrepopulatedTemplateUrls

    resets the prepopulated template urls and the default search

    Parameters:

    onlyKeepPrepopulated
    boolean

    ⚠ NO DESCRIPTION PROVIDED

    #getSwitchPromptData

    Gathers and returns the needed info for partner search engine switch dialog.

    #acknowledgeSwitchPrompt

    Mark current switch prompt as seen.

    #setIsActive

    Used to enable or disable a starter pack engine.

    Parameters:

    guid
    string

    ⚠ NO DESCRIPTION PROVIDED

    isActive
    boolean

    ⚠ NO DESCRIPTION PROVIDED