Interface nsISearchEngineType

Hierarchy

Properties

alias: string

An optional shortcut alias for the engine. When not an empty string, this is a unique identifier.

description: string

A text description describing the engine.

hidden: boolean

Whether the engine should be hidden from the user.

iconURI: nsIURI

A nsIURI corresponding to the engine's icon, stored locally. May be null.

id: string

The display of the search engine id. This is a unique identifier.

identifier: string

An optional unique identifier for this search engine within the context of the distribution, as provided by the distributing entity.

inMemory: boolean

Whether or not this engine is an in-memory only search engine. These engines are typically application provided or policy engines, where they are loaded every time on SearchService initialization using the policy JSON or the extension manifest. Minimal details of the in-memory engines are saved to disk, but they are never loaded from the user's saved settings file.

isAppProvided: boolean

Whether or not this engine is provided by the application, e.g. it is in the list of configured search engines.

isGeneralPurposeEngine: boolean

Whether or not this engine is a "general" search engine, e.g. is it for generally searching the web, or does it have a specific purpose like shopping.

name: string

The display name of the search engine. This is a unique identifier.

searchForm: string

The searchForm URL points to the engine's organic search page. This should not contain neither search term parameters nor partner codes, but may contain parameters which set the engine in the correct way.

This URL is typically the prePath and filePath of the search submission URI, but may vary for different engines. For example, some engines may use a different domain, e.g. https://sub.example.com for the search URI but https://example.org/ for the organic search page.

searchUrlDomain: string

The domain from which search results are returned for this engine.

Returns

the domain of the the search URL.

searchUrlPublicSuffix: string

Returns the public suffix for the submission URL of type SearchUtils.URL_TYPE.SEARCH.

Returns

A string which is a known public suffix, or empty string if one cannot be found.

searchUrlQueryParamName: string

Returns the name of the parameter used for the search terms for a submission URL of type SearchUtils.URL_TYPE.SEARCH.

Returns

A string which is the name of the parameter, or empty string if no parameter cannot be found or is not supported (e.g. POST).

sendAttributionRequest: boolean

A boolean to indicate if we should send an attribution request to Mozilla's server.

telemetryId: string

The identifier to use for this engine when submitting to telemetry.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Returns a string with the URL to an engine's icon matching both width and height. Returns null if icon with specified dimensions is not found.

    Parameters

    • width: number

      Width of the requested icon.

    • height: number

      Height of the requested icon.

    Returns string

  • Gets an array of all available icons. Each entry is an object with width, height and url properties. width and height are numeric and represent the icon's dimensions. url is a string with the URL for the icon.

    Returns any

  • Gets a nsISearchSubmission object that contains information about what to send to the search engine, including the URI and postData, if applicable.

    Returns

    nsISearchSubmission The submission data. If no appropriate submission can be determined for the request type, this may be null.

    Parameters

    • searchTerms: string

      The search term(s) for the submission.

    • responseType: string

      [optional] The MIME type that we'd like to receive in response to this submission. If null, will default to "text/html".

    • purpose: string

      [optional] A string that indicates the context of the search request. This may then be used to provide different submission data depending on the context.

    Returns nsISearchSubmission

  • Returns the search term of a possible search result URI if and only if:

    • The URI has the same scheme, host, and path as the engine.
    • All query parameters of the URI have a matching name and value in the engine.
    • An exception to the equality check is the engine's termsParameterName value, which contains a placeholder, i.e. {searchTerms}.
    • If an engine has query parameters with "null" values, they will be ignored.

    Returns

    A string representing the termsParameterName value of the URI, or an empty string if the URI isn't matched to the engine.

    Parameters

    • uri: nsIURI

      A URI that may or may not be from a search result matching the engine.

    Returns string

  • Opens a speculative connection to the engine's search URI (and suggest URI, if different) to reduce request latency

    Throws

    NS_ERROR_INVALID_ARG if options is omitted or lacks required elemeents

    Parameters

    • options: any

      An object that must contain the following fields: {window} the content window for the window performing the search {originAttributes} the originAttributes for performing the search

    Returns void

  • Determines whether the engine can return responses in the given MIME type. Returns true if the engine spec has a URL with the given responseType, false otherwise.

    Parameters

    • responseType: string

      The MIME type to check for

    Returns boolean

Generated using TypeDoc